From 9a96c5411860ebc687b054aaf98e2ee4881ca776 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 5 Oct 2006 09:44:41 +0000 Subject: [PATCH] Addresses #327, Scrapers should either take snapshots or use URL field Use automaticSnapshots pref (which defaults to on and is changeable in the prefs window) rather than downloadAssociatedFiles (which defaults to off and is only settable through about:config at the moment) for now in translate.js downloadAssociatedFiles should eventually be used for PDFs and other large files, whereas automaticSnapshots will be for HTML and the like -- in the meantime, I think it's OK for scrapers to just follow the visible pref for both, since otherwise they'd be totally confused when the NIFP button took a snapshot and the scrapers didn't Simon, if there's any problem I'm not aware of with switching this for now (other than people getting some large PDFs on JStor), let me know. --- chrome/content/zotero/xpcom/translate.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 040f72f635..c421a04747 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -954,7 +954,11 @@ Zotero.Translate.prototype._generateErrorString = function(error) { errorString += "\nurl => "+this.path + "\nextensions.zotero.cacheTranslatorData => "+Zotero.Prefs.get("cacheTranslatorData") - + "\nextensions.zotero.downloadAssociatedFiles => "+Zotero.Prefs.get("downloadAssociatedFiles"); + // TODO: Currently using automaticSnapshots pref for everything + // Eventually downloadAssociatedFiles may be a separate pref + // for PDFs and other large files + //+ "\nextensions.zotero.downloadAssociatedFiles => "+Zotero.Prefs.get("downloadAssociatedFiles"); + + "\nextensions.zotero.automaticSnapshots => "+Zotero.Prefs.get("automaticSnapshots"); return errorString.substr(1); } @@ -1360,7 +1364,9 @@ Zotero.Translate.prototype._runHandler = function(type, argument) { * does the actual web translation */ Zotero.Translate.prototype._web = function() { - this._downloadAssociatedFiles = Zotero.Prefs.get("downloadAssociatedFiles"); + // TODO: Currently using automaticSnapshots for everything + //this._downloadAssociatedFiles = Zotero.Prefs.get("downloadAssociatedFiles"); + this._downloadAssociatedFiles = Zotero.Prefs.get("automaticSnapshots"); try { this._sandbox.doWeb(this.document, this.location);