From 088027d640ceabcb174030897f773fe1bef2c4e8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 4 Oct 2006 22:59:07 +0000 Subject: [PATCH] Added automaticSnapshots pref, and changed Create New Item From Current Page button to obey pref At least some scrapers (NYT and WashPo, for sure) should be updated to follow this pref Addresses #327, Scrapers should either take snapshots or use URL field --- chrome/content/zotero/overlay.js | 8 +++++++- chrome/content/zotero/preferences.js | 6 ++++++ chrome/content/zotero/preferences.xul | 3 +++ chrome/locale/en-US/zotero/preferences.dtd | 1 + defaults/preferences/zotero.js | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index a03a1f674..f992fb74e 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -743,7 +743,13 @@ var ZoteroPane = new function() accessDate: "CURRENT_TIMESTAMP" } - newItem(Zotero.ItemTypes.getID('webpage'), data); + var item = newItem(Zotero.ItemTypes.getID('webpage'), data); + + // Automatically save snapshot if pref set + if (item.getID() && Zotero.Prefs.get('automaticSnapshots')) + { + addAttachmentFromPage(false, item.getID()); + } } diff --git a/chrome/content/zotero/preferences.js b/chrome/content/zotero/preferences.js index d894a40db..805149877 100644 --- a/chrome/content/zotero/preferences.js +++ b/chrome/content/zotero/preferences.js @@ -23,6 +23,7 @@ var autoUpdateBox; var positionMenu; var parseEndnoteBox; +var automaticSnapshots; var openURLMenu; var openURLResolvers; var openURLServerField; @@ -53,6 +54,9 @@ function init() parseEndnoteBox = document.getElementById('parseEndnoteBox'); parseEndnoteBox.checked = Zotero.Prefs.get('parseEndNoteMIMETypes'); + automaticSnapshots = document.getElementById('automaticSnapshots'); + automaticSnapshots.checked = Zotero.Prefs.get('automaticSnapshots'); + openURLServerField = document.getElementById('openURLServerField'); openURLServerField.value = Zotero.Prefs.get('openURL.resolver'); openURLVersionMenu = document.getElementById('openURLVersionMenu'); @@ -80,6 +84,8 @@ function accept() Zotero.Ingester.MIMEHandler.init(); } + Zotero.Prefs.set('automaticSnapshots', automaticSnapshots.checked); + Zotero.Prefs.set('openURL.resolver', openURLServerField.value); Zotero.Prefs.set('openURL.version', openURLVersionMenu.value); } diff --git a/chrome/content/zotero/preferences.xul b/chrome/content/zotero/preferences.xul index f91af74a3..71ec5fd19 100644 --- a/chrome/content/zotero/preferences.xul +++ b/chrome/content/zotero/preferences.xul @@ -24,6 +24,7 @@ + @@ -48,6 +49,8 @@ + + diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd index 57be02af0..7744709a7 100644 --- a/chrome/locale/en-US/zotero/preferences.dtd +++ b/chrome/locale/en-US/zotero/preferences.dtd @@ -6,6 +6,7 @@ + \ No newline at end of file diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index c74fccc15..ffbde3ed2 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -7,5 +7,6 @@ pref("extensions.zotero.zoteroPaneOnTop",false); pref("extensions.zotero.openURL.resolver","http://athene.gmu.edu:8888/lfp/LinkFinderPlus/Display"); pref("extensions.zotero.openURL.version","0.1"); pref("extensions.zotero.parseEndNoteMIMETypes",true); +pref("extensions.zotero.automaticSnapshots",true); pref("extensions.zotero.downloadAssociatedFiles",false); pref("extensions.zotero.reportTranslationFailure",true); \ No newline at end of file