commit 38531ab172228eb6c0b6fc7ca5fd022e7a1961fa
parent c729dc8a54492c47f96cff1f1c999fb05b950b85
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 12 Aug 2014 21:32:53 -0400
Fix "Copy as HTML" checkbox disabling in Quick Copy site editor window
Diffstat:
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/chrome/content/zotero/preferences/preferences_export.js b/chrome/content/zotero/preferences/preferences_export.js
@@ -47,7 +47,7 @@ Zotero_Preferences.Export = {
var menulist = document.getElementById("zotero-quickCopy-menu");
menulist.setAttribute('preference', "pref-quickCopy-setting");
this.buildQuickCopyFormatDropDown(menulist, Zotero.QuickCopy.getContentType(format), format);
- this.updateQuickCopyHTMLCheckbox();
+ this.updateQuickCopyHTMLCheckbox(document);
if (!Zotero.isStandalone) {
this.refreshQuickCopySiteList();
@@ -91,7 +91,7 @@ Zotero_Preferences.Export = {
var itemNode = document.createElement("menuitem");
itemNode.setAttribute("value", val);
itemNode.setAttribute("label", style.title);
- itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox()');
+ itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document)');
popup.appendChild(itemNode);
if (baseVal == currentFormat) {
@@ -119,7 +119,7 @@ Zotero_Preferences.Export = {
var itemNode = document.createElement("menuitem");
itemNode.setAttribute("value", val);
itemNode.setAttribute("label", translators[i].label);
- itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox()');
+ itemNode.setAttribute("oncommand", 'Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document)');
popup.appendChild(itemNode);
if (val == currentFormat) {
@@ -133,11 +133,11 @@ Zotero_Preferences.Export = {
},
- updateQuickCopyHTMLCheckbox: function () {
- var format = document.getElementById('zotero-quickCopy-menu').value;
+ updateQuickCopyHTMLCheckbox: function (doc) {
+ var format = doc.getElementById('zotero-quickCopy-menu').value;
var mode, contentType;
- var checkbox = document.getElementById('zotero-quickCopy-copyAsHTML');
+ var checkbox = doc.getElementById('zotero-quickCopy-copyAsHTML');
[mode, format] = format.split('=');
[mode, contentType] = mode.split('/');
diff --git a/chrome/content/zotero/preferences/quickCopySiteEditor.xul b/chrome/content/zotero/preferences/quickCopySiteEditor.xul
@@ -39,6 +39,8 @@
<script>
<![CDATA[
+ var Zotero_Preferences = window.opener.Zotero_Preferences;
+
var Zotero_QuickCopySiteEditor = new function () {
this.onAccept = onAccept;
@@ -60,7 +62,7 @@
<menulist id="zotero-quickCopy-menu"/>
<separator class="thin"/>
<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' : ''
)"/>
</vbox>
@@ -69,12 +71,12 @@
<![CDATA[
var io = window.arguments[0];
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'),
Zotero.QuickCopy.getContentType(io.format),
io.format
);
- window.opener.Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox();
+ Zotero_Preferences.Export.updateQuickCopyHTMLCheckbox(document);
]]>
</script>
</dialog>