mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
tweaking and bug fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c0a544f57e
commit
fb23c7bc27
@ -974,7 +974,7 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
|
|
||||||
// controls...
|
// controls...
|
||||||
if(options.mode_actions){
|
if(options.mode_actions){
|
||||||
var elem = make('new', {
|
var elem = make('New:', {
|
||||||
buttons: options.mode_actions,
|
buttons: options.mode_actions,
|
||||||
})
|
})
|
||||||
.attr('mode', mode)
|
.attr('mode', mode)
|
||||||
@ -1006,8 +1006,9 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
|
|
||||||
return dialog
|
return dialog
|
||||||
})],
|
})],
|
||||||
// XXX do we need a binding to add new keys to current mode from the
|
// XXX do we need a bindings to add new keys to current mode from the
|
||||||
// keyboard???
|
// keyboard???
|
||||||
|
// XXX focus updated/new items to editable field...
|
||||||
editKeyboardBindings: ['Interface/Keyboard bindings editor...',
|
editKeyboardBindings: ['Interface/Keyboard bindings editor...',
|
||||||
core.doc`Similar to .browseKeyboardBindings(..) but adds editing functionality...
|
core.doc`Similar to .browseKeyboardBindings(..) but adds editing functionality...
|
||||||
|
|
||||||
@ -1067,38 +1068,24 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
sortModes(cur.parent())
|
sortModes(cur.parent())
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
// XXX make this work on click...
|
||||||
|
// XXX focus resulting mode...
|
||||||
['⋯', function(_, cur){
|
['⋯', function(_, cur){
|
||||||
that.editKeyboardMode(cur.attr('mode'))
|
that.editKeyboardMode(cur.attr('mode'))
|
||||||
.close(function(){ dialog.update() }) }],
|
.close(function(){ dialog.update() }) }],
|
||||||
],
|
],
|
||||||
mode_actions: [
|
mode_actions: [
|
||||||
|
// XXX focus resulting key...
|
||||||
['key', function(_, cur){
|
['key', function(_, cur){
|
||||||
//elem.before( XXX )
|
|
||||||
that.editKeyBinding(cur.attr('mode'))
|
that.editKeyBinding(cur.attr('mode'))
|
||||||
.close(function(){ dialog.update() }) }],
|
.close(function(){ dialog.update() }) }],
|
||||||
// XXX place element...
|
// XXX place element...
|
||||||
|
// XXX focus resulting mode...
|
||||||
['mode', function(_, cur){
|
['mode', function(_, cur){
|
||||||
//elem.after( XXX )
|
|
||||||
// XXX need to pass order info...
|
// XXX need to pass order info...
|
||||||
that.editKeyboardMode()
|
that.editKeyboardMode()
|
||||||
.close(function(){ dialog.update() }) }],
|
.close(function(){ dialog.update() }) }],
|
||||||
],
|
],
|
||||||
|
|
||||||
/*/ XXX do we need this???
|
|
||||||
// keys...
|
|
||||||
key_buttons: [
|
|
||||||
['⋯', function(_, cur){
|
|
||||||
that.editKeyBinding(cur.attr('mode'), cur.attr('code'))
|
|
||||||
.close(function(){ dialog.update() }) }],
|
|
||||||
],
|
|
||||||
|
|
||||||
// dropped key list...
|
|
||||||
drop_buttons: [
|
|
||||||
['⋯', function(_, cur){
|
|
||||||
that.editKeyboardModeDroppedKeys(cur.attr('mode'))
|
|
||||||
.close(function(){ dialog.update() }) }],
|
|
||||||
],
|
|
||||||
//*/
|
|
||||||
})
|
})
|
||||||
// XXX should this be only a button thing (done in .browseKeyboardBindings(..))
|
// XXX should this be only a button thing (done in .browseKeyboardBindings(..))
|
||||||
// or also the main action???
|
// or also the main action???
|
||||||
@ -1187,12 +1174,20 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
|
|
||||||
make('---')
|
make('---')
|
||||||
|
|
||||||
make.EditableList(keys)
|
make.EditableList(keys, {
|
||||||
|
unique: true,
|
||||||
|
|
||||||
|
normalize: keyboard.normalizeKey,
|
||||||
|
check: keyboard.isKey,
|
||||||
|
})
|
||||||
|
|
||||||
make('---')
|
make('---')
|
||||||
|
|
||||||
make.ConfirmAction('Delete', {
|
make.ConfirmAction('Delete', {
|
||||||
callback: function(){ dialog.close() },
|
callback: function(){
|
||||||
|
keys = []
|
||||||
|
dialog.close()
|
||||||
|
},
|
||||||
timeout: that.config['ui-confirm-timeout'] || 2000,
|
timeout: that.config['ui-confirm-timeout'] || 2000,
|
||||||
buttons: [
|
buttons: [
|
||||||
['Cancel edit', function(){
|
['Cancel edit', function(){
|
||||||
@ -1285,15 +1280,16 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
that.keybindings[orig_mode].doc = doc
|
var data = that.keybindings[orig_mode] || {}
|
||||||
that.keybindings[orig_mode].pattern = pattern
|
|
||||||
|
data.doc = doc
|
||||||
|
data.pattern = pattern
|
||||||
|
|
||||||
// update mode name if it changed...
|
// update mode name if it changed...
|
||||||
if(mode != orig_mode){
|
if(mode != orig_mode){
|
||||||
var order = Object.keys(that.keybindings)
|
var order = Object.keys(that.keybindings)
|
||||||
order[order.indexOf(orig_mode)] = mode
|
order[order.indexOf(orig_mode)] = mode
|
||||||
|
|
||||||
var data = that.keybindings[orig_mode]
|
|
||||||
delete that.keybindings[orig_mode]
|
delete that.keybindings[orig_mode]
|
||||||
that.keybindings[mode] = data
|
that.keybindings[mode] = data
|
||||||
|
|
||||||
@ -1303,9 +1299,6 @@ var KeyboardUIActions = actions.Actions({
|
|||||||
|
|
||||||
return dialog
|
return dialog
|
||||||
})],
|
})],
|
||||||
// XXX revise:
|
|
||||||
// - '*' toggle
|
|
||||||
// - done/cancel
|
|
||||||
editKeyboardModeDroppedKeys: ['- Interface/Dropped keys...',
|
editKeyboardModeDroppedKeys: ['- Interface/Dropped keys...',
|
||||||
widgets.makeUIDialog(function(mode){
|
widgets.makeUIDialog(function(mode){
|
||||||
var that = this
|
var that = this
|
||||||
|
|||||||
@ -382,7 +382,7 @@ function(data, options){
|
|||||||
// .EditableList(<func>, <options>)
|
// .EditableList(<func>, <options>)
|
||||||
// -> <items>
|
// -> <items>
|
||||||
//
|
//
|
||||||
// This will edit the passed list in-place.
|
// This will edit the input list in-place but only when closing the dialog.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// options format:
|
// options format:
|
||||||
@ -552,7 +552,7 @@ function(list, options){
|
|||||||
// update list...
|
// update list...
|
||||||
l.splice(j, 0, l.splice(i, 1)[0])
|
l.splice(j, 0, l.splice(i, 1)[0])
|
||||||
|
|
||||||
// XXX ???
|
// return the shift distance...
|
||||||
return j - i
|
return j - i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user