Fixes #129, add menu/contextual menu items for export/bibliography

(currently just in contextual menu).
This commit is contained in:
David Norton 2006-07-26 15:28:31 +00:00
parent aff9cd5708
commit dc2751b85c
4 changed files with 33 additions and 1 deletions

View File

@ -276,11 +276,15 @@ var ScholarPane = new function()
{ {
menu.childNodes[2].removeAttribute('disabled'); menu.childNodes[2].removeAttribute('disabled');
menu.childNodes[3].removeAttribute('disabled'); menu.childNodes[3].removeAttribute('disabled');
menu.childNodes[5].removeAttribute('disabled');
menu.childNodes[6].removeAttribute('disabled');
} }
else else
{ {
menu.childNodes[2].setAttribute('disabled', true); menu.childNodes[2].setAttribute('disabled', true);
menu.childNodes[3].setAttribute('disabled', true); menu.childNodes[3].setAttribute('disabled', true);
menu.childNodes[5].setAttribute('disabled', true);
menu.childNodes[6].setAttribute('disabled', true);
} }
} }
@ -289,14 +293,30 @@ var ScholarPane = new function()
var menu = document.getElementById('scholar-itemmenu'); var menu = document.getElementById('scholar-itemmenu');
if(itemsView && itemsView.selection.count > 0) if(itemsView && itemsView.selection.count > 0)
{
menu.childNodes[2].removeAttribute('disabled'); menu.childNodes[2].removeAttribute('disabled');
menu.childNodes[4].removeAttribute('disabled');
menu.childNodes[5].removeAttribute('disabled');
}
else else
{
menu.childNodes[2].setAttribute('disabled', true); menu.childNodes[2].setAttribute('disabled', true);
menu.childNodes[4].setAttribute('disabled', true);
menu.childNodes[5].setAttribute('disabled', true);
}
if(itemsView && itemsView.selection.count > 1) if(itemsView && itemsView.selection.count > 1)
{
menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove.multiple')); menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove.multiple'));
menu.childNodes[4].setAttribute('label', Scholar.getString('pane.items.menu.export.multiple'));
menu.childNodes[5].setAttribute('label', Scholar.getString('pane.items.menu.createBib.multiple'));
}
else else
menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove')); {
menu.childNodes[2].setAttribute('label', Scholar.getString('pane.items.menu.remove'));
menu.childNodes[4].setAttribute('label', Scholar.getString('pane.items.menu.export'));
menu.childNodes[5].setAttribute('label', Scholar.getString('pane.items.menu.createBib'));
}
} }
function newNote() function newNote()

View File

@ -30,11 +30,17 @@
<menuseparator/> <menuseparator/>
<menuitem label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();"/> <menuitem label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();"/>
<menuitem label="&toolbar.removeCollection.label;" oncommand="ScholarPane.deleteSelectedCollection();"/> <menuitem label="&toolbar.removeCollection.label;" oncommand="ScholarPane.deleteSelectedCollection();"/>
<menuseparator/>
<menuitem label="&toolbar.exportCollection.label;" oncommand="Scholar_File_Interface.exportProject();"/>
<menuitem label="&toolbar.createBibCollection.label;" oncommand="Scholar_File_Interface.bibliographyFromProject();"/>
</popup> </popup>
<popup id="scholar-itemmenu" onpopupshowing="ScholarPane.buildItemContextMenu();"> <popup id="scholar-itemmenu" onpopupshowing="ScholarPane.buildItemContextMenu();">
<menuitem label="&toolbar.newItem.label;" command="cmd_scholar_newItem"/> <menuitem label="&toolbar.newItem.label;" command="cmd_scholar_newItem"/>
<menuseparator/> <menuseparator/>
<menuitem oncommand="ScholarPane.deleteSelectedItem();"/> <menuitem oncommand="ScholarPane.deleteSelectedItem();"/>
<menuseparator/>
<menuitem oncommand="Scholar_File_Interface.exportItems();"/>
<menuitem oncommand="Scholar_File_Interface.bibliographyFromItems();"/>
</popup> </popup>
</popupset> </popupset>
<vbox id="collections-pane" persist="width" flex="1"> <vbox id="collections-pane" persist="width" flex="1">

View File

@ -25,6 +25,8 @@
<!ENTITY toolbar.newCollection.label "New Project"> <!ENTITY toolbar.newCollection.label "New Project">
<!ENTITY toolbar.renameCollection.label "Rename Project..."> <!ENTITY toolbar.renameCollection.label "Rename Project...">
<!ENTITY toolbar.removeCollection.label "Remove Project..."> <!ENTITY toolbar.removeCollection.label "Remove Project...">
<!ENTITY toolbar.exportCollection.label "Export Project...">
<!ENTITY toolbar.createBibCollection.label "Create Bibliography From Project...">
<!ENTITY toolbar.search.label "Search:"> <!ENTITY toolbar.search.label "Search:">
<!ENTITY selectitems.title "Select Items"> <!ENTITY selectitems.title "Select Items">

View File

@ -8,6 +8,10 @@ pane.items.delete = Are you sure you want to delete the selected item?
pane.items.delete.multiple = Are you sure you want to delete the selected items? pane.items.delete.multiple = Are you sure you want to delete the selected items?
pane.items.menu.remove = Remove Selected Item... pane.items.menu.remove = Remove Selected Item...
pane.items.menu.remove.multiple = Remove Selected Items... pane.items.menu.remove.multiple = Remove Selected Items...
pane.items.menu.export = Export Selected Item...
pane.items.menu.export.multiple = Export Selected Items...
pane.items.menu.createBib = Create Bibliography From Selected Item...
pane.items.menu.createBib.multiple = Create Bibliography From Selected Items...
pane.item.selected.zero = No items selected pane.item.selected.zero = No items selected
pane.item.selected.multiple = %1 items selected pane.item.selected.multiple = %1 items selected