https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112557

Revision: 112557
Author:   inez
Date:     2012-02-28 01:17:55 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Improved support for spellchecker

Modified Paths:
--------------
    trunk/extensions/VisualEditor/demos/playground/playground.js

Modified: trunk/extensions/VisualEditor/demos/playground/playground.js
===================================================================
--- trunk/extensions/VisualEditor/demos/playground/playground.js        
2012-02-28 01:05:56 UTC (rev 112556)
+++ trunk/extensions/VisualEditor/demos/playground/playground.js        
2012-02-28 01:17:55 UTC (rev 112557)
@@ -37,7 +37,7 @@
 
        // Set initial content for the "editor"
 //     this.$editor.html("<b>Lorem Ipsum is simply dummy text</b> of the 
printing and typesetting industry. <b>Lorem Ipsum has been the 
<i>industry's</i> standard</b> dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it <u>to <b>make <i>a type</i> 
specimen</b> book.</u>... New text...");
-       this.$editor.html("New book is good");
+       this.$editor.html("Ipsum <b>New book me<i>ss</i>age is good</b> Lorem");
 //     this.$editor.html("... <b>w</b>");
        this.$editor.addClass('leafNode');
 
@@ -98,7 +98,7 @@
                } else {
                        var     sameFromLeft = 0,
                                sameFromRight = 0,
-                               l = Math.max( this.prevText.length, text.length 
);
+                               l = text.length > this.prevText.length ? 
this.prevText.length : text.length; 
 
                        while ( sameFromLeft < l && this.prevText[sameFromLeft] 
== text[sameFromLeft] ) {
                                ++sameFromLeft;
@@ -107,6 +107,8 @@
             while ( sameFromRight < l && this.prevText[this.prevText.length - 
1 - sameFromRight] == text[text.length - 1 - sameFromRight] ) {
                 ++sameFromRight;
                        }
+                       console.log('sameFromLeft', sameFromLeft);
+                       console.log('sameFromRight', sameFromRight);
                        console.log('to delete', this.prevText.substring( 
sameFromLeft, this.prevText.length - sameFromRight), sameFromLeft );
                        console.log('to insert', text.substring( sameFromLeft, 
text.length - sameFromRight ), sameFromLeft );                   
                }
@@ -114,6 +116,7 @@
        }
        
        if ( hash !== this.prevHash ) {
+               console.log("DOM hash is different");
                this.prevHash = hash;
        }
        


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

Reply via email to