Shift key toggles snapshot pref when clicking "Create New Item from Current Page"

This commit is contained in:
Dan Stillman 2009-05-22 02:28:07 +00:00
parent f93f7384a6
commit 4228132af2
2 changed files with 7 additions and 7 deletions

View file

@ -2243,15 +2243,15 @@ var ZoteroPane = new function()
} }
this.addItemFromPage = function (itemType, row) { this.addItemFromPage = function (itemType, saveSnapshot, row) {
return this.addItemFromDocument(window.content.document, itemType, row); return this.addItemFromDocument(window.content.document, itemType, saveSnapshot, row);
} }
/** /**
* @param {Document} doc * @param {Document} doc
* @param {String|Integer} [itemType='webpage'] Item type id or name * @param {String|Integer} [itemType='webpage'] Item type id or name
* @param {Boolean} [saveSnapshot] Force saving of a snapshot, * @param {Boolean} [saveSnapshot] Force saving or non-saving of a snapshot,
* regardless of automaticSnapshots pref * regardless of automaticSnapshots pref
*/ */
this.addItemFromDocument = function (doc, itemType, saveSnapshot, row) { this.addItemFromDocument = function (doc, itemType, saveSnapshot, row) {
@ -2364,13 +2364,13 @@ var ZoteroPane = new function()
} }
this.addItemFromURL = function (url, itemType, row) { this.addItemFromURL = function (url, itemType, saveSnapshot, row) {
if (url == window.content.document.location.href) { if (url == window.content.document.location.href) {
return this.addItemFromPage(itemType, row); return this.addItemFromPage(itemType, saveSnapshot, row);
} }
var processor = function (doc) { var processor = function (doc) {
ZoteroPane.addItemFromDocument(doc, itemType, null, row); ZoteroPane.addItemFromDocument(doc, itemType, saveSnapshot, row);
}; };
var done = function () {} var done = function () {}

View file

@ -193,7 +193,7 @@
</menu> </menu>
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
<toolbarbutton id="zotero-tb-item-from-page" tooltiptext="&zotero.toolbar.newItemFromPage.label;" oncommand="ZoteroPane.addItemFromPage('temporaryPDFHack')"/> <toolbarbutton id="zotero-tb-item-from-page" tooltiptext="&zotero.toolbar.newItemFromPage.label;" oncommand="ZoteroPane.addItemFromPage('temporaryPDFHack', event.shiftKey ? !Zotero.Prefs.get('automaticSnapshots') : null)"/>
<toolbarbutton id="zotero-tb-lookup" tooltiptext="&zotero.toolbar.lookup.label;" oncommand="ZoteroPane.openLookupWindow()"/> <toolbarbutton id="zotero-tb-lookup" tooltiptext="&zotero.toolbar.lookup.label;" oncommand="ZoteroPane.openLookupWindow()"/>
<!-- <!--
<toolbarseparator/> <toolbarseparator/>