From 2f989de7d000193a5a1004f22bce54e4c3951d72 Mon Sep 17 00:00:00 2001 From: Jason Ojisan Date: Mon, 26 Aug 2024 18:00:22 +0300 Subject: [PATCH] add button --- ext/js/pages/settings/dictionary-import-controller.js | 8 +++++--- ext/settings.html | 3 ++- ext/welcome.html | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index 25f0174dba..83f225e186 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -61,8 +61,8 @@ export class DictionaryImportController { this._purgeConfirmModal = null; /** @type {HTMLElement} */ this._errorContainer = querySelectorNotNull(document, '#dictionary-error'); - /** @type {HTMLButtonElement} */ - this._getDictsButton = querySelectorNotNull(document, '#get-third-party-dictionaries'); + /** @type {NodeListOf} **/ + this._getDictsButtons = document.querySelectorAll('.get-third-party-dictionaries'); /** @type {[originalMessage: string, newMessage: string][]} */ this._errorToStringOverrides = [ @@ -91,7 +91,9 @@ export class DictionaryImportController { this._importButton.addEventListener('click', this._onImportButtonClick.bind(this), false); this._importURLButton.addEventListener('click', this._onImportFromURL.bind(this), false); this._importFileInput.addEventListener('change', this._onImportFileChange.bind(this), false); - this._getDictsButton.addEventListener('click', this._onGetButtonClick.bind(this), false); + for (const link of this._getDictsButtons) { + link.addEventListener('click', this._onGetButtonClick.bind(this), false); + } this._importFileDrop.addEventListener('click', this._onImportFileButtonClick.bind(this), false); this._importFileDrop.addEventListener('dragenter', this._onFileDropEnter.bind(this), false); diff --git a/ext/settings.html b/ext/settings.html index 174fdab039..e16e296a44 100644 --- a/ext/settings.html +++ b/ext/settings.html @@ -2558,7 +2558,7 @@

Rikaitan Settings

diff --git a/ext/welcome.html b/ext/welcome.html index 88daea3660..a4186c4fa0 100644 --- a/ext/welcome.html +++ b/ext/welcome.html @@ -254,7 +254,7 @@

Basic customization