Skip to content

Commit

Permalink
Core: Move keyCode into its own module
Browse files Browse the repository at this point in the history
Ref #9647
  • Loading branch information
arschmitz committed Aug 8, 2015
1 parent 677fdbf commit bddb7ef
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 29 deletions.
3 changes: 2 additions & 1 deletion ui/accordion.js
Expand Up @@ -22,8 +22,9 @@
// AMD. Register as an anonymous module.
define( [
"jquery",
"./core",
"./version",
"./core",
"./keycode",
"./widget"
], factory );
} else {
Expand Down
1 change: 1 addition & 0 deletions ui/autocomplete.js
Expand Up @@ -23,6 +23,7 @@
define( [
"jquery",
"./core",
"./keycode",
"./widget",
"./position",
"./version",
Expand Down
1 change: 1 addition & 0 deletions ui/button.js
Expand Up @@ -24,6 +24,7 @@
"jquery",
"./core",
"./data",
"./keycode",
"./version",
"./widget"
], factory );
Expand Down
20 changes: 1 addition & 19 deletions ui/core.js
Expand Up @@ -26,6 +26,7 @@
"./focusable",
"./form",
"./ie",
"./keycode",
"./version"
], factory );
} else {
Expand All @@ -37,25 +38,6 @@

$.extend( $.ui, {

keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
},

// Internal use only
safeActiveElement: function( document ) {
var activeElement;
Expand Down
4 changes: 2 additions & 2 deletions ui/datepicker.js
Expand Up @@ -22,8 +22,8 @@
// AMD. Register as an anonymous module.
define([
"jquery",
"./core",
"./version"
"./version",
"./keycode"
], factory );
} else {

Expand Down
1 change: 1 addition & 0 deletions ui/dialog.js
Expand Up @@ -23,6 +23,7 @@
define( [
"jquery",
"./core",
"./keycode",
"./widget",
"./button",
"./draggable",
Expand Down
45 changes: 45 additions & 0 deletions ui/keycode.js
@@ -0,0 +1,45 @@
/*!
* jQuery UI Keycode @VERSION
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/

//>>label: Keycode
//>>group: Core
//>>description: Provide keycodes as keynames
//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/

( function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery", "./version" ], factory );
} else {

// Browser globals
factory( jQuery );
}
} ( function( $ ) {
return $.ui.keyCode = {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
};

} ) );
1 change: 1 addition & 0 deletions ui/menu.js
Expand Up @@ -24,6 +24,7 @@
"jquery",
"./core",
"./version",
"./keycode",
"./widget",
"./position"
], factory );
Expand Down
6 changes: 3 additions & 3 deletions ui/selectmenu.js
Expand Up @@ -25,10 +25,10 @@
"./core",
"./version",
"./escape-selector",
"./widget",
"./menu",
"./position",
"./menu"
], factory );
"./version",
"./widget" ], factory );
} else {

// Browser globals
Expand Down
2 changes: 1 addition & 1 deletion ui/slider.js
Expand Up @@ -22,7 +22,7 @@
// AMD. Register as an anonymous module.
define([
"jquery",
"./core",
"./keycode",
"./mouse",
"./version",
"./widget"
Expand Down
1 change: 1 addition & 0 deletions ui/spinner.js
Expand Up @@ -24,6 +24,7 @@
"jquery",
"./core",
"./version",
"./keycode",
"./widget",
"./button"
], factory );
Expand Down
1 change: 1 addition & 0 deletions ui/tabs.js
Expand Up @@ -24,6 +24,7 @@
"jquery",
"./core",
"./escape-selector",
"./keycode",
"./version",
"./widget"
], factory );
Expand Down
6 changes: 3 additions & 3 deletions ui/tooltip.js
Expand Up @@ -23,10 +23,10 @@
define( [
"jquery",
"./core",
"./keycode",
"./position",
"./version",
"./widget",
"./position"
], factory );
"./widget" ], factory );
} else {

// Browser globals
Expand Down

0 comments on commit bddb7ef

Please sign in to comment.