diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-01 10:00:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 15:00:59 +0000 |
commit | dfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch) | |
tree | 04686b943b84b33b8927238be17e4bc0dda7eb62 /ext/js/pages/settings/popup-preview-frame.js | |
parent | 2356223942a21d1683ac38eed8e7b9485f453d87 (diff) |
Application refactor (#591)
* Rename Yomitan class to Application, change initialization style
* Rename file
* Update init
* Update config
* Remove dead code
Diffstat (limited to 'ext/js/pages/settings/popup-preview-frame.js')
-rw-r--r-- | ext/js/pages/settings/popup-preview-frame.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/js/pages/settings/popup-preview-frame.js b/ext/js/pages/settings/popup-preview-frame.js index 7a899641..e9cfa541 100644 --- a/ext/js/pages/settings/popup-preview-frame.js +++ b/ext/js/pages/settings/popup-preview-frame.js @@ -20,16 +20,18 @@ import * as wanakana from '../../../lib/wanakana.js'; import {Frontend} from '../../app/frontend.js'; import {querySelectorNotNull} from '../../dom/query-selector.js'; import {TextSourceRange} from '../../dom/text-source-range.js'; -import {yomitan} from '../../yomitan.js'; export class PopupPreviewFrame { /** + * @param {import('../../application.js').Application} application * @param {number} tabId * @param {number} frameId * @param {import('../../app/popup-factory.js').PopupFactory} popupFactory * @param {import('../../input/hotkey-handler.js').HotkeyHandler} hotkeyHandler */ - constructor(tabId, frameId, popupFactory, hotkeyHandler) { + constructor(application, tabId, frameId, popupFactory, hotkeyHandler) { + /** @type {import('../../application.js').Application} */ + this._application = application; /** @type {number} */ this._tabId = tabId; /** @type {number} */ @@ -86,11 +88,12 @@ export class PopupPreviewFrame { // Overwrite API functions /** @type {?(optionsContext: import('settings').OptionsContext) => Promise<import('settings').ProfileOptions>} */ - this._apiOptionsGetOld = yomitan.api.optionsGet.bind(yomitan.api); - yomitan.api.optionsGet = this._apiOptionsGet.bind(this); + this._apiOptionsGetOld = this._application.api.optionsGet.bind(this._application.api); + this._application.api.optionsGet = this._apiOptionsGet.bind(this); // Overwrite frontend this._frontend = new Frontend({ + application: this._application, tabId: this._tabId, frameId: this._frameId, popupFactory: this._popupFactory, |