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

Revision: 90528
Author:   jeroendedauw
Date:     2011-06-21 14:48:36 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
fixed IE breakage

Modified Paths:
--------------
    trunk/extensions/LiveTranslate/includes/ext.lt.ms.js

Modified: trunk/extensions/LiveTranslate/includes/ext.lt.ms.js
===================================================================
--- trunk/extensions/LiveTranslate/includes/ext.lt.ms.js        2011-06-21 
14:12:15 UTC (rev 90527)
+++ trunk/extensions/LiveTranslate/includes/ext.lt.ms.js        2011-06-21 
14:48:36 UTC (rev 90528)
@@ -15,6 +15,7 @@
        this.runningJobs = 0;
        this.checkingForIdle = false;
        this.lastCompletion;
+//     window.fooz = 0;
        
        /**
         * Determines a chunk to translate of an DOM elements contents and 
calls the Microsoft Translate API.
@@ -114,7 +115,7 @@
                                'appId': window.ltMsAppId,
                                'from': sourceLang,
                                'to': targetLang,
-                               'text': jQuery.trim( chunk ) // Trim, so the 
result does not contain preceding or tailing spaces.
+                               'text': $.trim( chunk ) // Trim, so the result 
does not contain preceding or tailing spaces.
                        },
                        chunckTranslationDone
                );
@@ -142,8 +143,20 @@
                                ltdebug( 'MS: Found content node' );
                                
                                self.runningJobs++;
+                               
+//                             if ( window.fooz < 7 ) {
+//                                     window.fooz++;
+//                                     if ( window.fooz > 6 ) {
+//                                             alert( this.data + 
"\n---------------" );
+//                                             var partz = this.data.split( 
new RegExp( "[.!?](?=\\s+|$)", "gi" ) );
+//                                             for ( i in partz ) {
+//                                                     alert( partz[i] );
+//                                             }                               
                
+//                                     }
+//                             }
+                               
                                self.translateChunk(
-                                       this.data.split( new RegExp( 
"(\\S.+?[.!?])(?=\\s+|$)", "gi" ) ),
+                                       this.data.split( new RegExp( 
"[.!?](?=\\s+|$)", "gi" ) ), // "(\\S.+?[.!?])(?=\\s+|$)"
                                        [],
                                        maxChunkLength,
                                        sourceLang,


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to