Index: trunk/parsers/wikidom/lib/jquery.flow.js |
— | — | @@ -35,9 +35,8 @@ |
36 | 36 | * ] |
37 | 37 | * } |
38 | 38 | */ |
39 | | - |
40 | 39 | function copy( from, to ) { |
41 | | - if ( to === undefined ) { |
| 40 | + if ( typeof to === 'undefined' ) { |
42 | 41 | to = {}; |
43 | 42 | } |
44 | 43 | if ( from == null || typeof from != 'object' ) { |
— | — | @@ -65,7 +64,7 @@ |
66 | 65 | 'charCache': {}, |
67 | 66 | 'wordCache': {}, |
68 | 67 | 'measureWord': function( text, ruler ) { |
69 | | - if ( $.flow.wordCache[text] === undefined ) { |
| 68 | + if ( typeof $.flow.wordCache[text] === 'undefined' ) { |
70 | 69 | // Cache miss |
71 | 70 | var word = { 'text': text, 'html': '', 'metrics': [] }; |
72 | 71 | for ( var i = 0; i < text.length; i++ ) { |
— | — | @@ -80,7 +79,7 @@ |
81 | 80 | .replace( '\n', '<span class="editSurface-whitespace">⏎</span>' ) |
82 | 81 | .replace( '\t', '<span class="editSurface-whitespace">⇥</span>' ); |
83 | 82 | word.html += charHtml; |
84 | | - if ( $.flow.charCache[char] === undefined ) { |
| 83 | + if ( typeof $.flow.charCache[char] === 'undefined' ) { |
85 | 84 | // Cache miss |
86 | 85 | ruler.innerHTML = charHtml; |
87 | 86 | word.metrics.push( $.flow.charCache[char] = ruler.clientWidth ); |
— | — | @@ -161,7 +160,7 @@ |
162 | 161 | }; |
163 | 162 | |
164 | 163 | $.fn.flow = function( text ) { |
165 | | - console.time( 'flow' ); |
| 164 | + //console.time( 'flow' ); |
166 | 165 | |
167 | 166 | var $this = $(this), |
168 | 167 | $ruler = $( '<div></div>' ).appendTo( $(this) ), |
— | — | @@ -183,6 +182,6 @@ |
184 | 183 | $this.append( $line ); |
185 | 184 | } |
186 | 185 | |
187 | | - console.timeEnd( 'flow' ); |
| 186 | + //console.timeEnd( 'flow' ); |
188 | 187 | return $this; |
189 | 188 | }; |
Index: trunk/parsers/wikidom/lib/jquery.editSurface.js |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | } |
115 | 115 | // Distance test |
116 | 116 | var distance = Math.abs( y - top ); |
117 | | - if ( minDistance === undefined || distance < minDistance ) { |
| 117 | + if ( typeof minDistance === 'undefined' || distance < minDistance ) { |
118 | 118 | minDistance = distance; |
119 | 119 | $line = $(this); |
120 | 120 | } |