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

Revision: 89846
Author:   tparscal
Date:     2011-06-10 19:58:08 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
Minor edits for compatibility.

Modified Paths:
--------------
    trunk/parsers/wikidom/lib/jquery.editSurface.js
    trunk/parsers/wikidom/lib/jquery.flow.js

Modified: trunk/parsers/wikidom/lib/jquery.editSurface.js
===================================================================
--- trunk/parsers/wikidom/lib/jquery.editSurface.js     2011-06-10 19:55:40 UTC 
(rev 89845)
+++ trunk/parsers/wikidom/lib/jquery.editSurface.js     2011-06-10 19:58:08 UTC 
(rev 89846)
@@ -113,7 +113,7 @@
                        }
                        // Distance test
                        var distance = Math.abs( y - top );
-                       if ( minDistance === undefined || distance < 
minDistance ) {
+                       if ( typeof minDistance === 'undefined' || distance < 
minDistance ) {
                                minDistance = distance;
                                $line = $(this);
                        }

Modified: trunk/parsers/wikidom/lib/jquery.flow.js
===================================================================
--- trunk/parsers/wikidom/lib/jquery.flow.js    2011-06-10 19:55:40 UTC (rev 
89845)
+++ trunk/parsers/wikidom/lib/jquery.flow.js    2011-06-10 19:58:08 UTC (rev 
89846)
@@ -35,9 +35,8 @@
  *     ]
  * }
  */
-
 function copy( from, to ) {
-       if ( to === undefined ) {
+       if ( typeof to === 'undefined' ) {
                to = {};
        }
        if ( from == null || typeof from != 'object' ) {
@@ -65,7 +64,7 @@
        'charCache': {},
        'wordCache': {},
        'measureWord': function( text, ruler ) {
-               if ( $.flow.wordCache[text] === undefined ) {
+               if ( typeof $.flow.wordCache[text] === 'undefined' ) {
                        // Cache miss
                        var word = { 'text': text, 'html': '', 'metrics': [] };
                        for ( var i = 0; i < text.length; i++ ) {
@@ -80,7 +79,7 @@
                                                .replace( '\n', '<span 
class="editSurface-whitespace">&#9166;</span>' )
                                                .replace( '\t', '<span 
class="editSurface-whitespace">&#8677;</span>' );
                                word.html += charHtml;
-                               if ( $.flow.charCache[char] === undefined ) {
+                               if ( typeof $.flow.charCache[char] === 
'undefined' ) {
                                        // Cache miss
                                        ruler.innerHTML = charHtml;
                                        word.metrics.push( 
$.flow.charCache[char] = ruler.clientWidth );
@@ -161,7 +160,7 @@
 };
 
 $.fn.flow = function( text ) {
-       console.time( 'flow' );
+       //console.time( 'flow' );
        
        var $this = $(this),
                $ruler = $( '<div></div>' ).appendTo( $(this) ),
@@ -183,6 +182,6 @@
                $this.append( $line );
        }
        
-       console.timeEnd( 'flow' );
+       //console.timeEnd( 'flow' );
        return $this;
 };


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to