diff --git a/pandora/document/utils.py b/pandora/document/utils.py index 233276b5..c579f0dc 100644 --- a/pandora/document/utils.py +++ b/pandora/document/utils.py @@ -15,7 +15,7 @@ def pdfinfo(pdf): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) stdout, stderr = p.communicate() data = {} - for line in stdout.decode('utf-8', 'replace').strip().split('\n'): + for line in stdout.decode('utf-8').strip().split('\n'): parts = line.split(':') key = parts[0].lower().strip() if key: diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index b53bec0b..19a40ed9 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -402,47 +402,6 @@ pandora.ui.mainMenu = function() { }); } } else if (ui.section == 'documents') { - var files, ids = []; - if (ui.document) { - files = [pandora.$ui.document.info()]; - ids = [files[0].id]; - } else { - files = pandora.$ui.list.options('selected').map(function(id) { - ids.push(id) - return pandora.$ui.list.value(id); - }); - } - if (ui._collection) { - //fixme use history - //pandora.doHistory('delete', files, ui._collection, function() { - pandora.api.removeCollectionItems({ - collection: ui._collection, - items: ids - }, function() { - pandora.UI.set({collectionSelection: []}); - pandora.reloadList(); - }); - } else { - pandora.ui.deleteDocumentDialog( - files, - function() { - Ox.Request.clearCache(); - if (ui.document) { - pandora.UI.set({document: ''}); - } else { - pandora.$ui.list.reloadList() - } - } - ).open(); - } - } else if (ui.section == 'edits') { - var clips = pandora.$ui.editPanel.getSelectedClips(); - pandora.doHistory('delete', clips, ui.edit, function(result) { - pandora.$ui.editPanel.updatePanel(function() {}); - }); - } - } else if (data.id == 'deletefromarchive') { - if (ui.section == 'documents') { var files; if (ui.document) { files = [pandora.$ui.document.info()]; @@ -462,6 +421,11 @@ pandora.ui.mainMenu = function() { } } ).open(); + } else if (ui.section == 'edits') { + var clips = pandora.$ui.editPanel.getSelectedClips(); + pandora.doHistory('delete', clips, ui.edit, function(result) { + pandora.$ui.editPanel.updatePanel(function() {}); + }); } } else if (data.id == 'undo') { fromMenu = true; @@ -1081,11 +1045,7 @@ pandora.ui.mainMenu = function() { { id: 'paste', title: clipboardItems == 0 ? Ox._('Paste') : Ox._('Paste {0}', [clipboardItemName]), disabled: !canPaste, keyboard: 'control v' }, { id: 'clearclipboard', title: Ox._('Clear Clipboard'), disabled: !clipboardItems}, {}, - [ - { id: 'delete', title: Ox._('{0} {1} {2}', [deleteVerb, selectionItemName, listName]), disabled: !canDelete, keyboard: 'delete' } - ].concat(ui._collection ? [ - { id: 'deletefromarchive', title: Ox._('{0} {1} {2}', [Ox._('Delete'), selectionItemName, Ox._('from Archive')]), disabled: !canDelete } - ] : []), + { id: 'delete', title: Ox._('{0} {1} {2}', [deleteVerb, selectionItemName, listName]), disabled: !canDelete, keyboard: 'delete' }, {}, { id: 'undo', title: undoText ? Ox._('Undo {0}', [undoText]) : Ox._('Undo'), disabled: !undoText, keyboard: 'control z' }, { id: 'redo', title: redoText ? Ox._('Redo {0}', [redoText]) : Ox._('Redo'), disabled: !redoText, keyboard: 'shift control z' },