From a00915a27d634d7486dc232fe60cfd083f9131d2 Mon Sep 17 00:00:00 2001 From: Rolux Date: Tue, 5 Jan 2016 14:02:07 +0530 Subject: [PATCH] add 'Edit Metadata' menu entry --- static/js/mainMenu.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index d31625c..ea20de4 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -430,6 +430,10 @@ oml.ui.mainMenu = function() { oml.UI.set({listSelection: []}); oml.reloadList(); }); + } else if (data.id == 'editmetadata') { + (oml.$ui.editDialog || ( + oml.$ui.editDialog = oml.ui.editDialog() + )).open(); } else if (data.id == 'undo') { fromMenu = true; oml.undoHistory(); @@ -599,6 +603,8 @@ oml.ui.mainMenu = function() { selectionItemName = ( selectionItems > 1 ? Ox.formatNumber(selectionItems) + ' ' : '' ) + Ox._(selectionItems == 1 ? 'Book' : 'Books'), + editItemName = Ox.formatNumber(selectionItems) + ' ' + + Ox._(selectionItems == 1 ? 'Book' : 'Books'), clipboardItems = oml.clipboard.items(), clipboardType = oml.clipboard.type(), clipboardItemName = !clipboardItems ? '' @@ -612,6 +618,7 @@ oml.ui.mainMenu = function() { canPaste = listData.editable && clipboardItems, canAdd = canCopy && clipboardItems && clipboardType == 'book', canDelete = listData.user == '' && selectionItems, + canEdit = listData.user == '' && selectionItems, historyItems = oml.history.items(), undoText = oml.history.undoText(), redoText = oml.history.redoText(); @@ -702,6 +709,13 @@ oml.ui.mainMenu = function() { keyboard: 'control delete' }, {}, + { + id: 'editmetadata', + title: Ox._('Edit Metadata for {0}', [editItemName]), + disabled: !canEdit, + keyboard: 'control e' + }, + {}, { id: 'undo', title: undoText ? Ox._('Undo {0}', [undoText]) : Ox._('Undo'),