73
edits
Changes
→Echo: arguments -> args
nountype: noun_arb_text,
label: "your shout"}],
preview: functionpreviewEcho( pblock, arguments args) { pblock.innerHTML = _("Will echo: ") + argumentsargs.object.text; }, execute: function executeEcho(args) { var msg = args.object.text + "... " + args.object.text + "......"; displayMessage(msg);
},
});
</pre>
When your preview method is called, it is passed this object, too.
The object has one attribute corresponding to each role. In our example above, the command accepts only an object-role argument, so the preview and execute methods get passed an argument with an "arguments<code>args.object" </code> attribute.
If we made a command, like email, that takes an object-role argument and a goal-role argument, its preview and execute methods would get passed an argument with "arguments<code>args.object" </code> and "arguments<code>args.goal"</code>.
<pre>
</pre>