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