Skip to content

Instantly share code, notes, and snippets.

@voodootikigod
Created October 23, 2008 04:51
Show Gist options
  • Save voodootikigod/18922 to your computer and use it in GitHub Desktop.
Save voodootikigod/18922 to your computer and use it in GitHub Desktop.
/* This is a template command */
CmdUtils.CreateCommand({
name: "example",
icon: "http://example.com/example.png",
homepage: "http://example.com/",
author: { name: "Your Name", email: "[email protected]"},
license: "GPL",
description: "A short description of your command",
help: "how to use your command",
takes: {"input": noun_arb_text},
preview: function( pblock, input ) {
var template = "Hello ${name}";
pblock.innerHTML = CmdUtils.renderTemplate(template, {"name": "World!"});
},
execute: function(input) {
CmdUtils.setSelection("You selected: "+input.html);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment