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
This commit is contained in:
Dan Stillman 2022-10-21 05:22:37 -04:00
parent a95a2937c1
commit c51cb88c97
3 changed files with 41 additions and 22 deletions

View file

@ -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);

View file

@ -54,23 +54,34 @@
<label value="&zotero.preferences.quickCopy.noteFormat;" control="zotero-noteQuickCopy-menu"/>
<menulist id="zotero-noteQuickCopy-menu" label="&zotero.general.loading;" native="true"/>
<vbox id="zotero-noteQuickCopy-markdown-options">
<label value="&zotero.preferences.quickCopy.markdown;"/>
<vbox style="margin-left: 2em">
<checkbox id="zotero-noteQuickCopy-markdown-includeAppLinks"
label="Include App Links"
oncommand="Zotero_Preferences.Export.onUpdateNoteExportOptions()"/>
</vbox>
</vbox>
<table id="noteQuickCopy-format-options"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
hidden="hidden">
<tbody id="noteQuickCopy-markdown-options">
<tr>
<th>
<xul:label value="&zotero.preferences.quickCopy.markdown;"/>
</th>
<td>
<xul:checkbox id="noteQuickCopy-markdown-includeAppLinks"
oncommand="Zotero_Preferences.Export.onUpdateNoteExportOptions()"/>
</td>
</tr>
</tbody>
<vbox id="zotero-noteQuickCopy-html-options">
<label value="&zotero.preferences.quickCopy.html;"/>
<vbox style="margin-left: 2em">
<checkbox id="zotero-noteQuickCopy-html-includeAppLinks"
label="Include App Links"
oncommand="Zotero_Preferences.Export.onUpdateNoteExportOptions()"/>
</vbox>
</vbox>
<tbody id="noteQuickCopy-html-options">
<tr>
<th>
<xul:label value="&zotero.preferences.quickCopy.html;"/>
</th>
<td>
<xul:checkbox id="noteQuickCopy-html-includeAppLinks"
oncommand="Zotero_Preferences.Export.onUpdateNoteExportOptions()"/>
</td>
</tr>
</tbody>
</table>
<separator/>

View file

@ -414,6 +414,12 @@ description label[class=zotero-text-link], label[class=zotero-text-link]
min-height: 1.5em; /* Fix collapse on Windows */
}
#noteQuickCopy-format-options th {
font-weight: normal;
text-align: right;
max-width: 3.6em;
}
/*
* Cite pane
*/