aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/popup-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-01 10:00:59 -0500
committerGitHub <noreply@github.com>2024-02-01 15:00:59 +0000
commitdfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch)
tree04686b943b84b33b8927238be17e4bc0dda7eb62 /ext/js/display/popup-main.js
parent2356223942a21d1683ac38eed8e7b9485f453d87 (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/display/popup-main.js')
-rw-r--r--ext/js/display/popup-main.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/js/display/popup-main.js b/ext/js/display/popup-main.js
index 870e039e..2ca2fcd3 100644
--- a/ext/js/display/popup-main.js
+++ b/ext/js/display/popup-main.js
@@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import {Application} from '../application.js';
import {log} from '../core/logger.js';
import {DocumentFocusController} from '../dom/document-focus-controller.js';
import {HotkeyHandler} from '../input/hotkey-handler.js';
-import {yomitan} from '../yomitan.js';
import {DisplayAnki} from './display-anki.js';
import {DisplayAudio} from './display-audio.js';
import {DisplayProfileSelection} from './display-profile-selection.js';
@@ -32,14 +32,15 @@ async function main() {
const documentFocusController = new DocumentFocusController();
documentFocusController.prepare();
- await yomitan.prepare();
+ const application = new Application();
+ await application.prepare();
- const {tabId, frameId} = await yomitan.api.frameInformationGet();
+ const {tabId, frameId} = await application.api.frameInformationGet();
const hotkeyHandler = new HotkeyHandler();
- hotkeyHandler.prepare();
+ hotkeyHandler.prepare(application.crossFrame);
- const display = new Display(tabId, frameId, 'popup', documentFocusController, hotkeyHandler);
+ const display = new Display(application, tabId, frameId, 'popup', documentFocusController, hotkeyHandler);
await display.prepare();
const displayAudio = new DisplayAudio(display);
@@ -58,7 +59,7 @@ async function main() {
document.documentElement.dataset.loaded = 'true';
- yomitan.ready();
+ application.ready();
} catch (e) {
log.error(e);
}