From 784f877fbd10183c9211bd4c2bfd7e387cc2b0d3 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 8 Jan 2024 11:30:05 -0500 Subject: [PATCH] Add automatic

to prefpanes --- .../content/zotero/preferences/preferences.js | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 672afdc785..27fc556d4e 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -203,15 +203,15 @@ var Zotero_Preferences = { } else { let labelElem = document.createXULElement('label'); - if (rawLabel) { - labelElem.value = rawLabel; - } - else if (Zotero.Intl.strings.hasOwnProperty(label)) { - labelElem.value = Zotero.Intl.strings[label]; - } - else { - labelElem.value = Zotero.getString(label); + if (!rawLabel) { + if (Zotero.Intl.strings.hasOwnProperty(label)) { + rawLabel = Zotero.Intl.strings[label]; + } + else { + rawLabel = Zotero.getString(label); + } } + labelElem.value = rawLabel; listItem.append(labelElem); } @@ -223,6 +223,7 @@ var Zotero_Preferences = { this.panes.set(id, { ...options, + rawLabel, loaded: false, container, }); @@ -272,6 +273,10 @@ var Zotero_Preferences = { contentFragment = document.importNode(contentFragment, true); this._initImportedNodesPreInsert(contentFragment); + + let heading = document.createElement('h1'); + heading.textContent = pane.rawLabel; + pane.container.append(heading); pane.container.append(contentFragment); await document.l10n.ready;