r89846 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89845‎ | r89846 | r89847 >
Date:19:58, 10 June 2011
Author:tparscal
Status:ok
Tags:
Comment:
Minor edits for compatibility.
Modified paths:
  • /trunk/parsers/wikidom/lib/jquery.editSurface.js (modified) (history)
  • /trunk/parsers/wikidom/lib/jquery.flow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/jquery.flow.js
@@ -35,9 +35,8 @@
3636 * ]
3737 * }
3838 */
39 -
4039 function copy( from, to ) {
41 - if ( to === undefined ) {
 40+ if ( typeof to === 'undefined' ) {
4241 to = {};
4342 }
4443 if ( from == null || typeof from != 'object' ) {
@@ -65,7 +64,7 @@
6665 'charCache': {},
6766 'wordCache': {},
6867 'measureWord': function( text, ruler ) {
69 - if ( $.flow.wordCache[text] === undefined ) {
 68+ if ( typeof $.flow.wordCache[text] === 'undefined' ) {
7069 // Cache miss
7170 var word = { 'text': text, 'html': '', 'metrics': [] };
7271 for ( var i = 0; i < text.length; i++ ) {
@@ -80,7 +79,7 @@
8180 .replace( '\n', '<span class="editSurface-whitespace">&#9166;</span>' )
8281 .replace( '\t', '<span class="editSurface-whitespace">&#8677;</span>' );
8382 word.html += charHtml;
84 - if ( $.flow.charCache[char] === undefined ) {
 83+ if ( typeof $.flow.charCache[char] === 'undefined' ) {
8584 // Cache miss
8685 ruler.innerHTML = charHtml;
8786 word.metrics.push( $.flow.charCache[char] = ruler.clientWidth );
@@ -161,7 +160,7 @@
162161 };
163162
164163 $.fn.flow = function( text ) {
165 - console.time( 'flow' );
 164+ //console.time( 'flow' );
166165
167166 var $this = $(this),
168167 $ruler = $( '<div></div>' ).appendTo( $(this) ),
@@ -183,6 +182,6 @@
184183 $this.append( $line );
185184 }
186185
187 - console.timeEnd( 'flow' );
 186+ //console.timeEnd( 'flow' );
188187 return $this;
189188 };
Index: trunk/parsers/wikidom/lib/jquery.editSurface.js
@@ -113,7 +113,7 @@
114114 }
115115 // Distance test
116116 var distance = Math.abs( y - top );
117 - if ( minDistance === undefined || distance < minDistance ) {
 117+ if ( typeof minDistance === 'undefined' || distance < minDistance ) {
118118 minDistance = distance;
119119 $line = $(this);
120120 }

Status & tagging log