Addresses #1805, Add "Create Item from Current Page" contextual menu item and/or browser button
Adds "Create New Item from Current Page" context menu option. We can add a toolbar button too if we can come up with an icon for it.
This commit is contained in:
parent
ffd671ce7b
commit
ec6f894e1a
|
@ -2677,7 +2677,6 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
var menuitem = document.getElementById("zotero-context-add-to-current-note");
|
var menuitem = document.getElementById("zotero-context-add-to-current-note");
|
||||||
var showing = false;
|
|
||||||
if (menuitem){
|
if (menuitem){
|
||||||
var items = ZoteroPane_Local.getSelectedItems();
|
var items = ZoteroPane_Local.getSelectedItems();
|
||||||
if (ZoteroPane_Local.itemsView.selection && ZoteroPane_Local.itemsView.selection.count==1
|
if (ZoteroPane_Local.itemsView.selection && ZoteroPane_Local.itemsView.selection.count==1
|
||||||
|
@ -2685,7 +2684,6 @@ var ZoteroPane = new function()
|
||||||
&& window.gContextMenu.isTextSelected)
|
&& window.gContextMenu.isTextSelected)
|
||||||
{
|
{
|
||||||
menuitem.hidden = false;
|
menuitem.hidden = false;
|
||||||
showing = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2698,7 +2696,6 @@ var ZoteroPane = new function()
|
||||||
if (window.gContextMenu.isTextSelected)
|
if (window.gContextMenu.isTextSelected)
|
||||||
{
|
{
|
||||||
menuitem.hidden = false;
|
menuitem.hidden = false;
|
||||||
showing = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2710,7 +2707,6 @@ var ZoteroPane = new function()
|
||||||
if (menuitem) {
|
if (menuitem) {
|
||||||
if (window.gContextMenu.onLink) {
|
if (window.gContextMenu.onLink) {
|
||||||
menuitem.hidden = false;
|
menuitem.hidden = false;
|
||||||
showing = true;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
menuitem.hidden = true;
|
menuitem.hidden = true;
|
||||||
|
@ -2723,7 +2719,6 @@ var ZoteroPane = new function()
|
||||||
// they can use the Firefox option to view and then import from there
|
// they can use the Firefox option to view and then import from there
|
||||||
if (window.gContextMenu.onImage) {
|
if (window.gContextMenu.onImage) {
|
||||||
menuitem.hidden = false;
|
menuitem.hidden = false;
|
||||||
showing = true;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
menuitem.hidden = true;
|
menuitem.hidden = true;
|
||||||
|
@ -2732,7 +2727,6 @@ var ZoteroPane = new function()
|
||||||
|
|
||||||
// If Zotero is locked or library is read-only, disable menu items
|
// If Zotero is locked or library is read-only, disable menu items
|
||||||
var menu = document.getElementById('zotero-content-area-context-menu');
|
var menu = document.getElementById('zotero-content-area-context-menu');
|
||||||
menu.hidden = !showing;
|
|
||||||
var disabled = Zotero.locked;
|
var disabled = Zotero.locked;
|
||||||
if (!disabled && self.collectionsView.selection && self.collectionsView.selection.count) {
|
if (!disabled && self.collectionsView.selection && self.collectionsView.selection.count) {
|
||||||
var itemGroup = self.collectionsView._getItemAtRow(self.collectionsView.selection.currentIndex);
|
var itemGroup = self.collectionsView._getItemAtRow(self.collectionsView.selection.currentIndex);
|
||||||
|
|
|
@ -58,11 +58,15 @@
|
||||||
<command id="cmd_zotero_newCollection" oncommand="ZoteroPane_Local.newCollection()"/>
|
<command id="cmd_zotero_newCollection" oncommand="ZoteroPane_Local.newCollection()"/>
|
||||||
<command id="cmd_zotero_newSavedSearch" oncommand="ZoteroPane_Local.newSearch()"/>
|
<command id="cmd_zotero_newSavedSearch" oncommand="ZoteroPane_Local.newSearch()"/>
|
||||||
<command id="cmd_zotero_newStandaloneNote" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>
|
<command id="cmd_zotero_newStandaloneNote" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>
|
||||||
|
<command id="cmd_zotero_newItemFromCurrentPage" oncommand="ZoteroPane_Local.addItemFromPage('temporaryPDFHack', event.shiftKey ? !Zotero.Prefs.get('automaticSnapshots') : null)"/>
|
||||||
</commandset>
|
</commandset>
|
||||||
|
|
||||||
<popup id="contentAreaContextMenu">
|
<popup id="contentAreaContextMenu">
|
||||||
<menu id="zotero-content-area-context-menu" label="Zotero">
|
<menu id="zotero-content-area-context-menu" label="Zotero">
|
||||||
<menupopup>
|
<menupopup>
|
||||||
|
<menuitem id="zotero-context-item-from-page" class="menu-iconic"
|
||||||
|
label="&zotero.toolbar.newItemFromPage.label;"
|
||||||
|
command="cmd_zotero_newItemFromCurrentPage"/>
|
||||||
<menuitem id="zotero-context-add-to-current-note" class="menu-iconic"
|
<menuitem id="zotero-context-add-to-current-note" class="menu-iconic"
|
||||||
label="&zotero.contextMenu.addTextToCurrentNote;" hidden="true"
|
label="&zotero.contextMenu.addTextToCurrentNote;" hidden="true"
|
||||||
oncommand="var str = event.currentTarget.ownerDocument.popupNode.ownerDocument.defaultView.getSelection().toString(); var uri = event.currentTarget.ownerDocument.popupNode.ownerDocument.location.href; ZoteroPane_Local.addTextToNote(str, uri)"/>
|
oncommand="var str = event.currentTarget.ownerDocument.popupNode.ownerDocument.defaultView.getSelection().toString(); var uri = event.currentTarget.ownerDocument.popupNode.ownerDocument.location.href; ZoteroPane_Local.addTextToNote(str, uri)"/>
|
||||||
|
@ -135,7 +139,7 @@
|
||||||
</menu>
|
</menu>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</toolbarbutton>
|
</toolbarbutton>
|
||||||
<toolbarbutton id="zotero-tb-item-from-page" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newItemFromPage.label;" oncommand="ZoteroPane_Local.addItemFromPage('temporaryPDFHack', event.shiftKey ? !Zotero.Prefs.get('automaticSnapshots') : null)"/>
|
<toolbarbutton id="zotero-tb-item-from-page" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newItemFromPage.label;" command="cmd_zotero_newItemFromCurrentPage"/>
|
||||||
<toolbarbutton id="zotero-tb-lookup" class="zotero-tb-button" tooltiptext="&zotero.toolbar.lookup.label;" oncommand="ZoteroPane_Local.openLookupWindow()"/>
|
<toolbarbutton id="zotero-tb-lookup" class="zotero-tb-button" tooltiptext="&zotero.toolbar.lookup.label;" oncommand="ZoteroPane_Local.openLookupWindow()"/>
|
||||||
<!--<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.note.standalone;" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>-->
|
<!--<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.note.standalone;" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>-->
|
||||||
<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newNote;" type="menu">
|
<toolbarbutton id="zotero-tb-note-add" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newNote;" type="menu">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user