minor fix + some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-06-06 14:58:08 +03:00
parent 5c804ff64d
commit 329a8b4fd5
2 changed files with 7 additions and 13 deletions

View File

@ -17,7 +17,7 @@ if(typeof(process) != 'undefined'){
// XXX EXPERIMENTAL: graph... // XXX EXPERIMENTAL: graph...
// do this only if browser is loaded... // do this only if browser is loaded...
var graph = window != null ? var graph = typeof(window) != 'undefined' ?
requirejs('lib/components/ig-image-graph') requirejs('lib/components/ig-image-graph')
: null : null
} }

View File

@ -94,16 +94,14 @@ module.SHIFT_KEYS = {
var UNSHIFT_KEYS = var UNSHIFT_KEYS =
module.UNSHIFT_KEYS = {} module.UNSHIFT_KEYS = {}
for(var k in SHIFT_KEYS){ for(var k in SHIFT_KEYS){
UNSHIFT_KEYS[SHIFT_KEYS[k]] = k UNSHIFT_KEYS[SHIFT_KEYS[k]] = k }
}
// build a reverse map of SPECIAL_KEYS // build a reverse map of SPECIAL_KEYS
var KEY_CODES = var KEY_CODES =
module.KEY_CODES = {} module.KEY_CODES = {}
for(var k in SPECIAL_KEYS){ for(var k in SPECIAL_KEYS){
KEY_CODES[SPECIAL_KEYS[k]] = k KEY_CODES[SPECIAL_KEYS[k]] = k }
}
// This is used to identify and correct key notation... // This is used to identify and correct key notation...
@ -130,8 +128,7 @@ var SPECIAL_KEY_ALTERNATIVE_TITLES = {
} }
var SPECIAL_KEYS_DICT = {} var SPECIAL_KEYS_DICT = {}
for(var k in SPECIAL_KEYS){ for(var k in SPECIAL_KEYS){
SPECIAL_KEYS_DICT[SPECIAL_KEYS[k].toLowerCase()] = SPECIAL_KEYS[k] SPECIAL_KEYS_DICT[SPECIAL_KEYS[k].toLowerCase()] = SPECIAL_KEYS[k] }
}
@ -143,8 +140,7 @@ module.doc =
function doc(text, func){ function doc(text, func){
func = !func ? function(){return true}: func func = !func ? function(){return true}: func
func.doc = text func.doc = text
return func return func }
}
// Parse action call format... // Parse action call format...
@ -365,8 +361,7 @@ function normalizeKey(key){
return output == 'array' ? return output == 'array' ?
key key
: joinKey(key) : joinKey(key) }
}
// Get shifted key if available... // Get shifted key if available...
@ -395,8 +390,7 @@ function shifted(key){
return s == null ? null return s == null ? null
: output == 'string' ? : output == 'string' ?
joinKey(res) joinKey(res)
: res : res }
}