efront 3.11.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coms/zimoli/bindAccesskey.js +47 -0
- package/coms/zimoli/button.js +0 -33
- package/coms/zimoli/menu.js +2 -0
- package/coms/zimoli/menu.less +1 -1
- package/coms/zimoli/menuList.html +2 -2
- package/coms/zimoli/menuList.js +205 -50
- package/coms/zimoli/menuList.less +6 -1
- package/coms/zimoli/on.js +14 -3
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var keyMap = {};
|
|
2
|
+
on("keydown")(window, function (event) {
|
|
3
|
+
var { which } = event;
|
|
4
|
+
switch (event.which) {
|
|
5
|
+
case 18:
|
|
6
|
+
event.preventDefault();
|
|
7
|
+
break;
|
|
8
|
+
default:
|
|
9
|
+
var key = String.fromCharCode(which);
|
|
10
|
+
var elems = keyMap[key];
|
|
11
|
+
if (elems) while (elems.length) {
|
|
12
|
+
var elem = elems[elems.length - 1];
|
|
13
|
+
if (isMounted(elem)) break;
|
|
14
|
+
else elems.pop();
|
|
15
|
+
}
|
|
16
|
+
if (elem) {
|
|
17
|
+
var parent = elem.parentNode;
|
|
18
|
+
if (event.altKey || parent === document.activeElement || parent.ispop) {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
elem.click();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var bindAccesskey = function (btn, k) {
|
|
26
|
+
if (!keyMap[k]) keyMap[k] = [];
|
|
27
|
+
removeFromList(keyMap[k], btn);
|
|
28
|
+
keyMap[k].push(btn);
|
|
29
|
+
once("remove")(btn, function () {
|
|
30
|
+
removeFromList(keyMap[k], btn);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var getKeyFromText = function (btn) {
|
|
34
|
+
var { innerText } = btn;
|
|
35
|
+
var match = /\(\s*\_?\w\s*\)|\[\s*\_?\w\s*\]|\{\s*\_?\w\s*\}/.exec(innerText);
|
|
36
|
+
if (match) {
|
|
37
|
+
var accesskey = match[0].replace(/^\W*(\w)\W*$/g, '$1');
|
|
38
|
+
} else {
|
|
39
|
+
var accesskey = btn.getAttribute("accesskey");
|
|
40
|
+
}
|
|
41
|
+
if (!accesskey) return;
|
|
42
|
+
return accesskey.toUpperCase();
|
|
43
|
+
}
|
|
44
|
+
function main(elem, key = getKeyFromText(elem)) {
|
|
45
|
+
bindAccesskey(elem, key);
|
|
46
|
+
return elem;
|
|
47
|
+
}
|
package/coms/zimoli/button.js
CHANGED
|
@@ -2,28 +2,6 @@ var _label = createElement("span");
|
|
|
2
2
|
var track = createElement(div);
|
|
3
3
|
track.className = "track";
|
|
4
4
|
_label.className = "label";
|
|
5
|
-
var keyMap = {};
|
|
6
|
-
on("keydown")(window, function (event) {
|
|
7
|
-
var { which } = event;
|
|
8
|
-
switch (event.which) {
|
|
9
|
-
case 18:
|
|
10
|
-
event.preventDefault();
|
|
11
|
-
break;
|
|
12
|
-
default:
|
|
13
|
-
if (event.altKey) {
|
|
14
|
-
var key = String.fromCharCode(which);
|
|
15
|
-
var element = keyMap[key];
|
|
16
|
-
if (element) {
|
|
17
|
-
if (isMounted(element)) {
|
|
18
|
-
event.preventDefault();
|
|
19
|
-
element.click();
|
|
20
|
-
} else {
|
|
21
|
-
delete keyMap[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
5
|
|
|
28
6
|
var btn = document.createElement("button");
|
|
29
7
|
btn.tabIndex = 0;
|
|
@@ -75,17 +53,6 @@ var touchstart = function () {
|
|
|
75
53
|
var canceltouchend = ontouchend(this, cancel);
|
|
76
54
|
active.call(this);
|
|
77
55
|
};
|
|
78
|
-
var bindAccesskey = function (btn) {
|
|
79
|
-
var { innerText } = btn;
|
|
80
|
-
var match = /\(\s*\_?\w\s*\)|\[\s*\_?\w\s*\]|\{\s*\_?\w\s*\}/.exec(innerText);
|
|
81
|
-
if (match) {
|
|
82
|
-
var accesskey = match[0].replace(/^\W*(\w)\W*$/g, '$1');
|
|
83
|
-
} else {
|
|
84
|
-
var accesskey = btn.getAttribute("accesskey");
|
|
85
|
-
}
|
|
86
|
-
if (!accesskey) return;
|
|
87
|
-
keyMap[accesskey.toUpperCase()] = btn;
|
|
88
|
-
};
|
|
89
56
|
function button(texter, type) {
|
|
90
57
|
var tracker = createElement(track);
|
|
91
58
|
var _texter;
|
package/coms/zimoli/menu.js
CHANGED
|
@@ -159,11 +159,13 @@ function main(elem, mode) {
|
|
|
159
159
|
getGenerator(elem);
|
|
160
160
|
care(elem, function (src) {
|
|
161
161
|
menuList(elem, getTreeFromData(src), emit, direction);
|
|
162
|
+
elem.registerAsRoot();
|
|
162
163
|
});
|
|
163
164
|
}
|
|
164
165
|
else {
|
|
165
166
|
var nodes = getArrayNodes(elem);
|
|
166
167
|
elem = menuList(elem, nodes, emit, direction);
|
|
168
|
+
elem.registerAsRoot();
|
|
167
169
|
}
|
|
168
170
|
break;
|
|
169
171
|
default:
|
package/coms/zimoli/menu.less
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open(
|
|
2
|
-
ng-mouseleave="
|
|
1
|
+
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open.call(this)"
|
|
2
|
+
ng-mouseleave="cancel()" ng-mouseenter="popMenu.call(this)"
|
|
3
3
|
ng-class="{'has-children':menu.children&&menu.children.length,'warn':menu.type==='danger'||menu.type==='warn'||menu.type==='red'}">
|
|
4
4
|
</menu-item>
|
package/coms/zimoli/menuList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var mounted_menus = [], releaseTimer = 0;
|
|
1
|
+
var mounted_menus = [], releaseTimer = 0, root_menu;
|
|
2
2
|
var release = function () {
|
|
3
3
|
clear();
|
|
4
4
|
releaseTimer = setTimeout(function () {
|
|
@@ -12,6 +12,137 @@ var unfocus = function () {
|
|
|
12
12
|
remove(mounted_menus);
|
|
13
13
|
this.ispop = false;
|
|
14
14
|
};
|
|
15
|
+
var setFocus = function (focused = this.firstMenu) {
|
|
16
|
+
var page = this;
|
|
17
|
+
if (page.ispop || page === document.activeElement) {
|
|
18
|
+
if (page.focused !== focused) {
|
|
19
|
+
if (page.focused) removeClass(page.focused, 'focus');
|
|
20
|
+
if (focused) addClass(focused, "focus");
|
|
21
|
+
page.focused = focused;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
if (page.focused) {
|
|
26
|
+
removeClass(page.focused, 'focus');
|
|
27
|
+
page.focused = null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var moveFocus = function (delta) {
|
|
32
|
+
var page = this;
|
|
33
|
+
var focused = page.focused;
|
|
34
|
+
var newIndex = 0;
|
|
35
|
+
if (!focused) {
|
|
36
|
+
if (delta > 0) newIndex = 0;
|
|
37
|
+
else newIndex = page.total - 1;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
var newIndex = focused.index + delta;
|
|
41
|
+
var total = page.total;
|
|
42
|
+
if (page !== root_menu) {
|
|
43
|
+
total++;
|
|
44
|
+
}
|
|
45
|
+
if (newIndex < 0) newIndex = total + newIndex;
|
|
46
|
+
if (newIndex > total - 1) newIndex = newIndex - total;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var e = page.getIndexedElement(newIndex);
|
|
50
|
+
if (!e) page.setFocus(null);
|
|
51
|
+
else page.open(e);
|
|
52
|
+
};
|
|
53
|
+
var openFocus = function () {
|
|
54
|
+
var menu = mounted_menus[mounted_menus.length - 1] || root_menu;
|
|
55
|
+
if (!menu.ispop) menu.ispop = 1;
|
|
56
|
+
menu.open(menu.focused);
|
|
57
|
+
};
|
|
58
|
+
var closeFocus = function () {
|
|
59
|
+
var menu = mounted_menus[mounted_menus.length - 1];
|
|
60
|
+
remove(menu);
|
|
61
|
+
};
|
|
62
|
+
var keyAction = function (deltax, deltay) {
|
|
63
|
+
if (root_menu !== document.activeElement) return;
|
|
64
|
+
var menu = mounted_menus[mounted_menus.length - 1];
|
|
65
|
+
if (menu) var parent = mounted_menus[mounted_menus.length - 2] || root_menu;
|
|
66
|
+
else menu = root_menu;
|
|
67
|
+
|
|
68
|
+
if (menu.direction === 'y') {
|
|
69
|
+
if (deltax === 1) {
|
|
70
|
+
if (menu.focused) openFocus();
|
|
71
|
+
else if (parent && parent.direction !== 'y') {
|
|
72
|
+
parent.moveFocus(deltax);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (deltax === -1) {
|
|
76
|
+
if (parent) {
|
|
77
|
+
if (parent.direction === 'y') remove(mounted_menus.pop());
|
|
78
|
+
else if (!menu.focused) parent.moveFocus(deltax);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
menu.moveFocus(deltay);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
if (deltay === 1) {
|
|
87
|
+
if (menu.focused) openFocus();
|
|
88
|
+
else if (parent && parent.direction === 'y') {
|
|
89
|
+
parent.moveFocus(deltay);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (deltay === -1) {
|
|
93
|
+
if (parent) {
|
|
94
|
+
if (parent.direction !== 'y') remove(mounted_menus.pop());
|
|
95
|
+
else if (!menu.focused) parent.moveFocus(deltay);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
menu.moveFocus(deltax);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
function keyalt() {
|
|
104
|
+
if (root_menu === document.activeElement) root_menu.blur();
|
|
105
|
+
else {
|
|
106
|
+
root_menu.tabIndex = 0;
|
|
107
|
+
root_menu.focus();
|
|
108
|
+
}
|
|
109
|
+
root_menu.setFocus();
|
|
110
|
+
}
|
|
111
|
+
function keyesc() {
|
|
112
|
+
if (root_menu === document.activeElement && !mounted_menus.length) {
|
|
113
|
+
if (!root_menu.ispop) root_menu.blur(), root_menu.setFocus();
|
|
114
|
+
else root_menu.ispop = false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function keyup() {
|
|
118
|
+
keyAction(0, -1);
|
|
119
|
+
}
|
|
120
|
+
function keydown() {
|
|
121
|
+
keyAction(0, 1);
|
|
122
|
+
}
|
|
123
|
+
function keyleft() {
|
|
124
|
+
keyAction(-1, 0)
|
|
125
|
+
}
|
|
126
|
+
function keyright() {
|
|
127
|
+
keyAction(1, 0);
|
|
128
|
+
}
|
|
129
|
+
function keyspace() {
|
|
130
|
+
if (root_menu !== document.activeElement) return;
|
|
131
|
+
var menu = mounted_menus[mounted_menus.length - 1] || root_menu;
|
|
132
|
+
menu.focused.click();
|
|
133
|
+
}
|
|
134
|
+
function register() {
|
|
135
|
+
// on('keydown.alt')(window, e => e.preventDefault());
|
|
136
|
+
on('keydown.alt.')(window, keyalt);
|
|
137
|
+
on('keydown.esc')(window, keyesc);
|
|
138
|
+
on('keydown.left')(window, keyleft);
|
|
139
|
+
on('keydown.right')(window, keyright);
|
|
140
|
+
on('keydown.up')(window, keyup);
|
|
141
|
+
on('keydown.down')(window, keydown);
|
|
142
|
+
on('keydown.enter')(window, keyspace);
|
|
143
|
+
on('keydown.space')(window, keyspace);
|
|
144
|
+
root_menu = this;
|
|
145
|
+
}
|
|
15
146
|
function main(page, items, active, direction = 'y') {
|
|
16
147
|
if (!isNode(page)) {
|
|
17
148
|
var page = div();
|
|
@@ -23,6 +154,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
23
154
|
clear();
|
|
24
155
|
remove(page.active);
|
|
25
156
|
}
|
|
157
|
+
page.setFocus(target);
|
|
26
158
|
if (!item.children || !item.children.length) return;
|
|
27
159
|
var clone = template.cloneNode();
|
|
28
160
|
clone.$parentScopes = page.$parentScopes;
|
|
@@ -60,6 +192,39 @@ function main(page, items, active, direction = 'y') {
|
|
|
60
192
|
template.innerHTML = page.innerHTML;
|
|
61
193
|
page.tempalte = template;
|
|
62
194
|
}
|
|
195
|
+
var popTimer = 0;
|
|
196
|
+
var open = function () {
|
|
197
|
+
cancel();
|
|
198
|
+
var elem = this;
|
|
199
|
+
page.setFocus(elem);
|
|
200
|
+
if (page.ispop) popTimer = setTimeout(function () {
|
|
201
|
+
popMenu(elem.menu, elem);
|
|
202
|
+
}, 60);
|
|
203
|
+
};
|
|
204
|
+
var cancel = function () {
|
|
205
|
+
clearTimeout(popTimer);
|
|
206
|
+
}
|
|
207
|
+
var fire = function () {
|
|
208
|
+
cancel();
|
|
209
|
+
var pop = active(this.menu, this);
|
|
210
|
+
if (pop === false) return;
|
|
211
|
+
var root = page.root || page;
|
|
212
|
+
if (root.ispop === 1) root.ispop = false;
|
|
213
|
+
if (page.active && page.active.target === this) {
|
|
214
|
+
if (!mounted_menus.length) {
|
|
215
|
+
popMenu(this.menu, this);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
unfocus.call(page);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
while (mounted_menus.length && mounted_menus[mounted_menus.length - 1] !== page) remove(mounted_menus.pop());
|
|
223
|
+
popMenu(this.menu, this);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
|
|
63
228
|
if (!page.children.length || page.menutype === 1) {
|
|
64
229
|
page.menutype = 1;
|
|
65
230
|
var hasIcon = function () {
|
|
@@ -73,32 +238,19 @@ function main(page, items, active, direction = 'y') {
|
|
|
73
238
|
};
|
|
74
239
|
var $scope = {
|
|
75
240
|
"menu-item": function (e, s) {
|
|
76
|
-
|
|
77
|
-
menuItem(e, s)
|
|
241
|
+
var a = bindAccesskey(
|
|
242
|
+
menuItem(e, s, this.hasIcon)
|
|
78
243
|
);
|
|
244
|
+
if (!page.firstMenu) {
|
|
245
|
+
page.firstMenu = a;
|
|
246
|
+
}
|
|
247
|
+
return a;
|
|
79
248
|
},
|
|
80
249
|
menus: items,
|
|
81
250
|
hasIcon: hasIcon(),
|
|
82
|
-
open
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var root = page.root || page;
|
|
86
|
-
if (root.ispop === 1) root.ispop = false;
|
|
87
|
-
if (!mounted_menus.length) {
|
|
88
|
-
popMenu.apply(this, arguments);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
unfocus.call(page);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
popTimer: 0,
|
|
95
|
-
popMenu() {
|
|
96
|
-
if (!page.ispop) return;
|
|
97
|
-
var args = arguments;
|
|
98
|
-
return setTimeout(function () {
|
|
99
|
-
popMenu.apply(null, args);
|
|
100
|
-
}, 60);
|
|
101
|
-
},
|
|
251
|
+
open: fire,
|
|
252
|
+
cancel,
|
|
253
|
+
popMenu: open,
|
|
102
254
|
};
|
|
103
255
|
if (page.$src) {
|
|
104
256
|
var src = page.$src;
|
|
@@ -106,10 +258,11 @@ function main(page, items, active, direction = 'y') {
|
|
|
106
258
|
var itemName = src.itemName;
|
|
107
259
|
var className = `{'has-children':${itemName}.children&&${itemName}.children.length,'warn':${itemName}.type==='danger'||${itemName}.type==='warn'||${itemName}.type==='red'}`;
|
|
108
260
|
var notHidden = `!${itemName}.hidden`;
|
|
261
|
+
|
|
109
262
|
list(page, function (index) {
|
|
110
263
|
var item = items[index];
|
|
111
264
|
if (!item) return;
|
|
112
|
-
var a =
|
|
265
|
+
var a = $scope["menu-item"](null, item);
|
|
113
266
|
var scope = {};
|
|
114
267
|
if (item instanceof Item) item = item.value;
|
|
115
268
|
if (src.itemName) scope[src.itemName] = item;
|
|
@@ -120,17 +273,11 @@ function main(page, items, active, direction = 'y') {
|
|
|
120
273
|
else scope.$index = index;
|
|
121
274
|
if (src.srcName) scope[src.srcName] = items;
|
|
122
275
|
if (src.itemName) a.setAttribute("e-if", notHidden);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
on("
|
|
127
|
-
$scope.popTimer = $scope.popMenu(item, this);
|
|
128
|
-
});
|
|
129
|
-
on("click")(a, function () {
|
|
130
|
-
$scope.open(items[index], this);
|
|
131
|
-
});
|
|
276
|
+
a.menu = item;
|
|
277
|
+
on("mouseleave")(a, cancel);
|
|
278
|
+
on("mouseenter")(a, open);
|
|
279
|
+
on("click")(a, fire);
|
|
132
280
|
a.setAttribute("e-class", className);
|
|
133
|
-
a = button(a);
|
|
134
281
|
render(a, scope, parentScopes);
|
|
135
282
|
return a;
|
|
136
283
|
});
|
|
@@ -143,31 +290,39 @@ function main(page, items, active, direction = 'y') {
|
|
|
143
290
|
render(page, $scope);
|
|
144
291
|
vbox(page);
|
|
145
292
|
}
|
|
293
|
+
page.total = items.length;
|
|
146
294
|
page.renders.unshift(function () {
|
|
147
295
|
this.$scope.hasIcon = hasIcon();
|
|
148
296
|
});
|
|
149
|
-
}
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
150
299
|
var generator = getGenerator(page);
|
|
300
|
+
|
|
151
301
|
list(page, function (index) {
|
|
152
302
|
var elem = generator(index);
|
|
153
303
|
if (!elem) return;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (!mounted_menus.length) {
|
|
163
|
-
popMenu(this.src[index], this);
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
unfocus.call(page);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
304
|
+
if (!page.firstMenu) {
|
|
305
|
+
page.firstMenu = elem;
|
|
306
|
+
page.total = this.src.length;
|
|
307
|
+
}
|
|
308
|
+
elem.menu = this.src[index];
|
|
309
|
+
on("mouseleave")(elem, cancel);
|
|
310
|
+
on("mouseenter")(elem, open);
|
|
311
|
+
on("click")(elem, fire);
|
|
169
312
|
return elem;
|
|
170
313
|
}, direction);
|
|
171
314
|
}
|
|
315
|
+
page.open = function (a) {
|
|
316
|
+
open.call(a);
|
|
317
|
+
};
|
|
318
|
+
page.active = function (a) {
|
|
319
|
+
fire.call(a);
|
|
320
|
+
};
|
|
321
|
+
page.registerAsRoot = register;
|
|
322
|
+
page.setFocus = setFocus;
|
|
323
|
+
page.moveFocus = moveFocus;
|
|
324
|
+
page.openFocus = openFocus;
|
|
325
|
+
page.closeFocus = closeFocus;
|
|
326
|
+
page.direction = direction;
|
|
172
327
|
return page;
|
|
173
328
|
}
|
package/coms/zimoli/on.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var is_addEventListener_enabled = "addEventListener" in window;
|
|
3
3
|
var handlersMap = {};
|
|
4
4
|
var changes_key = 'changes';
|
|
5
|
-
var eventtypereg = /(?:\.once|\.prevent|\.stop|\.capture|\.self|\.passive|\.[a-z0-9]+)
|
|
5
|
+
var eventtypereg = /(?:\.once|\.prevent|\.stop|\.capture|\.self|\.passive|\.[a-z0-9]+)+\.?$/i;
|
|
6
6
|
var keyCodeMap = {
|
|
7
7
|
backspace: 8,
|
|
8
8
|
tab: 9,
|
|
@@ -118,6 +118,9 @@ var parseEventTypes = function (eventtypes) {
|
|
|
118
118
|
case "ctrl":
|
|
119
119
|
keyneed.push(t);
|
|
120
120
|
break;
|
|
121
|
+
case "":
|
|
122
|
+
if (!types.keyCode) types.keyCode = true;
|
|
123
|
+
break;
|
|
121
124
|
default:
|
|
122
125
|
if (isFinite(t)) {
|
|
123
126
|
types.keyCode = +t;
|
|
@@ -133,12 +136,20 @@ var parseEventTypes = function (eventtypes) {
|
|
|
133
136
|
return types;
|
|
134
137
|
}
|
|
135
138
|
function checkKeyNeed(eventtypes, e) {
|
|
139
|
+
var keyneed = eventtypes.keyNeed;
|
|
136
140
|
if (eventtypes.keyNeed) {
|
|
137
|
-
for (var cx = 0, dx =
|
|
138
|
-
var key =
|
|
141
|
+
for (var cx = 0, dx = keyneed.length; cx < dx; cx++) {
|
|
142
|
+
var key = keyneed[cx];
|
|
139
143
|
if (!e[key + "Key"]) return false;
|
|
140
144
|
}
|
|
141
145
|
}
|
|
146
|
+
if (eventtypes.keyCode === true) {
|
|
147
|
+
for (var cx = 0, dx = keyneed.length; cx < dx; cx++) {
|
|
148
|
+
var key = keyneed[cx];
|
|
149
|
+
if (e.keyCode === keyCodeMap[key]) return true;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
142
153
|
if (eventtypes.keyCode) {
|
|
143
154
|
return e.keyCode === eventtypes.keyCode;
|
|
144
155
|
}
|