mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 11:50:07 +00:00
house keeping and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8c2dab109d
commit
12979718f6
@ -279,7 +279,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
|
|
||||||
Esc: doc('Hide marks',
|
Esc: doc('Hide marks',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkesView('off')
|
toggleMarksView('off')
|
||||||
return false
|
return false
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@ -490,7 +490,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
}),
|
}),
|
||||||
alt: doc('Shift marked images up',
|
alt: doc('Shift marked images up',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkesView('on')
|
toggleMarksView('on')
|
||||||
shiftMarkedImagesUp()
|
shiftMarkedImagesUp()
|
||||||
}),
|
}),
|
||||||
'alt+shift': doc('Shift marked images up to empty ribbon',
|
'alt+shift': doc('Shift marked images up to empty ribbon',
|
||||||
@ -519,7 +519,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
}),
|
}),
|
||||||
alt: doc('Shift marked images down',
|
alt: doc('Shift marked images down',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkesView('on')
|
toggleMarksView('on')
|
||||||
shiftMarkedImagesDown()
|
shiftMarkedImagesDown()
|
||||||
}),
|
}),
|
||||||
'alt+shift': doc('Shift marked images down to empty ribbon',
|
'alt+shift': doc('Shift marked images down to empty ribbon',
|
||||||
@ -685,12 +685,12 @@ var KEYBOARD_CONFIG = {
|
|||||||
|
|
||||||
ctrl: doc('Mark current ribbon',
|
ctrl: doc('Mark current ribbon',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkesView('on')
|
toggleMarksView('on')
|
||||||
markAll('ribbon')
|
markAll('ribbon')
|
||||||
}),
|
}),
|
||||||
'ctrl+shift': doc('Mark all images',
|
'ctrl+shift': doc('Mark all images',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkesView('on')
|
toggleMarksView('on')
|
||||||
markAll('all')
|
markAll('all')
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@ -715,7 +715,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
|
|
||||||
// XXX add a non FXX key for macs...
|
// XXX add a non FXX key for macs...
|
||||||
F2: doc('Toggle mark visibility',
|
F2: doc('Toggle mark visibility',
|
||||||
function(){ toggleMarkesView() }),
|
function(){ toggleMarksView() }),
|
||||||
// XXX should we be able to toggle crop modes from single image mode???
|
// XXX should we be able to toggle crop modes from single image mode???
|
||||||
// ...if yes, then remove the F2 & F3 definitions form ribbon
|
// ...if yes, then remove the F2 & F3 definitions form ribbon
|
||||||
// mode...
|
// mode...
|
||||||
@ -723,7 +723,7 @@ var KEYBOARD_CONFIG = {
|
|||||||
/*
|
/*
|
||||||
F2: {
|
F2: {
|
||||||
default: doc('Toggle mark visibility',
|
default: doc('Toggle mark visibility',
|
||||||
function(){ toggleMarkesView() }),
|
function(){ toggleMarksView() }),
|
||||||
shift: doc('Crop marked only images',
|
shift: doc('Crop marked only images',
|
||||||
function(){
|
function(){
|
||||||
toggleMarkedOnlyView('on')
|
toggleMarkedOnlyView('on')
|
||||||
|
|||||||
13
ui/marks.js
13
ui/marks.js
@ -87,14 +87,12 @@ var getMarkedGIDBefore = makeGIDBeforeGetterFromList(
|
|||||||
// - 'off' : force remove mark
|
// - 'off' : force remove mark
|
||||||
// - 'next' : toggle next state (default)
|
// - 'next' : toggle next state (default)
|
||||||
// NOTE: when passing this a gid, the 'next' action is not supported
|
// NOTE: when passing this a gid, the 'next' action is not supported
|
||||||
//
|
|
||||||
// XXX do we need a pre-callback here???
|
|
||||||
function makeMarkToggler(img_class, mark_class, evt_name, callback){
|
function makeMarkToggler(img_class, mark_class, evt_name, callback){
|
||||||
return createCSSClassToggler(
|
return createCSSClassToggler(
|
||||||
'.current.image',
|
'.current.image',
|
||||||
img_class,
|
img_class,
|
||||||
function(action, elem){
|
function(action, elem){
|
||||||
toggleMarkesView('on')
|
toggleMarksView('on')
|
||||||
|
|
||||||
// we got a gid...
|
// we got a gid...
|
||||||
if(elem.length == 0 && elem.selector in IMAGES){
|
if(elem.length == 0 && elem.selector in IMAGES){
|
||||||
@ -125,7 +123,7 @@ function makeMarkToggler(img_class, mark_class, evt_name, callback){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// generate an image updater function...
|
// Generate an image updater function...
|
||||||
//
|
//
|
||||||
// the resulting function will update image mark state by adding or
|
// the resulting function will update image mark state by adding or
|
||||||
// removing the mark the specific mark object.
|
// removing the mark the specific mark object.
|
||||||
@ -191,7 +189,7 @@ var toggleMarkedOnlyWithRibbonsView = makeCropModeToggler(
|
|||||||
|
|
||||||
|
|
||||||
// XXX shifting images and unmarking in this mode do not work correctly...
|
// XXX shifting images and unmarking in this mode do not work correctly...
|
||||||
var toggleMarkesView = createCSSClassToggler(
|
var toggleMarksView = createCSSClassToggler(
|
||||||
'.viewer',
|
'.viewer',
|
||||||
'marks-visible',
|
'marks-visible',
|
||||||
function(){
|
function(){
|
||||||
@ -468,7 +466,7 @@ function shiftMarkedImagesRight(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// focus next/prev mark...
|
// Focus next/prev mark...
|
||||||
//
|
//
|
||||||
// NOTE: these will not jump to marks on other ribbons... to prevent this
|
// NOTE: these will not jump to marks on other ribbons... to prevent this
|
||||||
// add true as the final argument (see restrict_to_ribbon argument
|
// add true as the final argument (see restrict_to_ribbon argument
|
||||||
@ -579,7 +577,6 @@ var loadFileMarks = makeFileLoader(
|
|||||||
var t1 = Date.now()
|
var t1 = Date.now()
|
||||||
marksUpdated()
|
marksUpdated()
|
||||||
|
|
||||||
// XXX is this the correct way to do this???
|
|
||||||
DATA.version = DATA_VERSION
|
DATA.version = DATA_VERSION
|
||||||
dataUpdated()
|
dataUpdated()
|
||||||
|
|
||||||
@ -620,7 +617,7 @@ function setupMarks(viewer){
|
|||||||
showGlobalIndicator(
|
showGlobalIndicator(
|
||||||
'marks-visible',
|
'marks-visible',
|
||||||
'Marks visible (F2)')
|
'Marks visible (F2)')
|
||||||
.click(function(){ toggleMarkesView() })
|
.click(function(){ toggleMarksView() })
|
||||||
showGlobalIndicator(
|
showGlobalIndicator(
|
||||||
'marked-only-visible',
|
'marked-only-visible',
|
||||||
'Marked only images visible (shift-F2)')
|
'Marked only images visible (shift-F2)')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user