From 809aa1c2d7a40bd440fd508ddf2f1e8c9002eb13 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:58:48 +0800 Subject: [PATCH] rename popup to refer to the new window generated --- scripts/GUI/entrypoints/ManagedWindow.js | 15 +++++++++++++ scripts/GUI/entrypoints/popup.js | 27 ------------------------ 2 files changed, 15 insertions(+), 27 deletions(-) create mode 100644 scripts/GUI/entrypoints/ManagedWindow.js delete mode 100644 scripts/GUI/entrypoints/popup.js diff --git a/scripts/GUI/entrypoints/ManagedWindow.js b/scripts/GUI/entrypoints/ManagedWindow.js new file mode 100644 index 0000000..7f6031f --- /dev/null +++ b/scripts/GUI/entrypoints/ManagedWindow.js @@ -0,0 +1,15 @@ +import Window from "/scripts/GUI/window.js"; +import BrowserIcon from '/scripts/GUI/extensionIcon.js'; + +export default class ManagedWindow { + constructor () { + this.instance = new Window("/pages/popup.htm", null, {"width": "120", "height": "200", "hidden": true}); + } + + /* + Show the popup. + */ + show() { + this.instance.show(); + } +} \ No newline at end of file diff --git a/scripts/GUI/entrypoints/popup.js b/scripts/GUI/entrypoints/popup.js deleted file mode 100644 index 9bd9149..0000000 --- a/scripts/GUI/entrypoints/popup.js +++ /dev/null @@ -1,27 +0,0 @@ -import Popup from "/scripts/GUI/popup.js"; - -export default class ManagedPopup { - constructor () { - this.instance = new Popup({"popup": "/pages/popup.htm", "hidden": true}); - this.listener = chrome.runtime.onMessage.addListener( - (request, sender, sendResponse) => { - (request.action == "popup_open") ? this.enable() : this.disable(); - } - ); - } - - /* - Enable the popup. - */ - enable() { - this.instance.enable(); - } - - /* - Close and disable the popup. - */ - disable() { - // Close the sidebar. - this.instance.disable(); - } -} \ No newline at end of file