Permalink
Browse files

Core: Move escape selector into its own module

Ref #9647
  • Loading branch information...
arschmitz committed Jul 16, 2015
1 parent 475ccef commit 47188b792617a0030ccec07c6df27335dc3aa430
Showing with 25 additions and 9 deletions.
  1. +2 −9 ui/core.js
  2. +21 −0 ui/escape-selector.js
  3. +1 −0 ui/selectmenu.js
  4. +1 −0 ui/tabs.js
View
@@ -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
View
@@ -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" );
};
} )();
} ) );
View
@@ -24,6 +24,7 @@
"jquery",
"./core",
"./version",
"./escape-selector",
"./widget",
"./position",
"./menu"
View
@@ -23,6 +23,7 @@
define( [
"jquery",
"./core",
"./escape-selector",
"./version",
"./widget"
], factory );

0 comments on commit 47188b7

Please sign in to comment.