From ba53f256d6c7bb3b26d9bec8f6e35d2a399f8cf7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 1 Jul 2015 00:53:20 -0400 Subject: [PATCH] Quick hack to fix "without snapshot" save option in Z4Fx via Standalone (I don't see any obvious reason I can't do this. We should probably clean this up later, not call the endpoint "saveSnapshot", etc. Also, is there a reason it doesn't follow the snapshot pref by default?) --- chrome/content/zotero/xpcom/server_connector.js | 2 +- chrome/content/zotero/zoteroPane.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/server_connector.js b/chrome/content/zotero/xpcom/server_connector.js index 8d4a4a7f81..703a7dceed 100644 --- a/chrome/content/zotero/xpcom/server_connector.js +++ b/chrome/content/zotero/xpcom/server_connector.js @@ -438,7 +438,7 @@ Zotero.Server.Connector.SaveSnapshot.prototype = { } // save snapshot - if(filesEditable) { + if (filesEditable && !data.skipSnapshot) { Zotero.Attachments.importFromDocument(doc, itemID); } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 5fb81aa905..1787c20dca 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3146,7 +3146,8 @@ var ZoteroPane = new function() // In connector, save page via Zotero Standalone var doc = window.content.document; Zotero.Connector.callMethod("saveSnapshot", {"url":doc.location.toString(), - "cookie":doc.cookie, "html":doc.documentElement.innerHTML}, + "cookie":doc.cookie, "html":doc.documentElement.innerHTML, + "skipSnapshot": saveSnapshot === false || (saveSnapshot === true ? false : undefined)}, function(returnValue, status) { _showPageSaveStatus(doc.title); });