garyhodgson (owner)

Revisions

gist: 18603 Download_button fork
public
Public Clone URL: git://gist.github.com/18603.git
Embed All Files: show embed
x #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var asd = function(){
      d = new Date();
      CmdUtils.log(d.getTime());
      return ['asd1','asd2','asd'+d.getTime()];
  }
 
/* This is a template command */
CmdUtils.CreateCommand({
  name: "example",
  icon: "http://example.com/example.png",
  homepage: "http://example.com/",
  author: { name: "Your Name", email: "you@example.com"},
  license: "GPL",
  description: "A short description of your command",
  help: "how to use your command",
  takes: {
    "input": new CmdUtils.NounType("asd", asd())
         },
  preview: function( pblock, input ) {
    CmdUtils.log(pblock);
    var template = "Hello ${name}";
    pblock.innerHTML = CmdUtils.renderTemplate(template, {"name": "World!"});
  },
  execute: function(input) {
    CmdUtils.setSelection("You selected: "+input.html);
  }
});