mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 12:20:08 +00:00
minor tweaks + added keyboard help (need to rethink)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b9dcfb4f84
commit
42298eee7b
@ -15,6 +15,11 @@ var keyboard = require('lib/keyboard')
|
|||||||
|
|
||||||
var core = require('features/core')
|
var core = require('features/core')
|
||||||
|
|
||||||
|
var widget = require('lib/widget/widget')
|
||||||
|
var browse = require('lib/widget/browse')
|
||||||
|
var overlay = require('lib/widget/overlay')
|
||||||
|
var drawer = require('lib/widget/drawer')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
@ -81,6 +86,10 @@ module.GLOBAL_KEYBOARD = {
|
|||||||
'on this page.',
|
'on this page.',
|
||||||
pattern: '*',
|
pattern: '*',
|
||||||
|
|
||||||
|
X: {
|
||||||
|
alt: 'close',
|
||||||
|
},
|
||||||
|
|
||||||
F4: {
|
F4: {
|
||||||
alt: 'close',
|
alt: 'close',
|
||||||
},
|
},
|
||||||
@ -348,6 +357,24 @@ var KeyboardActions = actions.Actions({
|
|||||||
},
|
},
|
||||||
['on', 'off'])],
|
['on', 'off'])],
|
||||||
|
|
||||||
|
// XXX need to pre-process the docs...
|
||||||
|
// - remove the path component...
|
||||||
|
// - insert the action name where not doc present...
|
||||||
|
// XXX cleanup CSS
|
||||||
|
showKeyboardBindings: ['Interface/Show keyboard bindings',
|
||||||
|
function(){
|
||||||
|
var widget = drawer.Drawer($('body'),
|
||||||
|
$('<div>')
|
||||||
|
.css({
|
||||||
|
background: 'white',
|
||||||
|
})
|
||||||
|
.append(
|
||||||
|
keyboard.buildKeybindingsHelpHTML(this.__keyboard_config, this)),
|
||||||
|
{
|
||||||
|
focusable: true,
|
||||||
|
})
|
||||||
|
}],
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
var Keyboard =
|
var Keyboard =
|
||||||
|
|||||||
@ -792,6 +792,13 @@ function buildKeybindingsHelp(keybindings, shifted_keys, actions){
|
|||||||
|
|
||||||
var handler = getKeyHandlers(key, mod, keybindings, 'all', null, actions)[pattern]
|
var handler = getKeyHandlers(key, mod, keybindings, 'all', null, actions)[pattern]
|
||||||
|
|
||||||
|
// no handler...
|
||||||
|
// NOTE: handler is present in config but not present
|
||||||
|
// in actions...
|
||||||
|
if(handler == null){
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if(handler.constructor === Array && handler[1] == 'IGNORE NEXT'){
|
if(handler.constructor === Array && handler[1] == 'IGNORE NEXT'){
|
||||||
handler = handler[0]
|
handler = handler[0]
|
||||||
}
|
}
|
||||||
@ -902,8 +909,8 @@ function getKeysByDoc(doc, help){
|
|||||||
//
|
//
|
||||||
var buildKeybindingsHelpHTML =
|
var buildKeybindingsHelpHTML =
|
||||||
module.buildKeybindingsHelpHTML =
|
module.buildKeybindingsHelpHTML =
|
||||||
function buildKeybindingsHelpHTML(keybindings){
|
function buildKeybindingsHelpHTML(keybindings, actions){
|
||||||
var doc = buildKeybindingsHelp(keybindings)
|
var doc = buildKeybindingsHelp(keybindings, null, actions)
|
||||||
|
|
||||||
var res = '<table class="keyboard-help">'
|
var res = '<table class="keyboard-help">'
|
||||||
for(var mode in doc){
|
for(var mode in doc){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user