Index: trunk/extensions/LiveTranslate/includes/ext.lt.ms.js |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | this.runningJobs = 0; |
17 | 17 | this.checkingForIdle = false; |
18 | 18 | this.lastCompletion; |
| 19 | +// window.fooz = 0; |
19 | 20 | |
20 | 21 | /** |
21 | 22 | * Determines a chunk to translate of an DOM elements contents and calls the Microsoft Translate API. |
— | — | @@ -114,7 +115,7 @@ |
115 | 116 | 'appId': window.ltMsAppId, |
116 | 117 | 'from': sourceLang, |
117 | 118 | 'to': targetLang, |
118 | | - 'text': jQuery.trim( chunk ) // Trim, so the result does not contain preceding or tailing spaces. |
| 119 | + 'text': $.trim( chunk ) // Trim, so the result does not contain preceding or tailing spaces. |
119 | 120 | }, |
120 | 121 | chunckTranslationDone |
121 | 122 | ); |
— | — | @@ -142,8 +143,20 @@ |
143 | 144 | ltdebug( 'MS: Found content node' ); |
144 | 145 | |
145 | 146 | self.runningJobs++; |
| 147 | + |
| 148 | +// if ( window.fooz < 7 ) { |
| 149 | +// window.fooz++; |
| 150 | +// if ( window.fooz > 6 ) { |
| 151 | +// alert( this.data + "\n---------------" ); |
| 152 | +// var partz = this.data.split( new RegExp( "[.!?](?=\\s+|$)", "gi" ) ); |
| 153 | +// for ( i in partz ) { |
| 154 | +// alert( partz[i] ); |
| 155 | +// } |
| 156 | +// } |
| 157 | +// } |
| 158 | + |
146 | 159 | self.translateChunk( |
147 | | - this.data.split( new RegExp( "(\\S.+?[.!?])(?=\\s+|$)", "gi" ) ), |
| 160 | + this.data.split( new RegExp( "[.!?](?=\\s+|$)", "gi" ) ), // "(\\S.+?[.!?])(?=\\s+|$)" |
148 | 161 | [], |
149 | 162 | maxChunkLength, |
150 | 163 | sourceLang, |