now docs can be set directly on the action function...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-02-15 06:10:50 +03:00
parent 9080ecd29c
commit f0995f1676
2 changed files with 8 additions and 3 deletions

View File

@ -499,6 +499,7 @@ parseStringAction.callAction = function(context, action, ...args){
return context[action.action] instanceof Function ? return context[action.action] instanceof Function ?
context[action.action] context[action.action]
.apply(context, this.resolveArgs(context, action.arguments, args)) .apply(context, this.resolveArgs(context, action.arguments, args))
// action not found or is not callable... (XXX)
: undefined : undefined
} }
parseStringAction.applyAction = function(context, action, args){ parseStringAction.applyAction = function(context, action, args){
@ -628,8 +629,12 @@ function Action(name, doc, ldoc, attrs, func){
func = args.pop() func = args.pop()
last = args[args.length-1] last = args[args.length-1]
attrs = last != null && typeof(last) != typeof('str') ? args.pop() : {} attrs = last != null && typeof(last) != typeof('str') ? args.pop() : {}
doc = typeof(args[0]) == typeof('str') ? args.shift() : null doc = typeof(args[0]) == typeof('str') ? args.shift()
ldoc = typeof(args[0]) == typeof('str') ? args.shift() : null : func.doc ? func.doc
: null
ldoc = typeof(args[0]) == typeof('str') ? args.shift()
: func.long_doc ? func.long_doc
: null
// populate the action attributes... // populate the action attributes...
//meth.name = name //meth.name = name

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-actions", "name": "ig-actions",
"version": "3.15.0", "version": "3.16.0",
"description": "", "description": "",
"main": "actions.js", "main": "actions.js",
"scripts": { "scripts": {