mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
tweaaks + docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1d649283cf
commit
5c804ff64d
@ -487,21 +487,46 @@ var IntrospectionActions = actions.Actions({
|
|||||||
return !!action.__event__ }),
|
return !!action.__event__ }),
|
||||||
|
|
||||||
// XXX revise...
|
// XXX revise...
|
||||||
// XXX this is a bit restrictive, need to be able to setup mode
|
|
||||||
// aliases/handlers, i.e. setting {mode: 'advanced'} and either
|
|
||||||
// getting the actual value from .config or calling a mode handler...
|
|
||||||
// ...might also be nice to use a toggler as handler:
|
|
||||||
// {mode: 'toggleBrowseAdvanced'}
|
|
||||||
getActionMode: ['- Interface/',
|
getActionMode: ['- Interface/',
|
||||||
doc`Get action browse mode...
|
doc`Get action browse mode...
|
||||||
|
|
||||||
Get and action's .mode(..) method and return its result.
|
Get and action's .mode(..) method and return its result.
|
||||||
|
|
||||||
Expected values:
|
Action .mode can be:
|
||||||
'disabled' - actions is disabled
|
<function> - action method.
|
||||||
'hidden' - actions is hidden
|
<action-name> - alias, name of action to get the
|
||||||
|
method from.
|
||||||
|
|
||||||
NOTE: other values are ignored.
|
The action .mode(..) method is called in the context of actions.
|
||||||
|
|
||||||
|
Basic example:
|
||||||
|
someAction: ['Path/To/Some action',
|
||||||
|
{mode: function(){ ... }},
|
||||||
|
function(){
|
||||||
|
...
|
||||||
|
}],
|
||||||
|
someOtherAction: ['Path/To/Some action',
|
||||||
|
// alias
|
||||||
|
{mode: 'someAction'},
|
||||||
|
function(){
|
||||||
|
...
|
||||||
|
}],
|
||||||
|
|
||||||
|
|
||||||
|
Usage pattern:
|
||||||
|
// for cases where we need to define an explicit mode...
|
||||||
|
actionModeX: ['- System/',
|
||||||
|
{mode: function(){
|
||||||
|
return this.actionModeX() }},
|
||||||
|
core.notUserCallable(function(){
|
||||||
|
return ...
|
||||||
|
})],
|
||||||
|
someAction: [
|
||||||
|
// use the mode...
|
||||||
|
{mode: 'actionModeX'},
|
||||||
|
function(){
|
||||||
|
...
|
||||||
|
}],
|
||||||
`,
|
`,
|
||||||
function(action, mode_cache){
|
function(action, mode_cache){
|
||||||
var m = action
|
var m = action
|
||||||
|
|||||||
@ -266,7 +266,7 @@ var ImageMarkActions = actions.Actions({
|
|||||||
function(mode){ this.nextTagged('marked', mode) }],
|
function(mode){ this.nextTagged('marked', mode) }],
|
||||||
|
|
||||||
cropMarked: ['Mark|Crop/Crop $marked images',
|
cropMarked: ['Mark|Crop/Crop $marked images',
|
||||||
{mode: function(target){
|
{mode: function(){
|
||||||
return this.marked.length == 0 && 'disabled' }},
|
return this.marked.length == 0 && 'disabled' }},
|
||||||
'crop: "marked" ...'],
|
'crop: "marked" ...'],
|
||||||
//function(flatten){ this.cropTagged('marked', flatten) }],
|
//function(flatten){ this.cropTagged('marked', flatten) }],
|
||||||
|
|||||||
@ -2615,28 +2615,11 @@ var BrowseActionsActions = actions.Actions({
|
|||||||
|
|
||||||
|
|
||||||
Action mode (disabled/hidden) and also be controlled dynamically:
|
Action mode (disabled/hidden) and also be controlled dynamically:
|
||||||
- .mode() action method is called with actions as base.
|
|
||||||
Example:
|
|
||||||
someAction: ['Path/To/Some action',
|
|
||||||
{mode: function(){ ... }},
|
|
||||||
function(){
|
|
||||||
...
|
|
||||||
}],
|
|
||||||
someOtherAction: ['Path/To/Some action',
|
|
||||||
// alias
|
|
||||||
{mode: 'someAction'},
|
|
||||||
function(){
|
|
||||||
...
|
|
||||||
}],
|
|
||||||
|
|
||||||
.mode can be:
|
Expected modes:
|
||||||
<function> - action method.
|
'hidden' - hide the action from dialog
|
||||||
<action-name> - alias, name of action to get the
|
'disabled' - disable the action in dialog
|
||||||
method from.
|
... - other values are ignored
|
||||||
|
|
||||||
.mode() can return:
|
|
||||||
'disabled' - item will be disabled.
|
|
||||||
'hidden' - item will be both hidden and disabled.
|
|
||||||
|
|
||||||
NOTE: disabling in path has priority over .mode(), thus
|
NOTE: disabling in path has priority over .mode(), thus
|
||||||
it is possible to hide/disable an enabled item but not
|
it is possible to hide/disable an enabled item but not
|
||||||
@ -2644,6 +2627,9 @@ var BrowseActionsActions = actions.Actions({
|
|||||||
NOTE: .mode() can be defined in any action in chain,
|
NOTE: .mode() can be defined in any action in chain,
|
||||||
though only the last one is called...
|
though only the last one is called...
|
||||||
|
|
||||||
|
For more info see .getActionMode(..)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
options format:
|
options format:
|
||||||
{
|
{
|
||||||
@ -2951,7 +2937,7 @@ var BrowseActionsActions = actions.Actions({
|
|||||||
|
|
||||||
// XXX revise...
|
// XXX revise...
|
||||||
advancedBrowseModeAction: ['- System/',
|
advancedBrowseModeAction: ['- System/',
|
||||||
core.doc`Placeholder advanced action
|
core.doc`advanced action (placeholder)
|
||||||
|
|
||||||
This is mainly used to indicate other actions as advanced mode only.
|
This is mainly used to indicate other actions as advanced mode only.
|
||||||
|
|
||||||
@ -2965,14 +2951,14 @@ var BrowseActionsActions = actions.Actions({
|
|||||||
`,
|
`,
|
||||||
{mode: function(){
|
{mode: function(){
|
||||||
return this.advancedBrowseModeAction() }},
|
return this.advancedBrowseModeAction() }},
|
||||||
core.notUserCallable(function(){
|
function(){
|
||||||
// Placeholder action, not for direct use...
|
// Placeholder action, not for direct use...
|
||||||
//
|
//
|
||||||
// See doc for more info:
|
// See doc for more info:
|
||||||
// .showDoc('advancedBrowseModeAction')
|
// .showDoc('advancedBrowseModeAction')
|
||||||
return this.config['browse-advanced-mode'] != 'on'
|
return this.config['browse-advanced-mode'] != 'on'
|
||||||
&& 'hidden'
|
&& 'hidden'
|
||||||
|| 'visible' })],
|
|| 'visible' }],
|
||||||
|
|
||||||
toggleBrowseAdvanced: ['System|Interface/-99: Advanced menu items',
|
toggleBrowseAdvanced: ['System|Interface/-99: Advanced menu items',
|
||||||
core.doc`Toggle advanced menu items...
|
core.doc`Toggle advanced menu items...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user