Index: trunk/phase3/resources/jquery/jquery.mwExtension.js |
— | — | @@ -3,26 +3,25 @@ |
4 | 4 | */ |
5 | 5 | |
6 | 6 | jQuery.extend({ |
7 | | - trimLeft : function( str ) { |
| 7 | + trimLeft: function( str ) { |
8 | 8 | return str === null ? '' : str.toString().replace( /^\s+/, '' ); |
9 | 9 | }, |
10 | | - trimRight : function( str ) { |
| 10 | + trimRight: function( str ) { |
11 | 11 | return str === null ? |
12 | 12 | '' : str.toString().replace( /\s+$/, '' ); |
13 | 13 | }, |
14 | | - ucFirst : function( str ) { |
| 14 | + ucFirst: function( str ) { |
15 | 15 | return str.substr( 0, 1 ).toUpperCase() + str.substr( 1 ); |
16 | 16 | }, |
17 | | - escapeRE : function( str ) { |
| 17 | + escapeRE: function( str ) { |
18 | 18 | return str.replace ( /([\\{}()|.?*+\-^$\[\]])/g, "\\$1" ); |
19 | 19 | }, |
20 | | - isDomElement : function( el ) { |
| 20 | + isDomElement: function( el ) { |
21 | 21 | return !!el && !!el.nodeType; |
22 | 22 | }, |
23 | | - isEmpty : function( v ) { |
24 | | - var key; |
25 | | - if ( v === "" || v === 0 || v === "0" || v === null |
26 | | - || v === false || typeof v === 'undefined' ) |
| 23 | + isEmpty: function( v ) { |
| 24 | + if ( v === '' || v === 0 || v === '0' || v === null |
| 25 | + || v === false || v === undefined ) |
27 | 26 | { |
28 | 27 | return true; |
29 | 28 | } |
— | — | @@ -32,14 +31,14 @@ |
33 | 32 | return true; |
34 | 33 | } |
35 | 34 | if ( typeof v === 'object' ) { |
36 | | - for ( key in v ) { |
| 35 | + for ( var key in v ) { |
37 | 36 | return false; |
38 | 37 | } |
39 | 38 | return true; |
40 | 39 | } |
41 | 40 | return false; |
42 | 41 | }, |
43 | | - compareArray : function( arrThis, arrAgainst ) { |
| 42 | + compareArray: function( arrThis, arrAgainst ) { |
44 | 43 | if ( arrThis.length != arrAgainst.length ) { |
45 | 44 | return false; |
46 | 45 | } |
— | — | @@ -54,7 +53,7 @@ |
55 | 54 | } |
56 | 55 | return true; |
57 | 56 | }, |
58 | | - compareObject : function( objectA, objectB ) { |
| 57 | + compareObject: function( objectA, objectB ) { |
59 | 58 | |
60 | 59 | // Do a simple check if the types match |
61 | 60 | if ( typeof objectA == typeof objectB ) { |