Changeset 35950 for main/trunk
- Timestamp:
- 2022-01-11T10:48:54+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/macron-restoration/src/components/DirectInput.vue
r35902 r35950 14 14 macroniseWaitTimeout: null, 15 15 waitingToMacronise: false, 16 errorState: false 16 errorState: false, 17 preserveExistingMacrons: true, 18 enableSpellcheck: false, 19 showMacronisedWords: true, 20 normaliseLinebreaks: false 17 21 } 18 22 }, 19 23 computed: { 20 preserveExistingMacrons: {21 get() {22 const value = localStorage.getItem("preserveExistingMacrons");23 return value ?? true;24 },25 set(newValue) {26 localStorage.setItem("preserveExistingMacrons", newValue);27 }28 },29 enableSpellcheck: {30 get() {31 return localStorage.getItem("enableSpellcheck");32 },33 set(newValue) {34 localStorage.setItem("enableSpellcheck", newValue);35 }36 },37 showMacronisedWords: {38 get() {39 const value = localStorage.getItem("showMacronisedWords");40 return value ?? true;41 },42 set(newValue) {43 localStorage.setItem("showMacronisedWords", newValue);44 }45 },46 normaliseLinebreaks: {47 get() {48 return localStorage.getItem("normaliseLinebreaks");49 },50 set(newValue) {51 localStorage.setItem("normaliseLinebreaks", newValue);52 }53 },54 24 canDownload() { 55 25 return this.restored.length > 0 && !this.waitingToMacronise; … … 118 88 translations: state => state.translations 119 89 }) 90 }, 91 watch: { 92 preserveExistingMacrons(newValue) { 93 localStorage.setItem("preserveExistingMacrons", newValue); 94 }, 95 enableSpellcheck(newValue) { 96 localStorage.setItem("enableSpellcheck", newValue); 97 }, 98 showMacronisedWords(newValue) { 99 localStorage.setItem("showMacronisedWords", newValue); 100 }, 101 normaliseLinebreaks(newValue) { 102 localStorage.setItem("normaliseLinebreaks", newValue); 103 } 120 104 }, 121 105 methods: { … … 184 168 return result; 185 169 } 170 }, 171 beforeMount() { 172 // The null check is used to default this setting to true 173 this.preserveExistingMacrons = (localStorage.getItem("preserveExistingMacrons") ?? "true") === "true"; 174 this.enableSpellcheck = localStorage.getItem("enableSpellcheck") === "true"; 175 this.showMacronisedWords = (localStorage.getItem("showMacronisedWords") ?? "true") === "true"; 176 this.normaliseLinebreaks = localStorage.getItem("normaliseLinebreaks") === "true"; 186 177 } 187 178 }
Note:
See TracChangeset
for help on using the changeset viewer.