diff --git a/src/zen/boosts/ZenBoostsEditor.mjs b/src/zen/boosts/ZenBoostsEditor.mjs index 2f37a99a5..3c5054110 100644 --- a/src/zen/boosts/ZenBoostsEditor.mjs +++ b/src/zen/boosts/ZenBoostsEditor.mjs @@ -138,6 +138,18 @@ export class nsZenBoostEditor { .getElementById("zen-boost-css-inspector") .addEventListener("click", this.onInspectorButtonPressed.bind(this)); + const commandActions = { + cmd_zenBoostEditName: () => this.editBoostName(), + cmd_zenBoostShuffle: () => this.shuffleBoost(), + cmd_zenBoostReset: () => this.resetBoost(), + cmd_zenBoostLoad: () => this.onLoadBoostClick(), + cmd_zenBoostSave: () => this.onSaveBoostClick(), + cmd_zenBoostDelete: () => this.deleteBoost(), + }; + for (const [id, action] of Object.entries(commandActions)) { + this.doc.getElementById(id).addEventListener("command", action); + } + this.doc.addEventListener("keydown", event => { if ( event.key === "Escape" || diff --git a/src/zen/boosts/jar.inc.mn b/src/zen/boosts/jar.inc.mn index b17e886b6..6410e6b22 100644 --- a/src/zen/boosts/jar.inc.mn +++ b/src/zen/boosts/jar.inc.mn @@ -9,6 +9,7 @@ # Windows * content/browser/zen-components/windows/zen-boost-editor.xhtml (../../zen/boosts/zen-boost-editor.inc.xhtml) + content/browser/zen-components/windows/zen-boost-editor.js (../../zen/boosts/zen-boost-editor.js) # Images content/browser/zen-images/boost-indicator.svg (../../zen/images/boost-indicator.svg) diff --git a/src/zen/boosts/zen-boost-editor.inc.xhtml b/src/zen/boosts/zen-boost-editor.inc.xhtml index 9cd64e411..0933f6c20 100644 --- a/src/zen/boosts/zen-boost-editor.inc.xhtml +++ b/src/zen/boosts/zen-boost-editor.inc.xhtml @@ -138,28 +138,14 @@ - - - - - - - - - - - + + + + + + - + diff --git a/src/zen/boosts/zen-boost-editor.js b/src/zen/boosts/zen-boost-editor.js new file mode 100644 index 000000000..962b454ce --- /dev/null +++ b/src/zen/boosts/zen-boost-editor.js @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { nsZenBoostEditor } = ChromeUtils.importESModule( + "resource:///modules/zen/boosts/ZenBoostsEditor.mjs" +); + +window.boostEditor = new nsZenBoostEditor( + document, + window.domain, + window, + window.openerWindow +); diff --git a/src/zen/space-routing/jar.inc.mn b/src/zen/space-routing/jar.inc.mn index 99e725681..120c4388a 100644 --- a/src/zen/space-routing/jar.inc.mn +++ b/src/zen/space-routing/jar.inc.mn @@ -7,3 +7,4 @@ # Windows * content/browser/zen-components/windows/zen-space-routing.xhtml (../../zen/space-routing/zen-space-routing.inc.xhtml) + content/browser/zen-components/windows/zen-space-routing.js (../../zen/space-routing/zen-space-routing.js) diff --git a/src/zen/space-routing/zen-space-routing.inc.xhtml b/src/zen/space-routing/zen-space-routing.inc.xhtml index 7b4cdc858..507b9fa0b 100644 --- a/src/zen/space-routing/zen-space-routing.inc.xhtml +++ b/src/zen/space-routing/zen-space-routing.inc.xhtml @@ -82,15 +82,5 @@ - + diff --git a/src/zen/space-routing/zen-space-routing.js b/src/zen/space-routing/zen-space-routing.js new file mode 100644 index 000000000..0684665dd --- /dev/null +++ b/src/zen/space-routing/zen-space-routing.js @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { nsZenSpaceRoutingDialog } = ChromeUtils.importESModule( + "resource:///modules/zen/spacerouting/ZenSpaceRoutingDialog.mjs" +); + +const args = window.arguments?.[0] || {}; +window.spaceroutingDialog = new nsZenSpaceRoutingDialog( + document, + window, + args.parentWindow +);