radare2/shlr/www/enyo/js/console.js

28 lines
1020 B
JavaScript
Raw Normal View History

enyo.kind ({
2013-01-15 00:23:10 +01:00
name: "Console",
kind: "Scroller",
2013-01-26 03:33:13 +01:00
classes: "r2panel",
2014-11-23 11:34:58 +01:00
style: "background-color:#c0c0c0;padding-left:7px",
2013-01-15 00:23:10 +01:00
components: [
{tag: "form", attributes: {action:"javascript:#"}, components: [
{kind: "FittableRows", fit: true, classes: "fittable-sample-shadow", components: [
{kind: "onyx.InputDecorator", style: "margin-top:8px;background-color:#404040;width: 90%;display:inline-block", components: [
{kind: "Input", style:"width:100%;color:white", value: '', onkeydown: "runCommand", attributes: {autocapitalize:"off"}, name: "input"},
2013-01-15 00:23:10 +01:00
]},
{tag: "pre", classes:"r2ui-terminal", style:"width:90%;", fit: true, allowHtml: true, name:"output"}
]}
]}
],
runCommand: function (inSender, inEvent) {
2013-01-15 00:23:10 +01:00
if (inEvent.keyCode === 13) {
var cmd = this.$.input.getValue ();
2013-01-15 00:23:10 +01:00
this.$.input.setValue ("");
(function (out) {
r2.cmd (cmd, function (x) {
out.setContent (x);
});
})(this.$.output);
2013-01-15 00:23:10 +01:00
}
}
});