a substantial refactoring, still not done compleatly...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2012-08-19 19:30:59 +04:00
parent 111a32c1f0
commit ee3c3cdd8a
2 changed files with 780 additions and 584 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
// NOTE: use String.fromCharCode(code)... // NOTE: use String.fromCharCode(code)...
var keybindings = { var keybindings = {
// togglable modes and options... // togglable modes and options...
191: showSetup, // ? 191: ImageGrid.showSetup, // ?
70: ImageGrid.toggleSingleImageMode, // f 70: ImageGrid.toggleSingleImageMode, // f
83: ImageGrid.toggleSingleRibbonMode, // s 83: ImageGrid.toggleSingleRibbonMode, // s
13: 70, // Enter 13: 70, // Enter
@ -13,59 +13,76 @@ var keybindings = {
77: toggleMarkers, // m 77: toggleMarkers, // m
27: function(){$('.overlay').click()}, // Esc 27: [
// XXX make this into a real action...
function(){$('.overlay').click()}, // Esc
'Hide overlay'
],
// zooming... // zooming...
// XXX make this into a real action...
187: function(){scaleContainerBy(ImageGrid.option.ZOOM_FACTOR)}, // + 187: function(){scaleContainerBy(ImageGrid.option.ZOOM_FACTOR)}, // +
// XXX make this into a real action...
189: function(){scaleContainerBy(1/ImageGrid.option.ZOOM_FACTOR)}, // - 189: function(){scaleContainerBy(1/ImageGrid.option.ZOOM_FACTOR)}, // -
// zoom presets... // zoom presets...
48: { 48: {
'default': fitImage, // 0 'default': fitImage, // 0
// XXX make this into a real action...
'ctrl': function(){setContainerScale(1)}, // ctrl+0 'ctrl': function(){setContainerScale(1)}, // ctrl+0
}, },
49: fitImage, // 1
50: fitTwoImages, // 2
51: fitThreeImages, // 3 51: fitThreeImages, // 3
52: fitFourImages, // 4
53: fitFiveImages, // 5
54: fitSixImages, // 6
55: fitSevenImages, // 7
56: fitEightImages, // 8
57: fitNineImages, // 9
// navigation... // navigation...
36: firstImage, // Home 36: ImageGrid.firstImage, // Home
35: lastImage, // End 35: ImageGrid.lastImage, // End
37: { 37: {
'default': prevImage, // Right 'default': ImageGrid.prevImage, // Right
'ctrl': prevScreenImages, // ctrl-Right 'ctrl': ImageGrid.prevScreenImages, // ctrl-Right
'alt': prevScreenImages, // alt-Right 'alt': ImageGrid.prevScreenImages, // alt-Right
}, },
80: 37, // BkSp 80: 37, // BkSp
188: 37, // p 188: 37, // p
8: 37, // < 8: 37, // <
39: { 39: {
'default': nextImage, // Left 'default': ImageGrid.nextImage, // Left
'ctrl': nextScreenImages, // ctrl-Left 'ctrl': ImageGrid.nextScreenImages, // ctrl-Left
'alt': nextScreenImages, // alt-Left 'alt': ImageGrid.nextScreenImages, // alt-Left
}, },
32: 39, // Space 32: 39, // Space
190: 39, // m 190: 39, // m
78: 39, // > 78: 39, // >
// move view... // move view...
// XXX should these be s-up, s-down, ... ?? // XXX should these be s-up, s-down, ... ??
75: moveViewUp, // k 75: ImageGrid.moveViewUp, // k
74: moveViewDown, // j 74: ImageGrid.moveViewDown, // j
72: moveViewLeft, // h 72: ImageGrid.moveViewLeft, // h
76: moveViewRight, // l 76: ImageGrid.moveViewRight, // l
79: centerCurrentImage, // o 79: ImageGrid.centerCurrentImage, // o
// combined navigation with actions.. // combined navigation with actions..
40: { 40: {
'default': focusBelowRibbon, // Down 'default': ImageGrid.focusBelowRibbon, // Down
'shift': shiftImageDown, // shift-Down 'shift': shiftImageDown, // shift-Down
// XXX make this into a real action...
'ctrl+shift': function(){ // ctrl-shift-Down 'ctrl+shift': function(){ // ctrl-shift-Down
createRibbon('next') createRibbon('next')
shiftImageDown() shiftImageDown()
} }
}, },
38: { 38: {
'default': focusAboveRibbon, // Up 'default': ImageGrid.focusAboveRibbon, // Up
'shift': shiftImageUp, // shift-Up 'shift': shiftImageUp, // shift-Up
// XXX make this into a real action...
'ctrl+shift': function(){ // ctrl-shift-Up 'ctrl+shift': function(){ // ctrl-shift-Up
createRibbon('prev') createRibbon('prev')
shiftImageUp() shiftImageUp()
@ -80,6 +97,7 @@ var keybindings = {
20: 16, // Caps Lock 20: 16, // Caps Lock
// refresh... // refresh...
// XXX make this into a real action...
116: function(){ return DEBUG?true:false } // F5 116: function(){ return DEBUG?true:false } // F5
} }