Command Tag
The command tag can be used to add a new command to Jancy’s command registry.
<jyl> <command id="close-current-tab" description="Close current tab"> tw.closeTab({ mode: "active" }) </command> </jyl>
Format
Commands start and end with a command
tag.
command
tag properties:
id
required which must be unique amongst all commands registered with Jancy.
Jancy will always prepend the word
user-
to user defined commands.
description
optional a human readable string describing what the command does.
If a description property is omitted, the
id
property will be used in it’s place.
The contents of the command
tag will be used as the body of a Javascript function that will be executed when the command is executed. The function generated will be called with the following arguments:
jancy
(Jancy object
)tw
(Tabbed Window object
)
If the command is defined as:
<jyl> <command id="close-current-tab" description="Close current tab"> tw.closeTab({ mode: "active" }) </command> </jyl>
the generated Javascript would be:
function f(jancy, tw) { tw.closeTab({ mode: "active" }) }