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