Revision 112eb7bb
Von Sven Schöling vor fast 8 Jahren hinzugefügt
js/kivi.ActionBar.js | ||
---|---|---|
40 | 40 |
if (target === undefined) { |
41 | 41 |
target = 'document'; |
42 | 42 |
} |
43 |
|
|
44 |
var normalized = $.map(keystring.split('+'), function(val, i) { |
|
45 |
switch (val) { |
|
46 |
case 'ctrl': |
|
47 |
case 'alt': return val; |
|
48 |
case 'enter': return 13; |
|
49 |
default: |
|
50 |
if (val.length == 1) { |
|
51 |
return val.charChodeAt(0) |
|
52 |
} else if (typeof val === 'number') { |
|
53 |
return val |
|
54 |
} else if (val % 1 === 0) { |
|
55 |
return val % 1; |
|
56 |
} else { |
|
57 |
console.log('can not normalize access key token: ' + val); |
|
58 |
} |
|
59 |
} |
|
60 |
}).join('+'); |
|
61 |
|
|
62 |
console.log(normalized) |
|
63 |
|
|
43 | 64 |
if (!(target in this.actions)) |
44 | 65 |
this.actions[target] = {}; |
45 |
this.actions[target][keystring] = action;
|
|
66 |
this.actions[target][normalized] = action;
|
|
46 | 67 |
}, |
47 | 68 |
|
48 | 69 |
bind_targets: function(){ |
Auch abrufbar als: Unified diff
accesskey normalization