diff options
author | ache <ache@ache.one> | 2020-02-22 20:23:14 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2020-02-22 20:23:14 +0100 |
commit | 1cde126e6f730605890cb299953e028d074ccf8a (patch) | |
tree | 2bc8b82fe12b75d7fae8a4652c1501fb70e70f19 /web.js | |
parent | Test no autocapitalize (diff) |
Format fix
Problem with gsm.
They force the first letter to be a majuscule.
Ex: Typing "manger" will become "Manger" and so will not be in the
dictionary. Must be searched at manger and at Manger.
Diffstat (limited to 'web.js')
-rw-r--r-- | web.js | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -1,42 +0,0 @@ -const web = new Vue({ - el: '#web', - data: { - word: '', - timer: undefined, - definitions: null, - is_word: null - }, - methods: { - searchWord: function() { - if(!this.word) return; - if(this.timer) { - clearTimeout(this.timer); - this.timer = undefined; - } - console.log(this.word); - fetch(`/def?w=${this.word}`) - .then((response) => { - this.is_word = response.ok; - - if( response.ok ) { - response.arrayBuffer().then(res => { - this.definitions = msgpack.decode(new Uint8Array(res)); - console.log(this.definitions); - }); - } - }) - } - }, - watch: { - word: function(w) { - if( w === '' ) { - this.is_word = null; - } - if(this.timer) { - clearTimeout(this.timer); - this.timer = undefined; - } - this.timer = setTimeout(this.searchWord, 800); - } - } -}); |