From 01b9a3c268ae2ed85dc0d099e91b4bc3a2e4cad5 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 12 Apr 2023 23:09:40 -0400 Subject: [PATCH] fx-compat: Fix keyboard nav, move CE imports to single file (#2756) Having a single customElements.js file that we import everywhere we need it helps with organization, and it gives us a single place to put things like the fix. We could switch to using setElementCreationCallback() like Firefox if the number of imports gets out of hand, but the overhead right now should be small. --- chrome/content/scaffold/scaffold.xhtml | 2 +- chrome/content/zotero/advancedSearch.xhtml | 2 +- chrome/content/zotero/customElements.js | 61 +++++++++++++++++++ .../content/zotero/elements/guidancePanel.js | 2 - chrome/content/zotero/elements/itemBox.js | 5 -- .../content/zotero/elements/zoteroSearch.js | 15 +++-- chrome/content/zotero/feedSettings.xhtml | 2 +- .../content/zotero/ingester/selectitems.xhtml | 2 +- chrome/content/zotero/note.xhtml | 6 +- .../zotero/preferences/preferences.xhtml | 3 +- chrome/content/zotero/reader.xhtml | 3 +- chrome/content/zotero/searchDialog.xhtml | 2 +- chrome/content/zotero/selectItemsDialog.xhtml | 3 +- chrome/content/zotero/zoteroPane.xhtml | 11 +--- 14 files changed, 80 insertions(+), 39 deletions(-) create mode 100644 chrome/content/zotero/customElements.js diff --git a/chrome/content/scaffold/scaffold.xhtml b/chrome/content/scaffold/scaffold.xhtml index 203b7fbe27..bb39039c3a 100644 --- a/chrome/content/scaffold/scaffold.xhtml +++ b/chrome/content/scaffold/scaffold.xhtml @@ -68,7 +68,7 @@ } // Custom elements - Services.scriptloader.loadSubScript("chrome://global/content/customElements.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); diff --git a/chrome/content/zotero/advancedSearch.xhtml b/chrome/content/zotero/advancedSearch.xhtml index 5468dc8b18..cc36fe828a 100644 --- a/chrome/content/zotero/advancedSearch.xhtml +++ b/chrome/content/zotero/advancedSearch.xhtml @@ -26,7 +26,7 @@ diff --git a/chrome/content/zotero/note.xhtml b/chrome/content/zotero/note.xhtml index 999c1ae68c..afe55a98ab 100644 --- a/chrome/content/zotero/note.xhtml +++ b/chrome/content/zotero/note.xhtml @@ -23,11 +23,7 @@ Services.scriptloader.loadSubScript("chrome://zotero/content/include.js", this); Services.scriptloader.loadSubScript("resource://zotero/require.js", this); - Services.scriptloader.loadSubScript("chrome://global/content/customElements.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/shadowAutocompleteInput.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/noteEditor.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/relatedBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/tagsBox.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); Services.scriptloader.loadSubScript("chrome://zotero/content/note.js", this); diff --git a/chrome/content/zotero/preferences/preferences.xhtml b/chrome/content/zotero/preferences/preferences.xhtml index 683af2b056..15dc25028d 100644 --- a/chrome/content/zotero/preferences/preferences.xhtml +++ b/chrome/content/zotero/preferences/preferences.xhtml @@ -67,8 +67,7 @@ } // Custom elements - Services.scriptloader.loadSubScript("chrome://global/content/customElements.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/textLink.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); diff --git a/chrome/content/zotero/reader.xhtml b/chrome/content/zotero/reader.xhtml index 9221161478..fa0674068d 100644 --- a/chrome/content/zotero/reader.xhtml +++ b/chrome/content/zotero/reader.xhtml @@ -38,8 +38,7 @@ Services.scriptloader.loadSubScript("chrome://global/content/macWindowMenu.js", this); } - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/shadowAutocompleteInput.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/tagsBox.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); diff --git a/chrome/content/zotero/searchDialog.xhtml b/chrome/content/zotero/searchDialog.xhtml index 0b01e675c9..650d6d7181 100644 --- a/chrome/content/zotero/searchDialog.xhtml +++ b/chrome/content/zotero/searchDialog.xhtml @@ -19,7 +19,7 @@ diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 50673cff48..1fb9d1c59d 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -78,16 +78,7 @@ } // Custom elements - Services.scriptloader.loadSubScript("chrome://global/content/customElements.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/menulistItemTypes.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/itemBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/noteEditor.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/notesBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/tagsBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/relatedBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/attachmentBox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/quickSearchTextbox.js", this); - Services.scriptloader.loadSubScript("chrome://zotero/content/elements/splitMenuButton.js", this); + Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this); Services.scriptloader.loadSubScript("chrome://zotero/content/tabs.js", this); Services.scriptloader.loadSubScript("chrome://zotero/content/zoteroPane.js", this);