Fix "Copy as HTML" Quick Copy setting
This commit is contained in:
parent
8b7f33826e
commit
b3b9cac078
|
@ -38,6 +38,17 @@ Zotero_Preferences.Export = {
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
getQuickCopyTranslators: async function () {
|
||||||
|
var translation = new Zotero.Translate("export");
|
||||||
|
var translators = await translation.getTranslators();
|
||||||
|
translators.sort((a, b) => {
|
||||||
|
var collation = Zotero.getLocaleCollation();
|
||||||
|
return collation.compareString(1, a.label, b.label);
|
||||||
|
});
|
||||||
|
return translators;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Builds the main Quick Copy drop-down from the current global pref
|
* Builds the main Quick Copy drop-down from the current global pref
|
||||||
*/
|
*/
|
||||||
|
@ -47,12 +58,7 @@ Zotero_Preferences.Export = {
|
||||||
format = Zotero.QuickCopy.unserializeSetting(format);
|
format = Zotero.QuickCopy.unserializeSetting(format);
|
||||||
var menulist = document.getElementById("zotero-quickCopy-menu");
|
var menulist = document.getElementById("zotero-quickCopy-menu");
|
||||||
yield Zotero.Styles.init();
|
yield Zotero.Styles.init();
|
||||||
var translation = new Zotero.Translate("export");
|
var translators = yield this.getQuickCopyTranslators();
|
||||||
var translators = yield translation.getTranslators();
|
|
||||||
translators.sort((a, b) => {
|
|
||||||
var collation = Zotero.getLocaleCollation();
|
|
||||||
return collation.compareString(1, a.label, b.label);
|
|
||||||
});
|
|
||||||
this.buildQuickCopyFormatDropDown(
|
this.buildQuickCopyFormatDropDown(
|
||||||
menulist, format.contentType, format, translators
|
menulist, format.contentType, format, translators
|
||||||
);
|
);
|
||||||
|
@ -143,6 +149,13 @@ Zotero_Preferences.Export = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
onCopyAsHTMLChange: async function (checked) {
|
||||||
|
var menulist = document.getElementById('zotero-quickCopy-menu');
|
||||||
|
var translators = await this.getQuickCopyTranslators();
|
||||||
|
this.buildQuickCopyFormatDropDown(menulist, checked ? 'html' : '', null, translators);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
updateQuickCopyUI: function () {
|
updateQuickCopyUI: function () {
|
||||||
var format = document.getElementById('zotero-quickCopy-menu').value;
|
var format = document.getElementById('zotero-quickCopy-menu').value;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<separator orient="vertical" width="15px"/>
|
<separator orient="vertical" width="15px"/>
|
||||||
|
|
||||||
<checkbox id="zotero-quickCopy-copyAsHTML" label="&zotero.preferences.quickCopy.copyAsHTML;"
|
<checkbox id="zotero-quickCopy-copyAsHTML" label="&zotero.preferences.quickCopy.copyAsHTML;"
|
||||||
oncommand="Zotero_Preferences.Export.buildQuickCopyFormatDropDown(document.getElementById('zotero-quickCopy-menu'), this.checked ? 'html' : '');"/>
|
oncommand="Zotero_Preferences.Export.onCopyAsHTMLChange(this.checked)"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user