From 1cde126e6f730605890cb299953e028d074ccf8a Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 22 Feb 2020 20:23:14 +0100 Subject: 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. --- web.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 web.js (limited to 'web.js') diff --git a/web.js b/web.js deleted file mode 100644 index 61b82d5..0000000 --- a/web.js +++ /dev/null @@ -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); - } - } -}); -- cgit v1.2.3-54-g00ecf