ronin/sources/scripts/commander.js
2017-09-25 15:49:46 +13:00

23 lines
564 B
JavaScript

function Commander()
{
this.el = document.createElement('yu');
this.el.id = "commander";
this.input_el = document.createElement('input');
this.input_el.value = "rescale s:0.5 rect:300x300";
this.install = function()
{
this.el.appendChild(this.input_el);
ronin.el.appendChild(this.el);
this.input_el.focus();
}
this.validate = function(query_str = ronin.commander.input_el.value)
{
var q = new Query(query_str);
if(!ronin.modules[q.module]){ console.log("Unknown module"); return; }
ronin.modules[q.module].run(q)
}
}