From 7504d92230116056127458feef9345e0f1da560a Mon Sep 17 00:00:00 2001 From: j Date: Fri, 16 Nov 2018 13:41:06 +0000 Subject: [PATCH 1/3] use ctrl-e for batch editing --- static/js/mainMenu.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index 7c22f298..b797b4bd 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -938,6 +938,18 @@ pandora.ui.mainMenu = function() { key_control_p: function() { window.open(document.location.href + '#?print=true', '_blank'); }, + key_control_e: function() { + if ( + !pandora.hasDialogOrScreen() && + pandora.enableBatchEdit(ui.section) + ) { + if (ui.section == 'documents') { + pandora.ui.editDocumentsDialog().open(); + } else { + pandora.ui.editDialog().open(); + } + } + }, key_control_shift_e: function() { if ( !pandora.hasDialogOrScreen() && @@ -1167,7 +1179,7 @@ pandora.ui.mainMenu = function() { return { id: 'itemMenu', title: Ox._('Item'), items: [ { id: 'add', title: Ox._('Add {0}...', [Ox._('Document')]), disabled: !pandora.hasCapability('canAddItems') }, { id: 'edit', title: Ox._('Edit {0}...', [Ox._('Document')]), disabled: true /*fixme: !canEdit */ }, - { id: 'batchedit', title: Ox._('Batch Edit {0}...', [Ox._('Documents')]), disabled: !pandora.enableBatchEdit(ui.section), keyboard: 'shift control e' }, + { id: 'batchedit', title: Ox._('Batch Edit {0}...', [Ox._('Documents')]), disabled: !pandora.enableBatchEdit(ui.section), keyboard: 'control e' }, {}, { id: 'selectall', title: Ox._('Select All {0}', [listItemsName]), disabled: !canSelect, keyboard: 'control a' }, { id: 'selectnone', title: Ox._('Select None'), disabled: !canSelect, keyboard: 'shift control a' }, From 71311b323eeb2e5815b9c25c83706ce964d08c4b Mon Sep 17 00:00:00 2001 From: j Date: Fri, 16 Nov 2018 14:23:18 +0000 Subject: [PATCH 2/3] better documents embed --- static/js/embedDialog.js | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/static/js/embedDialog.js b/static/js/embedDialog.js index 3348e705..1142cddb 100644 --- a/static/js/embedDialog.js +++ b/static/js/embedDialog.js @@ -212,11 +212,40 @@ pandora.ui.embedDialog = function(/*[url, ]callback*/) { }).join(find.operator); } + function getData() { + var type = $input.type.value(), + view = $list.options('selected')[0]; + return Ox.map($input, function($element, key) { + return Ox.contains(Ox.getObjectById(views, view).inputs, key) + && ( + !Ox.contains(['map', 'calendar'], view) + || ($input.mapMode.value() == 'item' && key != 'find') + || ($input.mapMode.value() == 'find' && key != 'item') + ) + && $element.value ? $element.value() : void 0; + }) + } + function formatHTML() { - var type = $input.type.value(); + var type = $input.type.value(), + view = $list.options('selected')[0], + value = $input.link.value(), + data = getData(); + if (view == 'document') { + var prefix = type == 'iframe' + ? (pandora.site.site.https ? 'https' : 'http') + + '://' + pandora.site.site.url + '/' + : '/', + page = type == 'iframe' ? 'documents' : 'document', + resolution = 480; + if (value == '...' || !value.length) { + value = ''; + } + return '' + value + ''; + } return type == 'link' ? '' + $input.link.value() + + '">' + value + '' : '