From c4876fd5aefb42d752685e5dfab166dc204fefa3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 21 Oct 2022 05:22:37 -0400 Subject: [PATCH] Adjust layout of Quick Copy note format options Also: - Hide format options until translators are loaded (since otherwise the checkboxes don't have labels and the layout is messed up) - Remove unnecessary "zotero-" prefix from the new elements --- .../zotero/preferences/preferences_export.jsx | 14 +++--- .../zotero/preferences/preferences_export.xul | 43 ++++++++++++------- chrome/skin/default/zotero/preferences.css | 6 +++ 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_export.jsx b/chrome/content/zotero/preferences/preferences_export.jsx index 8b98c35009..a6ac8cb581 100644 --- a/chrome/content/zotero/preferences/preferences_export.jsx +++ b/chrome/content/zotero/preferences/preferences_export.jsx @@ -89,6 +89,8 @@ Zotero_Preferences.Export = { * Builds the note Quick Copy drop-down from the current global pref */ populateNoteQuickCopyList: async function () { + document.getElementById('noteQuickCopy-format-options').removeAttribute('hidden'); + // Initialize default format drop-down var format = Zotero.Prefs.get("export.noteQuickCopy.setting"); format = Zotero.QuickCopy.unserializeSetting(format); @@ -202,10 +204,10 @@ Zotero_Preferences.Export = { var format = document.getElementById('zotero-noteQuickCopy-menu').value; format = JSON.parse(format); - var markdownOptions = document.getElementById('zotero-noteQuickCopy-markdown-options'); - var htmlOptions = document.getElementById('zotero-noteQuickCopy-html-options'); - var markdownIncludeAppLinks = document.getElementById("zotero-noteQuickCopy-markdown-includeAppLinks"); - var htmlIncludeAppLinks = document.getElementById("zotero-noteQuickCopy-html-includeAppLinks"); + var markdownOptions = document.getElementById('noteQuickCopy-markdown-options'); + var htmlOptions = document.getElementById('noteQuickCopy-html-options'); + var markdownIncludeAppLinks = document.getElementById("noteQuickCopy-markdown-includeAppLinks"); + var htmlIncludeAppLinks = document.getElementById("noteQuickCopy-html-includeAppLinks"); markdownIncludeAppLinks.label = Zotero.getString('exportOptions.includeAppLinks', Zotero.appName); htmlIncludeAppLinks.label = Zotero.getString('exportOptions.includeAppLinks', Zotero.appName); @@ -229,8 +231,8 @@ Zotero_Preferences.Export = { onUpdateNoteExportOptions() { var menulist = document.getElementById("zotero-noteQuickCopy-menu"); - var markdownIncludeAppLinks = document.getElementById("zotero-noteQuickCopy-markdown-includeAppLinks"); - var htmlIncludeAppLinks = document.getElementById("zotero-noteQuickCopy-html-includeAppLinks"); + var markdownIncludeAppLinks = document.getElementById("noteQuickCopy-markdown-includeAppLinks"); + var htmlIncludeAppLinks = document.getElementById("noteQuickCopy-html-includeAppLinks"); for (let i = 0; i < menulist.itemCount; i++) { let item = menulist.getItemAtIndex(i); diff --git a/chrome/content/zotero/preferences/preferences_export.xul b/chrome/content/zotero/preferences/preferences_export.xul index 34ad9223a9..4c378d9eb2 100644 --- a/chrome/content/zotero/preferences/preferences_export.xul +++ b/chrome/content/zotero/preferences/preferences_export.xul @@ -72,23 +72,34 @@