-
-
Save erikvold/257403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var noun_type_fooCommand = { | |
suggest: function( text, html ) { | |
var suggestions = []; | |
suggestions.push( CmdUtils.makeSugg('foo', 'foo', 'foo') ); | |
suggestions.push( CmdUtils.makeSugg('bar', 'bar', 'bar') ); | |
suggestions.push( CmdUtils.makeSugg('baz', 'baz', 'baz') ); | |
return suggestions; | |
} | |
} | |
CmdUtils.CreateCommand({ | |
name: "foobar", | |
names: ["foobar"], | |
author: (CmdUtils.parserVersion == 2) ? {name: "esquifit"} : "esquifit", | |
takes: {"Some foostring": noun_type_fooCommand }, | |
arguments: [{role: "object", | |
label: "Some foostring", | |
nountype: noun_type_fooCommand}], | |
description: "Hybrid foo command", | |
execute: function( arg ) { | |
var data = (CmdUtils.parserVersion == 2) ? arg.object.data : arg.data; | |
displayMessage(data); | |
}, | |
preview: function( pblock, {object} ) { | |
var text = (CmdUtils.parserVersion == 2) ? object.text : object; | |
pblock.innerHTML = "Text: " + text ; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment