http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59671

Revision: 59671
Author:   catrope
Date:     2009-12-02 18:44:03 +0000 (Wed, 02 Dec 2009)

Log Message:
-----------
Fix more abuses of spacing in regexes in jQuery

Modified Paths:
--------------
    trunk/phase3/js2/js2stopgap.js
    trunk/phase3/js2/js2stopgap.min.js

Modified: trunk/phase3/js2/js2stopgap.js
===================================================================
--- trunk/phase3/js2/js2stopgap.js      2009-12-02 18:30:58 UTC (rev 59670)
+++ trunk/phase3/js2/js2stopgap.js      2009-12-02 18:44:03 UTC (rev 59671)
@@ -30,7 +30,7 @@
        // (both of which we optimize for)
        quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
        // Is it a simple selector
-       isSimple = / ^ .[ ^ :# \[\.,]*$/;
+       isSimple = /^.[^:# \[\.,]*$/;
 
 jQuery.fn = jQuery.prototype = {
        init: function( selector, context ) {
@@ -460,7 +460,7 @@
                        if ( this.nodeType != 1 )
                                return;
 
-                       if ( jQuery.isArray( value ) && / radio | checkbox / 
.test( this.type ) )
+                       if ( jQuery.isArray( value ) && /radio|checkbox/ .test( 
this.type ) )
                                this.checked = ( jQuery.inArray( this.value, 
value ) >= 0 ||
                                        jQuery.inArray( this.name, value ) >= 0 
);
 
@@ -791,7 +791,7 @@
                }
 
                // Make sure we're using the right name for getting the float 
value
-               if ( name.match( / float /i ) )
+               if ( name.match( /float/i ) )
                        name = styleFloat;
 
                if ( !force && style && style[ name ] )
@@ -800,10 +800,10 @@
                else if ( defaultView.getComputedStyle ) {
 
                        // Only "float" is needed here
-                       if ( name.match( / float /i ) )
+                       if ( name.match( /float/i ) )
                                name = "float";
 
-                       name = name.replace( / ( [A - Z] ) /g, "-$1" 
).toLowerCase();
+                       name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
 
                        var computedStyle = defaultView.getComputedStyle( elem, 
null );
 

Modified: trunk/phase3/js2/js2stopgap.min.js
===================================================================
--- trunk/phase3/js2/js2stopgap.min.js  2009-12-02 18:30:58 UTC (rev 59670)
+++ trunk/phase3/js2/js2stopgap.min.js  2009-12-02 18:44:03 UTC (rev 59671)
@@ -1,6 +1,6 @@
 
 (function(){var
-window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return
 new 
jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return
 this;}
+window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return
 new 
jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#
 
\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return
 this;}
 if(typeof selector==="string"){var 
match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
 selector=jQuery.clean([match[1]],context);else{var 
elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
 return jQuery().find(selector);var 
ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return 
ret;}}else



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to