]> source.dussan.org Git - jquery-ui.git/commitdiff
Core: Move escape selector into its own module
authorAlexander Schmitz <arschmitz@gmail.com>
Thu, 16 Jul 2015 13:13:15 +0000 (09:13 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Sat, 8 Aug 2015 04:29:36 +0000 (00:29 -0400)
Ref #9647

ui/core.js
ui/escape-selector.js [new file with mode: 0644]
ui/selectmenu.js
ui/tabs.js

index a0931dffad239faa776f4d2dce0765701547b18e..fe627dea66e6905f394591b4d1bdaf4a8628e887 100644 (file)
@@ -22,6 +22,7 @@
                        "jquery",
                        "./data",
                        "./disable-selection",
+                       "./escape-selector",
                        "./focusable",
                        "./version"
                ], factory );
@@ -90,15 +91,7 @@ $.extend( $.ui, {
                if ( element && element.nodeName.toLowerCase() !== "body" ) {
                        $( element ).trigger( "blur" );
                }
-       },
-
-       // Internal use only
-       escapeSelector: ( function() {
-               var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
-               return function( selector ) {
-                       return selector.replace( selectorEscape, "\\$1" );
-               };
-       } )()
+       }
 } );
 
 // plugins
diff --git a/ui/escape-selector.js b/ui/escape-selector.js
new file mode 100644 (file)
index 0000000..d43e4f8
--- /dev/null
@@ -0,0 +1,21 @@
+( function( factory ) {
+       if ( typeof define === "function" && define.amd ) {
+
+               // AMD. Register as an anonymous module.
+               define( [ "jquery", "./version" ], factory );
+       } else {
+
+               // Browser globals
+               factory( jQuery );
+       }
+} ( function( $ ) {
+
+// Internal use only
+return $.ui.escapeSelector = ( function() {
+       var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
+       return function( selector ) {
+               return selector.replace( selectorEscape, "\\$1" );
+       };
+} )();
+
+} ) );
index 227d87ae78c736a588feebc812794510d259dbdd..fe1a7fa999ae737da242568a4b14b791ebbe8e32 100644 (file)
@@ -24,6 +24,7 @@
                        "jquery",
                        "./core",
                        "./version",
+                       "./escape-selector",
                        "./widget",
                        "./position",
                        "./menu"
index 5aaa8c5fa6f06640f5f22fe6d5f9df2007483a27..4cd80a1df4aa7d27ffa765eff91d3395a23ada0b 100644 (file)
@@ -23,6 +23,7 @@
                define( [
                        "jquery",
                        "./core",
+                       "./escape-selector",
                        "./version",
                        "./widget"
                ], factory );