mirror of
https://github.com/flynx/ImageGrid.git
synced 2026-01-08 19:31:07 +00:00
some minore cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6212961fce
commit
533c13faff
@ -260,7 +260,6 @@ function setupEvents(){
|
|||||||
// XXX cancel clicks while dragging...
|
// XXX cancel clicks while dragging...
|
||||||
// XXX this does not work on android...
|
// XXX this does not work on android...
|
||||||
$('.field').draggable()
|
$('.field').draggable()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -275,17 +274,12 @@ function setupControlElements(){
|
|||||||
// XXX rename classes to "shift-image-up" and "shift-image-down"...
|
// XXX rename classes to "shift-image-up" and "shift-image-down"...
|
||||||
$('.screen-button.demote').click(shiftImageUp)
|
$('.screen-button.demote').click(shiftImageUp)
|
||||||
$('.screen-button.promote').click(shiftImageDown)
|
$('.screen-button.promote').click(shiftImageDown)
|
||||||
|
|
||||||
$('.screen-button.zoom-in').click(function(){scaleContainerBy(ZOOM_FACTOR)})
|
$('.screen-button.zoom-in').click(function(){scaleContainerBy(ZOOM_FACTOR)})
|
||||||
$('.screen-button.zoom-out').click(function(){scaleContainerBy(1/ZOOM_FACTOR)})
|
$('.screen-button.zoom-out').click(function(){scaleContainerBy(1/ZOOM_FACTOR)})
|
||||||
|
|
||||||
$('.screen-button.toggle-wide').click(toggleWideView)
|
$('.screen-button.toggle-wide').click(toggleWideView)
|
||||||
$('.screen-button.toggle-single').click(toggleSingleImageMode)
|
$('.screen-button.toggle-single').click(toggleSingleImageMode)
|
||||||
|
|
||||||
$('.screen-button.fit-three').click(fitThreeImages)
|
$('.screen-button.fit-three').click(fitThreeImages)
|
||||||
|
|
||||||
$('.screen-button.show-controls').click(showControls)
|
$('.screen-button.show-controls').click(showControls)
|
||||||
|
|
||||||
$('.screen-button.settings').click(function(){alert('not implemented yet...')})
|
$('.screen-button.settings').click(function(){alert('not implemented yet...')})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,6 +317,7 @@ function loadImages(json){
|
|||||||
* ]
|
* ]
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
// XXX add incremental or partial updates...
|
||||||
function buildJSON(get_order){
|
function buildJSON(get_order){
|
||||||
if(get_order == null){
|
if(get_order == null){
|
||||||
get_order = getImageOrder
|
get_order = getImageOrder
|
||||||
@ -340,7 +335,7 @@ function buildJSON(get_order){
|
|||||||
var id = get_order(image)
|
var id = get_order(image)
|
||||||
ribbon[id] = {
|
ribbon[id] = {
|
||||||
// unwrap the url...
|
// unwrap the url...
|
||||||
// XXX would be nice to make this a relative path...
|
// XXX would be nice to make this a relative path... (???)
|
||||||
url: /url\((.*)\)/.exec(image.css('background-image'))[1],
|
url: /url\((.*)\)/.exec(image.css('background-image'))[1],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -348,8 +343,6 @@ function buildJSON(get_order){
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX add incremental or partial updates...
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// XXX use this instead of loadImages(...)
|
// XXX use this instead of loadImages(...)
|
||||||
@ -453,7 +446,6 @@ function getCurrentHorizontalOffset(image){
|
|||||||
var W = $('.container').width()
|
var W = $('.container').width()
|
||||||
var w = images.outerWidth(true)
|
var w = images.outerWidth(true)
|
||||||
// margin...
|
// margin...
|
||||||
// XXX do we need this?
|
|
||||||
var mw = w - images.outerWidth()
|
var mw = w - images.outerWidth()
|
||||||
// current square position (1-based)
|
// current square position (1-based)
|
||||||
var sn = images.index(image) + 1
|
var sn = images.index(image) + 1
|
||||||
@ -465,14 +457,11 @@ function getCurrentHorizontalOffset(image){
|
|||||||
|
|
||||||
|
|
||||||
function centerSquare(){
|
function centerSquare(){
|
||||||
|
|
||||||
$('.field').css({
|
$('.field').css({
|
||||||
'margin-top': getCurrentVerticalOffset()
|
'margin-top': getCurrentVerticalOffset()
|
||||||
})
|
})
|
||||||
|
|
||||||
// horizontal...
|
// horizontal...
|
||||||
alignRibbon()
|
alignRibbon()
|
||||||
|
|
||||||
centerCurrentImage()
|
centerCurrentImage()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,9 +750,6 @@ function centerOrigin(){
|
|||||||
var W = $('.container').width()
|
var W = $('.container').width()
|
||||||
var H = $('.container').height()
|
var H = $('.container').height()
|
||||||
|
|
||||||
//var ot = mt + H/2 + t
|
|
||||||
//var ol = ml + W/2 + l
|
|
||||||
|
|
||||||
var ot = -getCurrentVerticalOffset() + H/2 - t
|
var ot = -getCurrentVerticalOffset() + H/2 - t
|
||||||
var ol = -ml + W/2 - l
|
var ol = -ml + W/2 - l
|
||||||
|
|
||||||
@ -1093,18 +1079,6 @@ var shiftImageUp = function(){ return shiftImage('prev') }
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function flipRibbons(){
|
|
||||||
var ribbons = $('.ribbon')
|
|
||||||
// index of current ribbon, needed to adjust placement of everything...
|
|
||||||
var cur = ribbon.index($('.current.ribbon'))
|
|
||||||
|
|
||||||
// XXX would have been nice if we could do detach reverse attach or just reverse...
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
// vim:set ts=4 sw=4 nowrap :
|
// vim:set ts=4 sw=4 nowrap :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user