Merge pull request #814 from aurimasv/citation-update-debug

Debugging code for checking manually modified citations
This commit is contained in:
Simon Kornblith 2015-07-29 00:03:50 -04:00
commit b9cdf3f6d3

View file

@ -1584,6 +1584,10 @@ Zotero.Integration.Fields.prototype._updateDocument = function(forceCitations, f
var plainCitation = field.getText();
if(plainCitation !== citation.properties.plainCitation) {
// Citation manually modified; ask user if they want to save changes
Zotero.debug("[_updateDocument] Attempting to update manually modified citation.\n"
+ "Original: " + citation.properties.plainCitation + "\n"
+ "Current: " + plainCitation
);
field.select();
var result = this._doc.displayAlert(
Zotero.getString("integration.citationChanged")+"\n\n"+Zotero.getString("integration.citationChanged.description"),
@ -1726,6 +1730,11 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field) {
|| (citation.properties.plainCitation
&& field.getText() !== citation.properties.plainCitation)) {
this._doc.activate();
Zotero.debug("[addEditCitation] Attempting to update manually modified citation.\n"
+ "citation.properties.dontUpdate: " + citation.properties.dontUpdate + "\n"
+ "Original: " + citation.properties.plainCitation + "\n"
+ "Current: " + field.getText()
);
if(!this._doc.displayAlert(Zotero.getString("integration.citationChanged.edit"),
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_WARNING,
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK_CANCEL)) {