mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 11:10:08 +00:00
added page cloning to the editor...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6b36c34c91
commit
fc3ede4f5a
2
TODO.otl
2
TODO.otl
@ -4,7 +4,7 @@
|
|||||||
[_] change image
|
[_] change image
|
||||||
[_] add page via template
|
[_] add page via template
|
||||||
[_] load/save from JSON
|
[_] load/save from JSON
|
||||||
[_] basic instructions
|
[_] basic instructions/docs...
|
||||||
[_] 37% Version 1.0 checklist (migration to layout.html)
|
[_] 37% Version 1.0 checklist (migration to layout.html)
|
||||||
[X] page scaling for full page view
|
[X] page scaling for full page view
|
||||||
[X] top/bottom toolbars
|
[X] top/bottom toolbars
|
||||||
|
|||||||
39
editor.js
39
editor.js
@ -232,6 +232,7 @@ function setupEditorToolbars(){
|
|||||||
.appendTo(indicator)
|
.appendTo(indicator)
|
||||||
|
|
||||||
$('<button class="button remove">×</button>')
|
$('<button class="button remove">×</button>')
|
||||||
|
.attr('title', 'Remove')
|
||||||
.appendTo(indicator)
|
.appendTo(indicator)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
setTransitionDuration($('.magazine'), 0)
|
setTransitionDuration($('.magazine'), 0)
|
||||||
@ -242,14 +243,27 @@ function setupEditorToolbars(){
|
|||||||
})
|
})
|
||||||
|
|
||||||
$('<button class="button shift">></button>')
|
$('<button class="button shift">></button>')
|
||||||
|
.attr('title', 'Move (w. Shift - Clone)')
|
||||||
.appendTo(right_bar)
|
.appendTo(right_bar)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
shiftPageRight()
|
// if shift is pressed duplicate current page...
|
||||||
runMagazineTemplates()
|
if(event.shiftKey){
|
||||||
|
var n = getPageNumber()
|
||||||
|
setTransitionDuration($('.magazine'), 0)
|
||||||
|
$('.current.page')
|
||||||
|
.clone(true, true)
|
||||||
|
.removeClass('current')
|
||||||
|
.insertAfter($('.current.page'))
|
||||||
|
setCurrentPage(n)
|
||||||
|
// simply move...
|
||||||
|
} else {
|
||||||
|
shiftPageRight()
|
||||||
|
runMagazineTemplates()
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
$('<button class="button add">+</button>')
|
$('<button class="button add">+</button>')
|
||||||
|
.attr('title', 'New page')
|
||||||
.appendTo(right_bar)
|
.appendTo(right_bar)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
|
|
||||||
@ -257,14 +271,27 @@ function setupEditorToolbars(){
|
|||||||
})
|
})
|
||||||
|
|
||||||
$('<button class="button shift"><</button>')
|
$('<button class="button shift"><</button>')
|
||||||
|
.attr('title', 'Move (w. Shift - Clone)')
|
||||||
.appendTo(left_bar)
|
.appendTo(left_bar)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
shiftPageLeft()
|
// if shift is pressed duplicate current page...
|
||||||
runMagazineTemplates()
|
if(event.shiftKey){
|
||||||
|
var n = getPageNumber()
|
||||||
|
setTransitionDuration($('.magazine'), 0)
|
||||||
|
$('.current.page')
|
||||||
|
.clone(true, true)
|
||||||
|
.removeClass('current')
|
||||||
|
.insertBefore($('.current.page'))
|
||||||
|
setCurrentPage(n+1)
|
||||||
|
// simply move...
|
||||||
|
} else {
|
||||||
|
shiftPageLeft()
|
||||||
|
runMagazineTemplates()
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
$('<button class="button add">+</button>')
|
$('<button class="button add">+</button>')
|
||||||
|
.attr('title', 'New page')
|
||||||
.appendTo(left_bar)
|
.appendTo(left_bar)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user