Core: Move keyCode into its own module

Ref #9647
This commit is contained in:
Alexander Schmitz 2015-07-15 18:03:01 -04:00
parent 677fdbf7be
commit bddb7efe00
13 changed files with 63 additions and 29 deletions

View File

@ -22,8 +22,9 @@
// AMD. Register as an anonymous module.
define( [
"jquery",
"./core",
"./version",
"./core",
"./keycode",
"./widget"
], factory );
} else {

View File

@ -23,6 +23,7 @@
define( [
"jquery",
"./core",
"./keycode",
"./widget",
"./position",
"./version",

View File

@ -24,6 +24,7 @@
"jquery",
"./core",
"./data",
"./keycode",
"./version",
"./widget"
], factory );

View File

@ -26,6 +26,7 @@
"./focusable",
"./form",
"./ie",
"./keycode",
"./version"
], factory );
} else {
@ -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;

View File

@ -22,8 +22,8 @@
// AMD. Register as an anonymous module.
define([
"jquery",
"./core",
"./version"
"./version",
"./keycode"
], factory );
} else {

View File

@ -23,6 +23,7 @@
define( [
"jquery",
"./core",
"./keycode",
"./widget",
"./button",
"./draggable",

45
ui/keycode.js Normal file
View File

@ -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
};
} ) );

View File

@ -24,6 +24,7 @@
"jquery",
"./core",
"./version",
"./keycode",
"./widget",
"./position"
], factory );

View File

@ -25,10 +25,10 @@
"./core",
"./version",
"./escape-selector",
"./widget",
"./menu",
"./position",
"./menu"
], factory );
"./version",
"./widget" ], factory );
} else {
// Browser globals

View File

@ -22,7 +22,7 @@
// AMD. Register as an anonymous module.
define([
"jquery",
"./core",
"./keycode",
"./mouse",
"./version",
"./widget"

View File

@ -24,6 +24,7 @@
"jquery",
"./core",
"./version",
"./keycode",
"./widget",
"./button"
], factory );

View File

@ -24,6 +24,7 @@
"jquery",
"./core",
"./escape-selector",
"./keycode",
"./version",
"./widget"
], factory );

View File

@ -23,10 +23,10 @@
define( [
"jquery",
"./core",
"./keycode",
"./position",
"./version",
"./widget",
"./position"
], factory );
"./widget" ], factory );
} else {
// Browser globals