mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
some minor cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
092d6a83bf
commit
8082695cb4
@ -1435,6 +1435,7 @@ ImageGrid.GROUP('Zooming',
|
|||||||
}),
|
}),
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Set container scale',
|
title: 'Set container scale',
|
||||||
|
display: false,
|
||||||
},
|
},
|
||||||
function setContainerScale(scale){
|
function setContainerScale(scale){
|
||||||
return setElementScale($('.field'), scale)
|
return setElementScale($('.field'), scale)
|
||||||
@ -1481,6 +1482,7 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
// a cleaner way to do this...
|
// a cleaner way to do this...
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Create a ribbon above/below current'
|
title: 'Create a ribbon above/below current'
|
||||||
|
display: false,
|
||||||
},
|
},
|
||||||
function createRibbon(direction){
|
function createRibbon(direction){
|
||||||
if(direction == 'next'){
|
if(direction == 'next'){
|
||||||
@ -1510,7 +1512,6 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// XXX this uses jquery animation...
|
// XXX this uses jquery animation...
|
||||||
// XXX one way to optimise this is to add the lesser ribbon to the
|
// XXX one way to optimise this is to add the lesser ribbon to the
|
||||||
// greater disregarding their actual order...
|
// greater disregarding their actual order...
|
||||||
@ -1519,6 +1520,7 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
title: 'Merge current and direction ribbon.',
|
title: 'Merge current and direction ribbon.',
|
||||||
doc: 'NOTE: this will take all the elements from direction '+
|
doc: 'NOTE: this will take all the elements from direction '+
|
||||||
'ribbon and add them to current.'
|
'ribbon and add them to current.'
|
||||||
|
display: false,
|
||||||
},
|
},
|
||||||
function mergeRibbons(direction, get_order){
|
function mergeRibbons(direction, get_order){
|
||||||
if(get_order == null){
|
if(get_order == null){
|
||||||
@ -1567,6 +1569,7 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
ImageGrid.GROUP('Image manipulation',
|
ImageGrid.GROUP('Image manipulation',
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Shift image in direction',
|
title: 'Shift image in direction',
|
||||||
|
display: false,
|
||||||
},
|
},
|
||||||
function shiftImage(direction, get_order){
|
function shiftImage(direction, get_order){
|
||||||
if(get_order == null){
|
if(get_order == null){
|
||||||
@ -1606,11 +1609,41 @@ ImageGrid.GROUP('Image manipulation',
|
|||||||
}
|
}
|
||||||
$('.current.image').click()
|
$('.current.image').click()
|
||||||
}),
|
}),
|
||||||
|
// shift image...
|
||||||
ImageGrid.ACTION({ title: 'Shift image up', },
|
ImageGrid.ACTION({ title: 'Shift image up', },
|
||||||
function shiftImageUp(){ return ImageGrid.shiftImage('prev') }),
|
function shiftImageUp(){ return ImageGrid.shiftImage('prev') }),
|
||||||
ImageGrid.ACTION({ title: 'Shift image down', },
|
ImageGrid.ACTION({ title: 'Shift image down', },
|
||||||
function shiftImageDown(){ return ImageGrid.shiftImage('next') }),
|
function shiftImageDown(){ return ImageGrid.shiftImage('next') }),
|
||||||
|
|
||||||
|
// shift image to new ribbon...
|
||||||
|
ImageGrid.ACTION({
|
||||||
|
title: 'Shift image up to new ribbon',
|
||||||
|
},
|
||||||
|
function shiftImageUpNewRibbon(){
|
||||||
|
ImageGrid.createRibbon('prev')
|
||||||
|
ImageGrid.shiftImageUp()
|
||||||
|
}),
|
||||||
|
ImageGrid.ACTION({
|
||||||
|
title: 'Shift image down to new ribbon',
|
||||||
|
},
|
||||||
|
function shiftImageDownNewRibbon(){
|
||||||
|
ImageGrid.createRibbon('next')
|
||||||
|
ImageGrid.shiftImageDown()
|
||||||
|
}),
|
||||||
|
|
||||||
|
// sorting...
|
||||||
|
ImageGrid.ACTION({
|
||||||
|
title: 'Sort images via a different criteria',
|
||||||
|
doc: 'use the cmp function to update image id\'s and resort.'
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
function sortImagesVia(cmp){
|
||||||
|
// reverse ID order...
|
||||||
|
$($('.image').get().sort(cmp))
|
||||||
|
.each(function(i, e){$(e).attr({'id': i})})
|
||||||
|
// resort the images...
|
||||||
|
ImageGrid.sortImages()
|
||||||
|
}),
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Sort images in all ribbons',
|
title: 'Sort images in all ribbons',
|
||||||
doc: 'NOTE: this will only realign three ribbons.'
|
doc: 'NOTE: this will only realign three ribbons.'
|
||||||
@ -1620,17 +1653,6 @@ ImageGrid.GROUP('Image manipulation',
|
|||||||
// compensate for offset cange...
|
// compensate for offset cange...
|
||||||
$('.current.image').click()
|
$('.current.image').click()
|
||||||
}),
|
}),
|
||||||
ImageGrid.ACTION({
|
|
||||||
title: 'Sort images via a different criteria',
|
|
||||||
doc: 'use the cmp function to update image id\'s and resort.'
|
|
||||||
},
|
|
||||||
function sortImagesVia(cmp){
|
|
||||||
// reverse ID order...
|
|
||||||
$($('.image').get().sort(cmp))
|
|
||||||
.each(function(i, e){$(e).attr({'id': i})})
|
|
||||||
// resort the images...
|
|
||||||
ImageGrid.sortImages()
|
|
||||||
}),
|
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Reverse order of images in all ribbons',
|
title: 'Reverse order of images in all ribbons',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -67,20 +67,12 @@ var keybindings = {
|
|||||||
40: {
|
40: {
|
||||||
'default': ImageGrid.focusBelowRibbon, // Down
|
'default': ImageGrid.focusBelowRibbon, // Down
|
||||||
'shift': ImageGrid.shiftImageDown, // shift-Down
|
'shift': ImageGrid.shiftImageDown, // shift-Down
|
||||||
// XXX make this into a real action...
|
'ctrl+shift': ImageGrid.shiftImageDownNewRibbon // ctrl-shift-Down
|
||||||
'ctrl+shift': function(){ // ctrl-shift-Down
|
|
||||||
ImageGrid.createRibbon('next')
|
|
||||||
ImageGrid.shiftImageDown()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
38: {
|
38: {
|
||||||
'default': ImageGrid.focusAboveRibbon, // Up
|
'default': ImageGrid.focusAboveRibbon, // Up
|
||||||
'shift': ImageGrid.shiftImageUp, // shift-Up
|
'shift': ImageGrid.shiftImageUp, // shift-Up
|
||||||
// XXX make this into a real action...
|
'ctrl+shift': ImageGrid.shiftImageUpNewRibbon // ctrl-shift-Up
|
||||||
'ctrl+shift': function(){ // ctrl-shift-Up
|
|
||||||
ImageGrid.createRibbon('prev')
|
|
||||||
ImageGrid.shiftImageUp()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user