From aac2a58b5f821c6f90c95bb19f3b0a755d5e1739 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 13 Aug 2017 16:11:51 -0700 Subject: wip --- ext/bg/background.html | 1 + ext/bg/js/display-window.js | 14 +++++++------- ext/bg/search.html | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'ext/bg') diff --git a/ext/bg/background.html b/ext/bg/background.html index 40f37b11..fd3b7dd1 100644 --- a/ext/bg/background.html +++ b/ext/bg/background.html @@ -20,6 +20,7 @@ + diff --git a/ext/bg/js/display-window.js b/ext/bg/js/display-window.js index 52c0cafa..cbb96681 100644 --- a/ext/bg/js/display-window.js +++ b/ext/bg/js/display-window.js @@ -17,26 +17,26 @@ */ -window.displayWindow = new class extends Display { +window.yomichan_window = new class extends Display { constructor() { super($('#spinner'), $('#content')); this.search = $('#search').click(this.onSearch.bind(this)); - this.query = $('#query').on('input', this.inputSearch.bind(this)); + this.query = $('#query').on('input', this.onSearchInput.bind(this)); this.intro = $('#intro'); window.wanakana.bind(this.query.get(0)); } - handleError(error) { + onError(error) { window.alert(`Error: ${error}`); } - clearSearch() { + onSearchClear() { this.query.focus().select(); } - inputSearch() { + onSearchInput() { this.search.prop('disabled', this.query.val().length === 0); } @@ -46,9 +46,9 @@ window.displayWindow = new class extends Display { try { this.intro.slideUp(); const {length, definitions} = await apiTermsFind(this.query.val()); - super.showTermDefs(definitions, await apiOptionsGet()); + super.termsShow(definitions, await apiOptionsGet()); } catch (e) { - this.handleError(e); + this.onError(e); } } }; diff --git a/ext/bg/search.html b/ext/bg/search.html index 655d7819..fe44d74e 100644 --- a/ext/bg/search.html +++ b/ext/bg/search.html @@ -40,10 +40,10 @@ + - -- cgit v1.2.3