Encode action to be posted xdomain.
@param {gui.Action} a
@param @optional {String} key Associates dispatching document
to the hosting iframespirit (ascending action scenario)
@returns {String}
7883
function(a, key) {
			var prefix = "spiritual-action:";
			return prefix + (function() {
				a.target = null;
				a.data = (function(d) {
						if (gui.Type.isComplex(d)) {
							if (gui.Type.isFunction(d.stringify)) {
								d = d.stringify();
							} else {
								try {
									JSON.stringify(d);
								} catch (jsonexception) {
									d = null;
								}
							}
						}
						return d;
					}(a.data));
					a.instanceid = key || null;
					return JSON.stringify(a);
				}());
		}
757028
public static String componentAccessToken(String key) {
		if (isKeyParam(key)) {
			return apiHandler.componentAccessToken(key);
		}
		return key;
	}
388827
def url(self, key, includeToken=None):
        
        if self._token and (includeToken or self._showSecrets):
            delim = '&' if '?' in key else '?'
            return '%s%s%sX-Plex-Token=%s' % (self._baseurl, key, delim, self._token)
        return '%s%s' % (self._baseurl, key)
101233
function paramConverterMiddleware(handler, action) {

	function convertProperties(obj, schema) {
		Object.keys(schema).forEach(key => {
			const s = schema[key];
			const val = obj[key];
			if (val == null)
				return;

			if (s.type == "string" && typeof val !== "string") {
				obj[key] = "" + val;
			} else if (s.type == "number" && typeof val !== "number") {
				obj[key] = Number(val);
			} else if (s.type == "boolean" && typeof val !== "boolean") {
				obj[key] = String(val).toLowerCase() === "true";
			} else if (s.type == "date" && !(val instanceof Date)) {
				obj[key] = new Date(val);
			} else if (s.type == "object")
				convertProperties(val, s.props);
		});
	}

	// Wrap a param validator
	if (action.params && typeof action.params === "object") {
		return function convertContextParams(ctx) {
			convertProperties(ctx.params, action.params);

			return handler(ctx);
		};
	}
	return handler;
}
237464
private String prepareIPSUri(String action, Context context) throws FMSException {
		StringBuilder uri = new StringBuilder();
		uri.append(Config.getProperty(Config.BASE_URL_PLATFORMSERVICE)).append("/").append(context.getAppDBID())
			.append("?act=").append(action).append("&token=").append(context.getAppToken());
		return uri.toString();
	}
794162
protected function buildPathToAction($action, $configurationUrl = false, $primaryKeyValue = false)
    {
        //no configurated url, default
        if(!$configurationUrl) {
            $url = sprintf('/%s/%s', implode('/', $this->buildPathToSubject()), $action);
        } else {
            //asterisk in front means to use path to subject + url
            if(substr($configurationUrl,0,1) == '*') {
                $url = sprintf('%s/%s', implode('/', $this->buildPathToSubject()), substr($configurationUrl,1));
            } else {
            //NO asterisk in front means to use path to area + url
                $url = sprintf('%s/%s', implode('/', $this->buildPathToArea()), $configurationUrl);
            }
        }
        //insert primaryKey(s) value(s)
        $url = sprintf($url, $primaryKeyValue);
        return $url;
    }
1365000
function encodeEmailAddress(addr) {

        function char2hex(ch) {
            var hexDigits = '0123456789ABCDEF';
            var dec = ch.charCodeAt(0);
            return(hexDigits.charAt(dec>>4) + hexDigits.charAt(dec&15));
        }

        var encode = [
            function(ch){return "&#"+ch.charCodeAt(0)+";";},
            function(ch){return "&#x"+char2hex(ch)+";";},
            function(ch){return ch;}
        ];

        addr = "mailto:" + addr;

        addr = addr.replace(/./g, function(ch) {
            if (ch == "@") {
                ch = encode[Math.floor(Math.random()*2)](ch);
            } else if (ch !=":") {
                var r = Math.random();
                ch =  (r > .9 ? encode[2](ch) : r > .45 ? encode[1](ch) : encode[0](ch));
            }
            return ch;
        });

        addr = "<a href=\"" + addr + "\">" + addr + "</a>";
        addr = addr.replace(/">.+:/g,"\">");

        return addr;
    }
732242
def action_as_json(action)
      json = {}
      json[:default_title] = action.title if action.title
      json[:default_icon] = action.icon if action.icon
      json[:default_popup] = action.popup if action.popup
      json
    end
934321
def get_action_cache_key(name, argument):
    """"""
    tokens = [str(name)]
    if argument:
        tokens.append(str(argument))
    return '::'.join(tokens)
733009
function (sender, key) {
/*Line 50 - 'AtomBinding.js' */                // update target....
/*Line 51 - 'AtomBinding.js' */                // most like end of path...
/*Line 52 - 'AtomBinding.js' */                if (this.path == null || this.path.length == 0)
/*Line 53 - 'AtomBinding.js' */                    return;
/*Line 54 - 'AtomBinding.js' */                var ae = new AtomEnumerator(this.path);
/*Line 55 - 'AtomBinding.js' */                var obj = this.control;
/*Line 56 - 'AtomBinding.js' */                var objKey = null;
/*Line 57 - 'AtomBinding.js' */                while (ae.next()) {
/*Line 58 - 'AtomBinding.js' */                    objKey = ae.current();
/*Line 59 - 'AtomBinding.js' */                    objKey.value = obj;
/*Line 60 - 'AtomBinding.js' */                    if (!obj)
/*Line 61 - 'AtomBinding.js' */                        return;
/*Line 62 - 'AtomBinding.js' */                    if (!ae.isLast())
/*Line 63 - 'AtomBinding.js' */                        obj = AtomBinder.getValue(obj, objKey.path);
/*Line 64 - 'AtomBinding.js' */                }
/*Line 65 - 'AtomBinding.js' */                var value = null;
/*Line 66 - 'AtomBinding.js' */                if (this.jq) {
/*Line 67 - 'AtomBinding.js' */                    switch (this.key) {
/*Line 68 - 'AtomBinding.js' */                        case "valueAsDate":
/*Line 69 - 'AtomBinding.js' */                            value = this.element.valueAsDate;
/*Line 70 - 'AtomBinding.js' */                            break;
/*Line 71 - 'AtomBinding.js' */                        case "checked":
/*Line 72 - 'AtomBinding.js' */                            value = this.element.checked ? true : false;
/*Line 73 - 'AtomBinding.js' */                            break;
/*Line 74 - 'AtomBinding.js' */                        default:
/*Line 75 - 'AtomBinding.js' */                            value = $(this.element).val();
/*Line 76 - 'AtomBinding.js' */                    }
/*Line 77 - 'AtomBinding.js' */                } else {
/*Line 78 - 'AtomBinding.js' */                    value = AtomBinder.getValue(this.control, this.key);
/*Line 79 - 'AtomBinding.js' */                }
/*Line 80 - 'AtomBinding.js' */                AtomBinder.setValue(obj, objKey.path, value);
/*Line 81 - 'AtomBinding.js' */            }
124075
private Object wrappedAction(final Context cx, final Scriptable scope,
			final Scriptable thisObj, final Object[] args, final int actionType) {

		// take care to set the context's RegExp proxy to the original one as
		// this is checked
		// (cf net.sourceforge.htmlunit.corejs.javascript.regexp.RegExpImp:334)
		try {
			ScriptRuntime.setRegExpProxy(cx, wrapped_);
			return wrapped_.action(cx, scope, thisObj, args, actionType);
		} finally {
			ScriptRuntime.setRegExpProxy(cx, this);
		}
	}
1265524
function (actionName) {
            actionName = actionName || "";

            var idx = actionName.indexOf("?");
            var object = {
                name : "",
                params : ""
            };

            if (idx < 0) {
                object.name = actionName;
            } else {
                object = {
                    name : actionName.substring(0, idx),
                    params : actionName.substring(idx + 1)
                };
            }

            return object;
        }
946476
function o_contents($id,$action,$options=''){
    if ($action!='new'){
        $o =& $this->objects[$id];
    }
    switch ($action){
        case 'new':
        $this->objects[$id]=array('t'=>'contents','c'=>'','info'=>array());
        if (strlen($options) && intval($options)){
        // then this contents is the primary for a page
        $this->objects[$id]['onPage']=$options;
        } else if ($options=='raw'){
        // then this page contains some other type of system object
        $this->objects[$id]['raw']=1;
        }
        break;
        case 'add':
        // add more options to the decleration
        foreach ($options as $k=>$v){
            $o['info'][$k]=$v;
        }
        case 'out':
        $tmp=$o['c'];
        $res= "\n".$id." 0 obj\n";
        if (isset($this->objects[$id]['raw'])){
        $res.=$tmp;
        } else {
        $res.= "<<";
        if (function_exists('gzcompress') && $this->options['compression']){
            // then implement ZLIB based compression on this content stream
            $res.=" /Filter /FlateDecode";
            $tmp = gzcompress($tmp);
        }
        if ($this->encrypted){
            $this->encryptInit($id);
            $tmp = $this->ARC4($tmp);
        }
        foreach($o['info'] as $k=>$v){
            $res .= "\n/".$k.' '.$v;
        }
        $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream";
        }
        $res.="\nendobj\n";
        return $res;
        break;
    }
    }
675714
function (action) {
        var targetID = action.originalTarget.id,
            element = this.targets[targetID]

        if (!element) {
            return
        }

        var actionIndex = element.actions.indexOf(action)

        if (actionIndex == -1) {
            return
        }

        if (this.currentTarget == element) {
            element.currentActionSalvaged = true
        }

        element.actions[actionIndex] = null
        element.actions.splice(actionIndex, 1); // Delete array item

        if (element.actions.length === 0) {
            if (this.currentTarget == element) {
                this.currentTargetSalvaged = true
            }
        }

    }
820907
private static IAction createAction(String action) {
        IAction actn = null;
        
        if (!StringUtils.isEmpty(action)) {
            if ((actn = ActionRegistry.getRegisteredAction(action)) == null) {
                actn = ActionUtil.createAction(null, action);
            }
        }
        
        return actn;
    }
480025
function describeKey(e) {
    var via = '';
    var desc = [];
    if (e.getModifierState("Shift")) desc.push("Shift");
    if (e.getModifierState("Control")) desc.push("Control");
    if (e.getModifierState("Alt")) desc.push("Alt");
    if (e.getModifierState("Meta")) desc.push("Meta");
    if (e.key !== 'Unidentified') {
        desc.push(e.key);
        via = 'e.key' + (e.nativeEvent.key ? '' : ' polyfill');
    } else if (e.nativeEvent.keyIdentifier) {
        var keyId = e.nativeEvent.keyIdentifier;
        if (keyId.substring(0, 2) === 'U+') {
            var code = parseInt(keyId.substring(2), 16);
            desc.push(String.fromCharCode(code));
        } else {
            desc.push(keyId);
        }
        via = 'e.keyIdentifier';
    } else if (specials[e.which]) {
        desc.push(specials[e.which]);
        via = 'e.which + lookup';
    } else {
        desc.push(String.fromCharCode(e.which));
        via = 'e.which';
    }
    e.persist();
    console.log(e);
    return '{' + desc.join('+') + '} (' + via + ')';
}
105936
function(params) {
    var encode = encodeURIComponent,
      p = [],
      key;
    for (key in params) p.push(encode(key) + '=' + encode(params[key]));

    return p.join('&');
  }