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. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./core",
"./version", "./version",
"./core",
"./keycode",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

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

View File

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

View File

@ -26,6 +26,7 @@
"./focusable", "./focusable",
"./form", "./form",
"./ie", "./ie",
"./keycode",
"./version" "./version"
], factory ); ], factory );
} else { } else {
@ -37,25 +38,6 @@
$.extend( $.ui, { $.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 // Internal use only
safeActiveElement: function( document ) { safeActiveElement: function( document ) {
var activeElement; var activeElement;

View File

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

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./keycode",
"./widget", "./widget",
"./button", "./button",
"./draggable", "./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", "jquery",
"./core", "./core",
"./version", "./version",
"./keycode",
"./widget", "./widget",
"./position" "./position"
], factory ); ], factory );

View File

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

View File

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

View File

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

View File

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

View File

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