diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js index ff94cfc7b3..0ac77fb511 100644 --- a/chrome/content/zotero/integration/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -23,6 +23,8 @@ ***** END LICENSE BLOCK ***** */ +Components.utils.import("resource://gre/modules/Services.jsm"); + var Zotero_Citation_Dialog = new function () { // Array value [0] is property name. // Array value [1] is default value of property. @@ -600,6 +602,28 @@ var Zotero_Citation_Dialog = new function () { io.citation.properties.custom = citation; } + if (io.citation.citationItems.length) { + for (let item of io.citation.citationItems) { + if (Zotero.Retractions.isRetracted({id: parseInt(item.id)})) { + var ps = Services.prompt; + var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); + var result = ps.confirmEx(null, + Zotero.getString('general.warning'), + Zotero.getString('retraction.citeWarning.text1') + '\n\n' + + Zotero.getString('retraction.citeWarning.text2'), + buttonFlags, + Zotero.getString('general.continue'), + null, + null, null, {}); + if (result != 0) { + return false; + } + break; + } + } + } + io.accept(); _accepted = true; return true; diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index c9bf6a5a03..2cab51d52b 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -716,11 +716,29 @@ var Zotero_QuickFormat = new function () { if(!referenceBox.hasChildNodes() || !referenceBox.selectedItem) return false; var citationItem = {"id":referenceBox.selectedItem.getAttribute("zotero-item")}; - if(typeof citationItem.id === "string" && citationItem.id.indexOf("/") !== -1) { + if (typeof citationItem.id === "string" && citationItem.id.indexOf("/") !== -1) { var item = Zotero.Cite.getItem(citationItem.id); citationItem.uris = item.cslURIs; citationItem.itemData = item.cslItemData; } + else if (Zotero.Retractions.isRetracted({id: parseInt(citationItem.id)})) { + referencePanel.hidden = true; + var ps = Services.prompt; + var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL); + var result = ps.confirmEx(null, + Zotero.getString('general.warning'), + Zotero.getString('retraction.citeWarning.text1') + '\n\n' + + Zotero.getString('retraction.citeWarning.text2'), + buttonFlags, + Zotero.getString('general.continue'), + null, + null, null, {}); + referencePanel.hidden = false; + if (result != 0) { + return false; + } + } _updateLocator(_getEditorContent()); if(currentLocator) {