From: Alexander Schmitz Date: Wed, 15 Jul 2015 22:03:01 +0000 (-0400) Subject: Core: Move keyCode into its own module X-Git-Tag: 1.12.0-beta.1~223 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bddb7efe000cf60e455d48f28acef0ef2f295d9d;p=jquery-ui.git Core: Move keyCode into its own module Ref #9647 --- diff --git a/ui/accordion.js b/ui/accordion.js index 5a2c128c6..6cc0533c0 100644 --- a/ui/accordion.js +++ b/ui/accordion.js @@ -22,8 +22,9 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "./core", "./version", + "./core", + "./keycode", "./widget" ], factory ); } else { diff --git a/ui/autocomplete.js b/ui/autocomplete.js index 1bf8c84be..b535b3966 100644 --- a/ui/autocomplete.js +++ b/ui/autocomplete.js @@ -23,6 +23,7 @@ define( [ "jquery", "./core", + "./keycode", "./widget", "./position", "./version", diff --git a/ui/button.js b/ui/button.js index 8c9894044..ec6525d2b 100644 --- a/ui/button.js +++ b/ui/button.js @@ -24,6 +24,7 @@ "jquery", "./core", "./data", + "./keycode", "./version", "./widget" ], factory ); diff --git a/ui/core.js b/ui/core.js index 006011f3c..6c948d058 100644 --- a/ui/core.js +++ b/ui/core.js @@ -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; diff --git a/ui/datepicker.js b/ui/datepicker.js index 372d87c60..406a0124c 100644 --- a/ui/datepicker.js +++ b/ui/datepicker.js @@ -22,8 +22,8 @@ // AMD. Register as an anonymous module. define([ "jquery", - "./core", - "./version" + "./version", + "./keycode" ], factory ); } else { diff --git a/ui/dialog.js b/ui/dialog.js index 4dbf2ab34..f17aaccd1 100644 --- a/ui/dialog.js +++ b/ui/dialog.js @@ -23,6 +23,7 @@ define( [ "jquery", "./core", + "./keycode", "./widget", "./button", "./draggable", diff --git a/ui/keycode.js b/ui/keycode.js new file mode 100644 index 000000000..17687fbbd --- /dev/null +++ b/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 +}; + +} ) ); diff --git a/ui/menu.js b/ui/menu.js index e39fb0bdb..be59e7322 100644 --- a/ui/menu.js +++ b/ui/menu.js @@ -24,6 +24,7 @@ "jquery", "./core", "./version", + "./keycode", "./widget", "./position" ], factory ); diff --git a/ui/selectmenu.js b/ui/selectmenu.js index fe1a7fa99..dc8df9f1b 100644 --- a/ui/selectmenu.js +++ b/ui/selectmenu.js @@ -25,10 +25,10 @@ "./core", "./version", "./escape-selector", - "./widget", + "./menu", "./position", - "./menu" - ], factory ); + "./version", + "./widget" ], factory ); } else { // Browser globals diff --git a/ui/slider.js b/ui/slider.js index db5f341b3..ff883a1eb 100644 --- a/ui/slider.js +++ b/ui/slider.js @@ -22,7 +22,7 @@ // AMD. Register as an anonymous module. define([ "jquery", - "./core", + "./keycode", "./mouse", "./version", "./widget" diff --git a/ui/spinner.js b/ui/spinner.js index fa07c9ab1..665bf58d0 100644 --- a/ui/spinner.js +++ b/ui/spinner.js @@ -24,6 +24,7 @@ "jquery", "./core", "./version", + "./keycode", "./widget", "./button" ], factory ); diff --git a/ui/tabs.js b/ui/tabs.js index 4cd80a1df..526dc6e82 100644 --- a/ui/tabs.js +++ b/ui/tabs.js @@ -24,6 +24,7 @@ "jquery", "./core", "./escape-selector", + "./keycode", "./version", "./widget" ], factory ); diff --git a/ui/tooltip.js b/ui/tooltip.js index c58bc65dc..3d3322fb1 100644 --- a/ui/tooltip.js +++ b/ui/tooltip.js @@ -23,10 +23,10 @@ define( [ "jquery", "./core", + "./keycode", + "./position", "./version", - "./widget", - "./position" - ], factory ); + "./widget" ], factory ); } else { // Browser globals