diff --git a/chrome/content/zotero/hardConfirmationDialog.js b/chrome/content/zotero/hardConfirmationDialog.js index 44809c77b6..758e0c85c3 100644 --- a/chrome/content/zotero/hardConfirmationDialog.js +++ b/chrome/content/zotero/hardConfirmationDialog.js @@ -25,10 +25,14 @@ Zotero.HardConfirmationDialog = { init: function() { + document.addEventListener('dialogaccept', () => Zotero.HardConfirmationDialog.onAccept()); + document.addEventListener('dialogextra1', () => Zotero.HardConfirmationDialog.onExtra1()); + document.addEventListener('dialogextra2', () => Zotero.HardConfirmationDialog.onExtra2()); + this.io = window.arguments[0]; - Zotero.setFontSize(document.getElementById('zotero-hardConfirmationDialog')); - + Zotero.setFontSize(document.documentElement); + var dialog = document.getElementById('commonDialog'); var vbox = document.getElementById('infoContainer'); var sep = vbox.firstChild; @@ -56,25 +60,25 @@ Zotero.HardConfirmationDialog = { } if (this.io.acceptLabel) { - document.documentElement.getButton('accept').label = this.io.acceptLabel + dialog.getButton('accept').label = this.io.acceptLabel } if (this.io.extra1Label) { - document.documentElement.buttons = document.documentElement.buttons + ',extra1'; - document.documentElement.getButton('extra1').label = this.io.extra1Label + dialog.buttons = dialog.buttons + ',extra1'; + dialog.getButton('extra1').label = this.io.extra1Label } if (this.io.extra2Label) { - document.documentElement.buttons = document.documentElement.buttons + ',extra2'; - document.documentElement.getButton('extra2').label = this.io.extra2Label + dialog.buttons = dialog.buttons + ',extra2'; + dialog.getButton('extra2').label = this.io.extra2Label } }, onCheckbox: function(event) { - document.documentElement.getButton('accept').disabled = + document.getElementById('commonDialog').getButton('accept').disabled = !document.getElementById('zotero-hardConfirmationDialog-checkbox').checked; }, onKeyUp: function(event) { - document.documentElement.getButton('accept').disabled = + document.getElementById('commonDialog').getButton('accept').disabled = document.getElementById('zotero-hardConfirmationDialog-textbox').value != this.io.confirmationText; }, @@ -84,11 +88,11 @@ Zotero.HardConfirmationDialog = { onExtra1: function() { this.io.extra1 = true; - document.documentElement.cancelDialog(); + document.getElementById('commonDialog').cancelDialog(); }, onExtra2: function() { this.io.extra2 = true; - document.documentElement.cancelDialog(); + document.getElementById('commonDialog').cancelDialog(); } }; diff --git a/chrome/content/zotero/hardConfirmationDialog.xul b/chrome/content/zotero/hardConfirmationDialog.xhtml similarity index 59% rename from chrome/content/zotero/hardConfirmationDialog.xul rename to chrome/content/zotero/hardConfirmationDialog.xhtml index 771f1e64a6..4490e11c38 100644 --- a/chrome/content/zotero/hardConfirmationDialog.xul +++ b/chrome/content/zotero/hardConfirmationDialog.xhtml @@ -32,36 +32,29 @@ %zoteroDTD; ]> - + +