1+ // @flow
2+
13var spellers = { } , spellerData = { } ;
24var currentSpellCheckerRequest ;
35
@@ -46,7 +48,7 @@ function getSpellers() {
4648 return deferred . promise ( ) ;
4749}
4850
49- if ( modeEnabled ( 'spellchecker ' ) ) {
51+ if ( modeEnabled ( 'spellchecking ' ) ) {
5052 $ ( document ) . ready ( function ( ) {
5153 restoreChoices ( 'spellchecker' ) ;
5254 var timer , timeout = 2000 ;
@@ -214,17 +216,17 @@ function check() {
214216 success : function ( data ) {
215217 var originalWordsIndex = 0 ;
216218 for ( var tokenIndex = 0 ; tokenIndex < data . length ; tokenIndex ++ ) {
217- if ( data [ tokenIndex ] [ ' known' ] === true ) { // eslint-disable-line dot-notation
218- $ ( '#spellcheckerInput ' ) . html ( $ ( '#spellcheckerInput ' ) . html ( ) + ' ' + splitWords [ originalWordsIndex ] ) ;
219+ if ( data [ tokenIndex ] . known === true ) {
220+ $ ( '#spellCheckerInput ' ) . html ( $ ( '#spellCheckerInput ' ) . html ( ) + ' ' + splitWords [ originalWordsIndex ] ) ;
219221 originalWordsIndex ++ ;
220222 continue ;
221223 }
222- $ ( '#spellcheckerInput ' ) . html ( $ ( '#spellcheckerInput ' ) . html ( ) + ' <span class="spellError" id=' +
224+ $ ( '#spellCheckerInput ' ) . html ( $ ( '#spellCheckerInput ' ) . html ( ) + ' <span class="spellError" id=' +
223225 splitWords [ originalWordsIndex ] + '>' + splitWords [ originalWordsIndex ] + '</span>' ) ;
224226 content [ splitWords [ originalWordsIndex ] ] = '<div class="list-group">' ;
225- for ( var sugg = 0 ; sugg < data [ tokenIndex ] [ ' sugg' ] . length ; sugg ++ ) { // eslint-disable-line dot-notation
227+ for ( var sugg = 0 ; sugg < data [ tokenIndex ] . sugg . length ; sugg ++ ) {
226228 content [ splitWords [ originalWordsIndex ] ] += '<a href="#" class="list-group-item">' +
227- data [ tokenIndex ] [ ' sugg' ] [ sugg ] [ 0 ] + '</a>' ; // eslint-disable-line dot-notation
229+ data [ tokenIndex ] . sugg [ sugg ] [ 0 ] + '</a>' ;
228230 content [ splitWords [ originalWordsIndex ] ] += '</div>' ;
229231 }
230232 $ ( '.spellError' ) . each ( function ( ) {
@@ -248,7 +250,10 @@ function handleSpellCheckerErrorResponse(jqXHR) {
248250}
249251
250252function spellCheckerNotAvailable ( data ) {
251- $ ( '#spellCheckerInput' ) . append ( $ ( '<div></div>' ) . text ( ' ' ) ) ;
252253 $ ( '#spellCheckerInput' ) . append ( $ ( '<div></div>' ) . text ( data . message ) ) ;
253254 $ ( '#spellCheckerInput' ) . append ( $ ( '<div></div>' ) . text ( data . explanation ) ) ;
254255}
256+
257+ /*:: import {modeEnabled, ajaxSend, ajaxComplete, filterLangList, callApy} from "./util.js" */
258+ /*:: import {persistChoices, restoreChoices} from "./persistence.js" */
259+ /*:: import {readCache, cache} from "./persistence.js" */
0 commit comments