X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fjquery%2Fjquery.mwExtension.js;h=de399788a516b68059694a582f6fbb18f9d98fa0;hb=4ae77e4722f2f2ef5446b3dc470046190ba4d4e5;hp=375739336e17ab35d3b23074b68e78bb3941fcd1;hpb=d266f40a2f828810d0249de1fdd7107a026066d4;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/jquery/jquery.mwExtension.js b/resources/jquery/jquery.mwExtension.js index 375739336e..de399788a5 100644 --- a/resources/jquery/jquery.mwExtension.js +++ b/resources/jquery/jquery.mwExtension.js @@ -15,12 +15,13 @@ return str.charAt( 0 ).toUpperCase() + str.substr( 1 ); }, escapeRE: function ( str ) { - return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, "\\$1" ); + return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' ); }, isDomElement: function ( el ) { return !!el && !!el.nodeType; }, isEmpty: function ( v ) { + var key; if ( v === '' || v === 0 || v === '0' || v === null || v === false || v === undefined ) { @@ -32,7 +33,7 @@ return true; } if ( typeof v === 'object' ) { - for ( var key in v ) { + for ( key in v ) { return false; } return true; @@ -55,6 +56,7 @@ return true; }, compareObject: function ( objectA, objectB ) { + var prop, type; // Do a simple check if the types match if ( typeof objectA === typeof objectB ) { @@ -65,13 +67,12 @@ if ( objectA === objectB ) { return true; } else { - var prop; // Iterate over each property for ( prop in objectA ) { // Check if this property is also present in the other object if ( prop in objectB ) { // Compare the types of the properties - var type = typeof objectA[prop]; + type = typeof objectA[prop]; if ( type === typeof objectB[prop] ) { // Recursively check objects inside this one switch ( type ) {