33/* exported persistChoices, restoreChoices, cache, readCache */
44
55/* global config, Store, getURLParam, iso639CodesInverse, pairs, refreshLangList populateSecondaryAnalyzerList,
6- populateSecondaryGeneratorList, populateSecondarySpellCheckerList, isSubset, handleNewCurrentLang */
6+ populateSecondaryGeneratorList, isSubset, handleNewCurrentLang */
77/* global srcLangs, dstLangs, recentSrcLangs, recentDstLangs, setCurDstLang, setCurSrcLang, setRecentDstLangs, setRecentSrcLangs, setLocale,
88 curSrcLang, curDstLang, locale */
99
@@ -77,7 +77,6 @@ function persistChoices(mode /*: string */, updatePermalink /*: ?boolean */) {
7777 else if ( mode === 'spellchecker' ) {
7878 objects = {
7979 'primarySpellCheckerChoice' : $ ( '#primarySpellCheckerMode' ) . val ( ) ,
80- 'secondarySpellCheckerChoice' : $ ( '#secondarySpellCheckerMode' ) . val ( ) ,
8180 'spellCheckerInput' : $ ( '#spellCheckerInput' ) . text ( ) ,
8281 'instantChecking' : $ ( '#instantChecking' ) . val ( )
8382 } ;
@@ -131,11 +130,6 @@ function persistChoices(mode /*: string */, updatePermalink /*: ?boolean */) {
131130 urlParams . push ( 'choice=' + encodeURIComponent ( $ ( '#secondaryGeneratorMode' ) . val ( ) ) ) ;
132131 qVal = $ ( '#morphGeneratorInput' ) . val ( ) ;
133132 }
134- else if ( hash === '#spellchecking' && $ ( '#secondarySpellCheckerMode' ) . val ( ) ) {
135- urlParams = [ ] ;
136- urlParams . push ( 'choice=' + encodeURIComponent ( $ ( '#secondarySpellCheckerMode' ) . val ( ) ) ) ;
137- qVal = $ ( '#spellCheckerInput' ) . text ( ) ;
138- }
139133
140134 var qName /*: string */ = HASH_URL_MAP [ hash ] ;
141135
@@ -282,15 +276,9 @@ function restoreChoices(mode /*: string */) {
282276 }
283277 else if ( mode === 'spellchecker' ) {
284278 if ( store . able ( ) ) {
285- var primarySpellCheckerChoice = store . get ( 'primarySpellCheckerChoice' , '' ) ,
286- secondarySpellCheckerChoice = store . get ( 'secondarySpellCheckerChoice' , '' ) ;
287- if ( store . has ( 'primarySpellCheckerChoice' ) && store . has ( 'secondarySpellCheckerChoice' ) ) {
279+ var primarySpellCheckerChoice = store . get ( 'primarySpellCheckerChoice' , '' ) ;
280+ if ( store . has ( 'primarySpellCheckerChoice' ) ) {
288281 $ ( '#primarySpellCheckerMode option[value="' + primarySpellCheckerChoice + '"]' ) . prop ( 'selected' , true ) ;
289- populateSecondarySpellCheckerList ( ) ;
290- $ ( '#secondarySpellCheckerMode option[value="' + secondarySpellCheckerChoice + '"]' ) . prop ( 'selected' , true ) ;
291- }
292- else {
293- populateSecondarySpellCheckerList ( ) ;
294282 }
295283 if ( store . has ( 'spellCheckerInput' ) ) {
296284 $ ( '#spellCheckerInput' ) . text ( String ( store . get ( 'spellCheckerInput' ) ) ) ;
@@ -299,12 +287,8 @@ function restoreChoices(mode /*: string */) {
299287 }
300288
301289 if ( getURLParam ( 'choice' ) ) {
302- choice = getURLParam ( 'choice' ) . split ( '-' ) ;
303- $ ( '#primarySpellCheckerMode option[value="' + choice [ 0 ] + '"]' ) . prop ( 'selected' , true ) ;
304- populateSecondarySpellCheckerList ( ) ;
305- if ( choice . length === 2 ) {
306- $ ( '#secondarySpellCheckerMode option[value="' + choice . join ( '-' ) + '"]' ) . prop ( 'selected' , true ) ;
307- }
290+ choice = getURLParam ( 'choice' ) ;
291+ $ ( '#primarySpellCheckerMode option[value="' + choice + '"]' ) . prop ( 'selected' , true ) ;
308292 }
309293 }
310294 else if ( mode === 'localization' ) {
@@ -330,6 +314,5 @@ function restoreChoices(mode /*: string */) {
330314/*:: import {iso639Codes, iso639CodesInverse, locale, setLocale} from "./localization.js" */
331315/*:: import {populateSecondaryGeneratorList} from "./generator.js" */
332316/*:: import {populateSecondaryAnalyzerList} from "./analyzer.js" */
333- /*:: import {populateSecondarySpellCheckerList} from "./spellchecker.js" */
334317/*:: import {getURLParam, isSubset} from "./util.js" */
335318/*:: import {Store} from "./store.js" */
0 commit comments