Note: An alternative skin, TW4MW (work in progress), is available from the user preferences.
Dev:Toolbar Commands
TiddlyWiki Community Wiki
Similar to creating macros, toolbar commands are created by attaching an object to config.commands:
config.commands.sampleCommand = { text: "label", tooltip: "tooltip", handler: function(event, src, title) { // ... return false; } };
Each command has a handler method (config.commands.*.handler), as well as text and tooltip properties for the generated command button's label and tooltip, respectively.
In order to use a newly-created toolbar command, this has to be added to the ToolbarCommands shadow tiddler.
The keyword for a command is the same as the name of the object defining the handler (here sampleCommand).
Command handlers are invoked when the respective button is clicked and are passed the following arguments:
- event: the respective event
- src: the button element
- title: the title of the respective tiddler
[edit] Command Popups
Toolbar commands can also create popups:
config.commands.sampleCommand = { type: "popup", text: "label", tooltip: "tooltip", handlePopup: function(popup, title) { // ... } };
[edit] Conditional Display
Commands have an optional isEnabled method which is passed the respective tiddler object and determines whether the command button will be rendered (returning true or false).
In addition, the following optional properties are available:
- hideShadow: do not display for shadow tiddlers
- hideReadOnly: do not display in readOnly state
- readOnlyText: button label for readOnly state
- readOnlyTooltip: tooltip for readOnly state

