From c51cb88c97b156c179dfbbc834bf4de153671c4e 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 +++--- .../preferences/preferences_export.xhtml | 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 df459fcf8e..066be61030 100644 --- a/chrome/content/zotero/preferences/preferences_export.jsx +++ b/chrome/content/zotero/preferences/preferences_export.jsx @@ -83,6 +83,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); @@ -196,10 +198,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); @@ -223,8 +225,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.xhtml b/chrome/content/zotero/preferences/preferences_export.xhtml index 40a87b243b..b7dd0e9589 100644 --- a/chrome/content/zotero/preferences/preferences_export.xhtml +++ b/chrome/content/zotero/preferences/preferences_export.xhtml @@ -54,23 +54,34 @@