From 5e41b3ab4d57802c96abaf24522bd1bb4cb51ac4 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 5 Jun 2023 10:52:04 -0400 Subject: [PATCH] Place word processor plugin installers under heading and fix spacing Fixes #3147 --- .../zotero/preferences/preferences_cite.xhtml | 2 ++ chrome/skin/default/zotero/preferences.css | 9 +++++++++ resource/word-processor-plugin-installer.js | 16 +++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_cite.xhtml b/chrome/content/zotero/preferences/preferences_cite.xhtml index b4f1e4662a..aa0f9dac68 100644 --- a/chrome/content/zotero/preferences/preferences_cite.xhtml +++ b/chrome/content/zotero/preferences/preferences_cite.xhtml @@ -70,6 +70,8 @@ &zotero.preferences.cite.wordProcessors; + + diff --git a/chrome/skin/default/zotero/preferences.css b/chrome/skin/default/zotero/preferences.css index 327fb72582..97eebf0209 100644 --- a/chrome/skin/default/zotero/preferences.css +++ b/chrome/skin/default/zotero/preferences.css @@ -489,6 +489,15 @@ button { margin-top: 10px; } +#wordProcessorInstallers { + margin-block: 0.5em; +} + +#wordProcessorInstallers > groupbox > label > h2 { + /* Override spacing added between groupboxes */ + margin-top: 0.5em !important; +} + #styleManager { height: 250px; diff --git a/resource/word-processor-plugin-installer.js b/resource/word-processor-plugin-installer.js index e894d8e033..d65d9e9f24 100644 --- a/resource/word-processor-plugin-installer.js +++ b/resource/word-processor-plugin-installer.js @@ -170,9 +170,11 @@ ZoteroPluginInstaller.prototype = { groupbox = document.createXULElement("groupbox"); groupbox.id = this._addon.EXTENSION_DIR; - var caption = document.createXULElement("caption"); - caption.setAttribute("label", this._addon.APP); - groupbox.appendChild(caption); + var label = document.createXULElement("label"); + var h2 = document.createElement('h2'); + h2.textContent = this._addon.APP; + label.appendChild(h2); + groupbox.appendChild(label); var description = document.createXULElement("description"); description.style.width = "45em"; @@ -202,12 +204,12 @@ ZoteroPluginInstaller.prototype = { hbox.appendChild(button); groupbox.appendChild(hbox); - var tabpanel = document.getElementById("wordProcessors"), + var container = document.getElementById("wordProcessorInstallers"), old = document.getElementById(this._addon.EXTENSION_DIR); if(old) { - tabpanel.replaceChild(groupbox, old); + container.replaceChild(groupbox, old); } else { - tabpanel.insertBefore(groupbox, tabpanel.firstChild); + container.appendChild(groupbox); } }, @@ -245,4 +247,4 @@ ZoteroPluginInstaller.prototype = { }, 500); }, 100); }, -}; \ No newline at end of file +};