From 739fe4972cd0e1c1e99f6dba549bfaac5a578af0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 21 Oct 2019 11:37:16 +0300 Subject: [PATCH] v-block menues and some tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/virtual-blocks.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ui (gen4)/features/virtual-blocks.js b/ui (gen4)/features/virtual-blocks.js index 64f8b087..c0eac559 100644 --- a/ui (gen4)/features/virtual-blocks.js +++ b/ui (gen4)/features/virtual-blocks.js @@ -128,7 +128,7 @@ var VirtualBlocksActions = actions.Actions({ // XXX this is enabled only in collection view as there is no way // to delete a block but possible to create one... // ...should we add a .removeBlock(..) action??? - makeVirtualBlank: ['Virtual block/50:Add blank $after', + makeVirtualBlank: ['Virtual block/80:Add blank $after', core.doc` `, @@ -138,11 +138,12 @@ var VirtualBlocksActions = actions.Actions({ type: 'virtual', path: null, }) }], - makeVirtualBlankBefore: ['Virtual block/51:Add blank $before', + makeVirtualBlankBefore: ['Virtual block/81:Add blank $before', { browseMode: 'makeVirtualBlank', }, 'makeVirtualBlank: $0 "before"'], - cloneVirtualBlock: ['Virtual block/Clone block...', + cloneVirtualBlock: ['Virtual block/80:$Clone block...', + { browseMode: 'editVirtualBlock' }, function(ref, offset, img){ var img = Object.assign({}, this.images[this.data.getImage(ref)] || {}, @@ -272,9 +273,9 @@ var VirtualBlocksUIActions = actions.Actions({ return } make.Separator() - this.editVirtualBlockText ? + this.editVirtualBlock ? // editable... - this.editVirtualBlockText(make, gid, image) + this.editVirtualBlock(make, gid, image) // view only... : Object.entries(this.config['virtual-text-fields'] || {}) .forEach(function([title, attr]){ @@ -324,7 +325,7 @@ var VirtualBlocksEditUIActions = actions.Actions({ // XXX this is a good candidate for inlineing (browse2) // XXX should we also add a preview (preview constructor from features/metadata.js)??? // XXX should we do a sanity check for image type??? - editVirtualBlockText: ['Virtual block/$Edit...', + editVirtualBlock: ['Virtual block/$Edit...', { browseMode: function(){ return (this.image || {}).type != 'virtual' && 'disabled' }, }, widgets.makeUIDialog(function(gid){ @@ -375,17 +376,19 @@ var VirtualBlocksEditUIActions = actions.Actions({ that.refresh(gid) }) })], // XXX virtual block templates... - cloneVirtualBlockFromTemplate: ['Virtual block/Clone from...', + cloneVirtualBlockFromTemplate: ['- Virtual block/Clone from...', function(){ }], - saveVirtualBlockAsTemplate: ['Virtual block/Save as template', + saveVirtualBlockAsTemplate: ['- Virtual block/Save as template', function(gid){ }], // XXX list existing non-blank v-blocks... - cloneVirtualBlockFrom: ['Virtual block/Clone from...', + cloneVirtualBlockFrom: ['- Virtual block/Clone...', function(){ }], + + // XXX add alias to remove virtual block... }) // NOTE: this is independent of 'virtual-blocks'...