From ddad0cdc7799b70aef7d4400132d4870b3890f89 Mon Sep 17 00:00:00 2001
From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com>
Date: Fri, 24 Jul 2026 19:36:10 +0200
Subject: [PATCH] gh-14651: Change event listeners to not be inlined (gh-14700)
---
src/zen/boosts/ZenBoostsEditor.mjs | 12 ++++++++
src/zen/boosts/jar.inc.mn | 1 +
src/zen/boosts/zen-boost-editor.inc.xhtml | 28 +++++--------------
src/zen/boosts/zen-boost-editor.js | 14 ++++++++++
src/zen/space-routing/jar.inc.mn | 1 +
.../space-routing/zen-space-routing.inc.xhtml | 12 +-------
src/zen/space-routing/zen-space-routing.js | 14 ++++++++++
7 files changed, 50 insertions(+), 32 deletions(-)
create mode 100644 src/zen/boosts/zen-boost-editor.js
create mode 100644 src/zen/space-routing/zen-space-routing.js
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 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+