Skip to content

Commit bddb7ef

Browse files
committed
Core: Move keyCode into its own module
Ref #9647
1 parent 677fdbf commit bddb7ef

File tree

13 files changed

+63
-29
lines changed

13 files changed

+63
-29
lines changed

ui/accordion.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
// AMD. Register as an anonymous module.
2323
define( [
2424
"jquery",
25-
"./core",
2625
"./version",
26+
"./core",
27+
"./keycode",
2728
"./widget"
2829
], factory );
2930
} else {

ui/autocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
define( [
2424
"jquery",
2525
"./core",
26+
"./keycode",
2627
"./widget",
2728
"./position",
2829
"./version",

ui/button.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"jquery",
2525
"./core",
2626
"./data",
27+
"./keycode",
2728
"./version",
2829
"./widget"
2930
], factory );

ui/core.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"./focusable",
2727
"./form",
2828
"./ie",
29+
"./keycode",
2930
"./version"
3031
], factory );
3132
} else {
@@ -37,25 +38,6 @@
3738

3839
$.extend( $.ui, {
3940

40-
keyCode: {
41-
BACKSPACE: 8,
42-
COMMA: 188,
43-
DELETE: 46,
44-
DOWN: 40,
45-
END: 35,
46-
ENTER: 13,
47-
ESCAPE: 27,
48-
HOME: 36,
49-
LEFT: 37,
50-
PAGE_DOWN: 34,
51-
PAGE_UP: 33,
52-
PERIOD: 190,
53-
RIGHT: 39,
54-
SPACE: 32,
55-
TAB: 9,
56-
UP: 38
57-
},
58-
5941
// Internal use only
6042
safeActiveElement: function( document ) {
6143
var activeElement;

ui/datepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
// AMD. Register as an anonymous module.
2323
define([
2424
"jquery",
25-
"./core",
26-
"./version"
25+
"./version",
26+
"./keycode"
2727
], factory );
2828
} else {
2929

ui/dialog.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
define( [
2424
"jquery",
2525
"./core",
26+
"./keycode",
2627
"./widget",
2728
"./button",
2829
"./draggable",

ui/keycode.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*!
2+
* jQuery UI Keycode @VERSION
3+
* http://jqueryui.com
4+
*
5+
* Copyright jQuery Foundation and other contributors
6+
* Released under the MIT license.
7+
* http://jquery.org/license
8+
*/
9+
10+
//>>label: Keycode
11+
//>>group: Core
12+
//>>description: Provide keycodes as keynames
13+
//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
14+
15+
( function( factory ) {
16+
if ( typeof define === "function" && define.amd ) {
17+
18+
// AMD. Register as an anonymous module.
19+
define( [ "jquery", "./version" ], factory );
20+
} else {
21+
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
} ( function( $ ) {
26+
return $.ui.keyCode = {
27+
BACKSPACE: 8,
28+
COMMA: 188,
29+
DELETE: 46,
30+
DOWN: 40,
31+
END: 35,
32+
ENTER: 13,
33+
ESCAPE: 27,
34+
HOME: 36,
35+
LEFT: 37,
36+
PAGE_DOWN: 34,
37+
PAGE_UP: 33,
38+
PERIOD: 190,
39+
RIGHT: 39,
40+
SPACE: 32,
41+
TAB: 9,
42+
UP: 38
43+
};
44+
45+
} ) );

ui/menu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"jquery",
2525
"./core",
2626
"./version",
27+
"./keycode",
2728
"./widget",
2829
"./position"
2930
], factory );

ui/selectmenu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"./core",
2626
"./version",
2727
"./escape-selector",
28-
"./widget",
28+
"./menu",
2929
"./position",
30-
"./menu"
31-
], factory );
30+
"./version",
31+
"./widget" ], factory );
3232
} else {
3333

3434
// Browser globals

ui/slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// AMD. Register as an anonymous module.
2323
define([
2424
"jquery",
25-
"./core",
25+
"./keycode",
2626
"./mouse",
2727
"./version",
2828
"./widget"

ui/spinner.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"jquery",
2525
"./core",
2626
"./version",
27+
"./keycode",
2728
"./widget",
2829
"./button"
2930
], factory );

ui/tabs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"jquery",
2525
"./core",
2626
"./escape-selector",
27+
"./keycode",
2728
"./version",
2829
"./widget"
2930
], factory );

ui/tooltip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
define( [
2424
"jquery",
2525
"./core",
26+
"./keycode",
27+
"./position",
2628
"./version",
27-
"./widget",
28-
"./position"
29-
], factory );
29+
"./widget" ], factory );
3030
} else {
3131

3232
// Browser globals

0 commit comments

Comments
 (0)