commit 088027d640ceabcb174030897f773fe1bef2c4e8
parent 026b37169a555208a8ee7b25e3b9af997aef2538
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 4 Oct 2006 22:59:07 +0000
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
Diffstat:
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git 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
@@ -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
@@ -24,6 +24,7 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<!-- TODO: change to prefWindow? -->
<dialog id="winMain" title="&zotero.preferences.title;" style="min-width:400px;"
onload="init();" ondialogaccept="accept()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -48,6 +49,8 @@
<checkbox id="parseEndnoteBox" label="&zotero.preferences.parseEndnote.label;"/>
+<checkbox id="automaticSnapshots" label="&zotero.preferences.automaticSnapshots.label;"/>
+
<groupbox>
<caption label="&zotero.preferences.openurl.caption;"/>
diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd
@@ -6,6 +6,7 @@
<!ENTITY zotero.preferences.position.below "below">
<!ENTITY zotero.preferences.position.browser "browser content">
<!ENTITY zotero.preferences.parseEndnote.label "Use Zotero for downloaded EndNote files">
+<!ENTITY zotero.preferences.automaticSnapshots.label "Automatically take snapshots when creating items from web pages">
<!ENTITY zotero.preferences.openurl.caption "OpenURL">
<!ENTITY zotero.preferences.openurl.server "Resolver:">
<!ENTITY zotero.preferences.openurl.version "Version:">
\ No newline at end of file
diff --git 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