diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-07-15 20:30:36 -0400 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-08-08 00:29:37 -0400 |
commit | 37602d7e645964e4f5e4d06ef313081c8eb60bf1 (patch) | |
tree | ae6d72b9202b5d1426a13e26c5b9b53b82c48ee5 | |
parent | 72bfafbedea4973b803abeefc97637f246b11c89 (diff) | |
download | jquery-ui-37602d7e645964e4f5e4d06ef313081c8eb60bf1.tar.gz jquery-ui-37602d7e645964e4f5e4d06ef313081c8eb60bf1.zip |
Core: Movie uniqueId into its own module and deprecate core module
uniqueId was the last thing in the core module, and it is now just a helper
which require all the modules it used to contain.
Closes #9647
-rw-r--r-- | tests/unit/core/core.js | 4 | ||||
-rw-r--r-- | ui/accordion.js | 3 | ||||
-rw-r--r-- | ui/core.js | 75 | ||||
-rw-r--r-- | ui/dialog.js | 3 | ||||
-rw-r--r-- | ui/menu.js | 1 | ||||
-rw-r--r-- | ui/selectmenu.js | 2 | ||||
-rw-r--r-- | ui/tabs.js | 2 | ||||
-rw-r--r-- | ui/tooltip.js | 5 | ||||
-rw-r--r-- | ui/unique-id.js | 49 |
9 files changed, 82 insertions, 62 deletions
diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 1eaa055e5..d1b65403e 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -1,9 +1,9 @@ define( [ "jquery", "lib/common", - "ui/core", "ui/form", - "ui/labels" + "ui/labels", + "ui/unique-id" ], function( $, common ) { module( "core - jQuery extensions" ); diff --git a/ui/accordion.js b/ui/accordion.js index 6cc0533c0..fdc092f98 100644 --- a/ui/accordion.js +++ b/ui/accordion.js @@ -23,8 +23,9 @@ define( [ "jquery", "./version", - "./core", + "./version", "./keycode", + "./unique-id", "./widget" ], factory ); } else { diff --git a/ui/core.js b/ui/core.js index b77338720..8737993d9 100644 --- a/ui/core.js +++ b/ui/core.js @@ -12,58 +12,25 @@ //>>group: UI Core //>>description: The core of jQuery UI, required for all interactions and widgets. //>>docs: http://api.jqueryui.com/category/ui-core/ -//>>demos: http://jqueryui.com/ -( function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define( [ - "jquery", - "./data", - "./disable-selection", - "./focusable", - "./form", - "./ie", - "./keycode", - "./labels", - "./jquery-1-7", - "./plugin", - "./safe-active-element", - "./safe-blur", - "./tabbable", - "./scroll-parent", - "./version" - ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}( function( $ ) { - -// plugins -$.fn.extend( { - - uniqueId: ( function() { - var uuid = 0; - - return function() { - return this.each( function() { - if ( !this.id ) { - this.id = "ui-id-" + ( ++uuid ); - } - } ); - }; - } )(), - - removeUniqueId: function() { - return this.each( function() { - if ( /^ui-id-\d+$/.test( this.id ) ) { - $( this ).removeAttr( "id" ); - } - } ); - } -} ); - -} ) ); +// This file is deprecated in 1.12.0 to be removed in 1.13 +( function() { +define( [ + "jquery", + "./data", + "./disable-selection", + "./focusable", + "./form", + "./ie", + "./keycode", + "./labels", + "./jquery-1-7", + "./plugin", + "./safe-active-element", + "./safe-blur", + "./scroll-parent", + "./tabbable", + "./unique-id", + "./version" +] ); +} )(); diff --git a/ui/dialog.js b/ui/dialog.js index 10c9c18f9..2b1e71dbb 100644 --- a/ui/dialog.js +++ b/ui/dialog.js @@ -34,7 +34,8 @@ "./resizable", "./safe-active-element", "./safe-blur", - "./tabbable" + "./tabbable", + "./unique-id" ], factory ); } else { diff --git a/ui/menu.js b/ui/menu.js index c266840ee..7662d328f 100644 --- a/ui/menu.js +++ b/ui/menu.js @@ -27,6 +27,7 @@ "./keycode", "./position", "./safe-active-element", + "./unique-id", "./widget" ], factory ); } else { diff --git a/ui/selectmenu.js b/ui/selectmenu.js index 04808a87d..1cd50d127 100644 --- a/ui/selectmenu.js +++ b/ui/selectmenu.js @@ -22,13 +22,13 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "./core", "./version", "./escape-selector", "./menu", "./keycode", "./labels", "./position", + "./unique-id", "./version", "./widget" ], factory ); diff --git a/ui/tabs.js b/ui/tabs.js index b5a776c48..e2cfa3ae0 100644 --- a/ui/tabs.js +++ b/ui/tabs.js @@ -22,10 +22,10 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "./core", "./escape-selector", "./keycode", "./safe-active-element", + "./unique-id", "./version", "./widget" ], factory ); diff --git a/ui/tooltip.js b/ui/tooltip.js index 3d3322fb1..58cc438e2 100644 --- a/ui/tooltip.js +++ b/ui/tooltip.js @@ -22,11 +22,12 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "./core", "./keycode", "./position", + "./unique-id", "./version", - "./widget" ], factory ); + "./widget" + ], factory ); } else { // Browser globals diff --git a/ui/unique-id.js b/ui/unique-id.js new file mode 100644 index 000000000..a8db136e3 --- /dev/null +++ b/ui/unique-id.js @@ -0,0 +1,49 @@ +/*! + * jQuery UI Unique ID @VERSION + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + +//>>label: uniqueId +//>>group: Core +//>>description: Functions to generate and remove uniqueId's +//>>docs: http://api.jqueryui.com/uniqueId/ + +( 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 $.fn.extend( { + uniqueId: ( function() { + var uuid = 0; + + return function() { + return this.each( function() { + if ( !this.id ) { + this.id = "ui-id-" + ( ++uuid ); + } + } ); + }; + } )(), + + removeUniqueId: function() { + return this.each( function() { + if ( /^ui-id-\d+$/.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + } ); + } +} ); + +} ) ); |