Type "z" then "e" to execute some simple JavaScript.
Keyboard commands with syntactic sugar.
API status: | general |
---|---|
Included in AUI core? | Yes. You do not need to explicitly require the web resource key. |
Web resource key: |
com.atlassian.auiplugin:ajs
|
AMD Module key: | N/A |
Experimental API: | 3 |
Type "z" then "e" to execute some simple JavaScript.
AJS.whenIType('ze').execute(function () {
alert('I have executed.');
});
AJS.whenIType('c').click('#create');
AJS.whenIType('gh').or('gd').goTo('http://example.com/');
AJS.whenIType('n').moveToNextItem('.selector');
AJS.whenIType('p').moveToPrevItem('.selector');
fromJSON
creates keyboard commands and their actions from json data. Format:
[
{
"keys":[["g", "d"]],
"context":"global",
"op":"followLink",
"param":"#home_link"
}, {
"keys":[["g", "i"]],
"context":"global",
"op":"followLink",
"param":"#find_link"
}, {
"keys":[["/"]],
"context":"global",
"op":"moveToAndFocus",
"param":"#quickSearchInput"
}, {
"keys":[["c"]],
"context":"global",
"op":"moveToAndClick",
"param":"#create_link"
}
]