Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
50a7c7fc
Commit
50a7c7fc
authored
May 22, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working presentation editor gadget
parent
e5044033
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
391 additions
and
308 deletions
+391
-308
Gruntfile.js
Gruntfile.js
+9
-1
src/presentation_editor/images/tweed.png
src/presentation_editor/images/tweed.png
+0
-0
src/presentation_editor/images/ui-icons_222222_256x240.png
src/presentation_editor/images/ui-icons_222222_256x240.png
+0
-0
src/presentation_editor/presentation_editor.css
src/presentation_editor/presentation_editor.css
+63
-0
src/presentation_editor/presentation_editor.js
src/presentation_editor/presentation_editor.js
+319
-307
No files found.
Gruntfile.js
View file @
50a7c7fc
...
@@ -94,7 +94,9 @@ module.exports = function (grunt) {
...
@@ -94,7 +94,9 @@ module.exports = function (grunt) {
"
<%= global_config.dest %>/erp5/erp5.css
"
:
"
<%= global_config.dest %>/erp5/erp5.css
"
:
"
<%= global_config.src %>/erp5/erp5.less
"
,
"
<%= global_config.src %>/erp5/erp5.less
"
,
"
<%= global_config.dest %>/twin_erp5/superindex.css
"
:
"
<%= global_config.dest %>/twin_erp5/superindex.css
"
:
"
<%= global_config.src %>/twin_erp5/superindex.less
"
"
<%= global_config.src %>/twin_erp5/superindex.less
"
,
"
<%= global_config.dest %>/presentation_editor/presentation_editor.css
"
:
"
<%= global_config.src %>/presentation_editor/presentation_editor.css
"
}
}
}
}
},
},
...
@@ -149,6 +151,12 @@ module.exports = function (grunt) {
...
@@ -149,6 +151,12 @@ module.exports = function (grunt) {
}
}
}
}
},
},
images
:
{
expand
:
true
,
cwd
:
"
<%= global_config.src %>/
"
,
src
:
"
**/images/*.*
"
,
dest
:
"
<%= global_config.dest %>/
"
},
rsvp
:
{
rsvp
:
{
src
:
"
node_modules/rsvp/dist/rsvp-2.0.4.min.js
"
,
src
:
"
node_modules/rsvp/dist/rsvp-2.0.4.min.js
"
,
relative_dest
:
"
lib/rsvp.min.js
"
,
relative_dest
:
"
lib/rsvp.min.js
"
,
...
...
src/presentation_editor/images/tweed.png
0 → 100644
View file @
50a7c7fc
19 KB
src/presentation_editor/images/ui-icons_222222_256x240.png
0 → 100644
View file @
50a7c7fc
4.27 KB
src/presentation_editor/presentation_editor.css
View file @
50a7c7fc
...
@@ -110,3 +110,66 @@ body {
...
@@ -110,3 +110,66 @@ body {
width
:
24%
;
width
:
24%
;
margin
:
3%
margin
:
3%
}
}
.ui-panel
{
width
:
35%
;
}
.ui-panel-position-left
{
left
:
-35%
;
}
.ui-panel-animate.ui-panel-position-left.ui-panel-display-overlay
,
.ui-panel-animate.ui-panel-position-left.ui-panel-display-push
{
-webkit-transform
:
translate3d
(
-35%
,
0
,
0
);
-moz-transform
:
translate3d
(
-35%
,
0
,
0
);
transform
:
translate3d
(
-35%
,
0
,
0
);
}
.ui-panel-position-right
{
right
:
-35%
;
}
.ui-panel-animate.ui-panel-position-right.ui-panel-display-overlay
,
.ui-panel-animate.ui-panel-position-right.ui-panel-display-push
{
-webkit-transform
:
translate3d
(
35%
,
0
,
0
);
-moz-transform
:
translate3d
(
35%
,
0
,
0
);
transform
:
translate3d
(
35%
,
0
,
0
);
}
.ui-panel-page-content-position-left
,
.ui-panel-dismiss-open.ui-panel-dismiss-position-left
{
left
:
35%
;
right
:
-35%
;
}
.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-display-reveal
,
.ui-panel-animate.ui-panel-page-content-position-left.ui-panel-page-content-display-push
{
-webkit-transform
:
translate3d
(
35%
,
0
,
0
);
-moz-transform
:
translate3d
(
35%
,
0
,
0
);
transform
:
translate3d
(
35%
,
0
,
0
);
}
/* panel right open */
.ui-panel-page-content-position-right
,
.ui-panel-dismiss-open.ui-panel-dismiss-position-right
{
left
:
-35%
;
right
:
35%
;
}
/* animated: panel right open (for reveal and push) */
.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-display-reveal
,
.ui-panel-animate.ui-panel-page-content-position-right.ui-panel-page-content-display-push
{
-webkit-transform
:
translate3d
(
-35%
,
0
,
0
);
-moz-transform
:
translate3d
(
-35%
,
0
,
0
);
transform
:
translate3d
(
-35%
,
0
,
0
);
}
@media
(
min-width
:
55em
)
{
.ui-responsive-panel
.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-push
,
.ui-responsive-panel
.ui-panel-page-content-open.ui-panel-page-content-position-left.ui-panel-page-content-display-reveal
{
margin-right
:
35%
;
}
.ui-responsive-panel
.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-push
,
.ui-responsive-panel
.ui-panel-page-content-open.ui-panel-page-content-position-right.ui-panel-page-content-display-reveal
{
margin-left
:
35%
;
}
}
\ No newline at end of file
src/presentation_editor/presentation_editor.js
View file @
50a7c7fc
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
(
function
(
window
,
$
,
html_beautify
,
rJS
)
{
(
function
(
window
,
$
,
html_beautify
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
).
ready
(
function
(
g
)
{
var
presentation
=
null
,
var
presentation
=
null
,
slideForm
,
slideForm
,
newSlideButton
=
$
(
'
#add-slide
'
),
newSlideButton
=
$
(
'
#add-slide
'
),
...
@@ -73,16 +75,28 @@
...
@@ -73,16 +75,28 @@
Slide
.
prototype
=
{
Slide
.
prototype
=
{
dataTemplate
:
document
.
querySelector
(
'
template#slide-data
'
)
dataTemplate
:
document
.
querySelector
(
'
template#slide-data
'
)
.
content
.
firstElementChild
,
.
content
.
firstElementChild
,
htmlTemplate
:
document
.
querySelector
(
'
template#slide-html
'
)
htmlTemplate
:
document
.
querySelector
(
'
template#slide-html
'
)
.
content
.
firstElementChild
,
.
content
.
firstElementChild
,
editBtn
:
function
()
{
return
this
.
html
.
querySelector
(
"
button.edit
"
);
},
editBtn
:
function
()
{
deleteBtn
:
function
()
{
return
this
.
html
.
querySelector
(
"
button.delete
"
);
},
return
this
.
html
.
querySelector
(
"
button.edit
"
);
htmlContent
:
function
()
{
return
this
.
html
.
querySelector
(
"
.content
"
);
},
},
htmlImage
:
function
()
{
return
this
.
html
.
querySelector
(
"
img
"
);
},
deleteBtn
:
function
()
{
htmlTitle
:
function
()
{
return
this
.
html
.
querySelector
(
"
h1
"
);
},
return
this
.
html
.
querySelector
(
"
button.delete
"
);
},
htmlContent
:
function
()
{
return
this
.
html
.
querySelector
(
"
.content
"
);
},
htmlImage
:
function
()
{
return
this
.
html
.
querySelector
(
"
img
"
);
},
htmlTitle
:
function
()
{
return
this
.
html
.
querySelector
(
"
h1
"
);
},
data
:
function
()
{
data
:
function
()
{
var
res
=
document
.
importNode
(
this
.
dataTemplate
,
true
),
img
;
var
res
=
document
.
importNode
(
this
.
dataTemplate
,
true
),
img
;
...
@@ -158,7 +172,8 @@
...
@@ -158,7 +172,8 @@
},
},
attrImageURL
:
function
(
content
)
{
attrImageURL
:
function
(
content
)
{
return
this
.
attrTextInput
(
this
.
elt
.
querySelector
(
'
#image-url
'
),
content
);
return
this
.
attrTextInput
(
this
.
elt
.
querySelector
(
'
#image-url
'
),
content
);
},
},
updatePreview
:
function
(
content
)
{
updatePreview
:
function
(
content
)
{
...
@@ -328,18 +343,15 @@
...
@@ -328,18 +343,15 @@
}
}
});
});
rJS
(
window
)
g
.
editor
=
$
(
'
#slide-list
'
).
presentation
();
})
.
declareMethod
(
'
setContent
'
,
function
(
content
)
{
.
declareMethod
(
'
setContent
'
,
function
(
content
)
{
rJS
(
this
)
.
editor
.
setContent
(
content
);
this
.
editor
.
setContent
(
content
);
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
return
rJS
(
this
).
editor
.
getContent
();
return
this
.
editor
.
getContent
();
})
.
ready
(
function
(
g
)
{
g
.
editor
=
$
(
'
#slide-list
'
).
presentation
();
});
});
}(
window
,
$
,
html_beautify
,
rJS
));
}(
window
,
$
,
html_beautify
,
rJS
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment