Fix "Copy as HTML" checkbox disabling in Quick Copy site editor window
This commit is contained in:
parent
c729dc8a54
commit
38531ab172
|
@ -47,7 +47,7 @@ Zotero_Preferences.Export = {
|
||||||
var menulist = document.getElementById("zotero-quickCopy-menu");
|
var menulist = document.getElementById("zotero-quickCopy-menu");
|
||||||
menulist.setAttribute('preference', "pref-quickCopy-setting");
|
menulist.setAttribute('preference', "pref-quickCopy-setting");
|
||||||
this.buildQuickCopyFormatDropDown(menulist, Zotero.QuickCopy.getContentType(format), format);
|
this.buildQuickCopyFormatDropDown(menulist, Zotero.QuickCopy.getContentType(format), format);
|
||||||
this.updateQuickCopyHTMLCheckbox();
|
this.updateQuickCopyHTMLCheckbox(document);
|
||||||
|
|
||||||
if (!Zotero.isStandalone) {
|
if (!Zotero.isStandalone) {
|
||||||
this.refreshQuickCopySiteList();
|
this.refreshQuickCopySiteList();
|
||||||
|
@ -91,7 +91,7 @@ Zotero_Preferences.Export = {
|
||||||
var itemNode = document.createElement("menuitem");
|
var itemNode = document.createElement("menuitem");
|
||||||
itemNode.setAttribute("value", val);
|
itemNode.setAttribute("value", val);
|
||||||
itemNode.setAttribute("label", style.title);
|
itemNode.setAttribute("label", style.title);
|
||||||
itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox()');
|
itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document)');
|
||||||
popup.appendChild(itemNode);
|
popup.appendChild(itemNode);
|
||||||
|
|
||||||
if (baseVal == currentFormat) {
|
if (baseVal == currentFormat) {
|
||||||
|
@ -119,7 +119,7 @@ Zotero_Preferences.Export = {
|
||||||
var itemNode = document.createElement("menuitem");
|
var itemNode = document.createElement("menuitem");
|
||||||
itemNode.setAttribute("value", val);
|
itemNode.setAttribute("value", val);
|
||||||
itemNode.setAttribute("label", translators[i].label);
|
itemNode.setAttribute("label", translators[i].label);
|
||||||
itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox()');
|
itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document)');
|
||||||
popup.appendChild(itemNode);
|
popup.appendChild(itemNode);
|
||||||
|
|
||||||
if (val == currentFormat) {
|
if (val == currentFormat) {
|
||||||
|
@ -133,11 +133,11 @@ Zotero_Preferences.Export = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
updateQuickCopyHTMLCheckbox: function () {
|
updateQuickCopyHTMLCheckbox: function (doc) {
|
||||||
var format = document.getElementById('zotero-quickCopy-menu').value;
|
var format = doc.getElementById('zotero-quickCopy-menu').value;
|
||||||
var mode, contentType;
|
var mode, contentType;
|
||||||
|
|
||||||
var checkbox = document.getElementById('zotero-quickCopy-copyAsHTML');
|
var checkbox = doc.getElementById('zotero-quickCopy-copyAsHTML');
|
||||||
[mode, format] = format.split('=');
|
[mode, format] = format.split('=');
|
||||||
[mode, contentType] = mode.split('/');
|
[mode, contentType] = mode.split('/');
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
var Zotero_Preferences = window.opener.Zotero_Preferences;
|
||||||
|
|
||||||
var Zotero_QuickCopySiteEditor = new function () {
|
var Zotero_QuickCopySiteEditor = new function () {
|
||||||
this.onAccept = onAccept;
|
this.onAccept = onAccept;
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@
|
||||||
<menulist id="zotero-quickCopy-menu"/>
|
<menulist id="zotero-quickCopy-menu"/>
|
||||||
<separator class="thin"/>
|
<separator class="thin"/>
|
||||||
<checkbox id="zotero-quickCopy-copyAsHTML" label="&zotero.preferences.quickCopy.copyAsHTML;"
|
<checkbox id="zotero-quickCopy-copyAsHTML" label="&zotero.preferences.quickCopy.copyAsHTML;"
|
||||||
oncommand="window.opener.Zotero_Preferences.Export.buildQuickCopyFormatDropDown(
|
oncommand="Zotero_Preferences.Export.buildQuickCopyFormatDropDown(
|
||||||
document.getElementById('zotero-quickCopy-menu'), this.checked ? 'html' : ''
|
document.getElementById('zotero-quickCopy-menu'), this.checked ? 'html' : ''
|
||||||
)"/>
|
)"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
@ -69,12 +71,12 @@
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var io = window.arguments[0];
|
var io = window.arguments[0];
|
||||||
document.getElementById('zotero-quickCopy-domain').value = io.domain ? io.domain : '';
|
document.getElementById('zotero-quickCopy-domain').value = io.domain ? io.domain : '';
|
||||||
window.opener.Zotero_Preferences.Export.buildQuickCopyFormatDropDown(
|
Zotero_Preferences.Export.buildQuickCopyFormatDropDown(
|
||||||
document.getElementById('zotero-quickCopy-menu'),
|
document.getElementById('zotero-quickCopy-menu'),
|
||||||
Zotero.QuickCopy.getContentType(io.format),
|
Zotero.QuickCopy.getContentType(io.format),
|
||||||
io.format
|
io.format
|
||||||
);
|
);
|
||||||
window.opener.Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox();
|
Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document);
|
||||||
]]>
|
]]>
|
||||||
</script>
|
</script>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user