Add 'fj' and 'fsj' commands to show json instead of blocks

This commit is contained in:
pancake 2013-01-17 03:29:46 +01:00
parent a4c8b96e20
commit 18ff639bd6
15 changed files with 348 additions and 150 deletions

View File

@ -113,12 +113,14 @@ static int cmd_flag(void *data, const char *input) {
break; break;
case 's': case 's':
switch (input[1]) { switch (input[1]) {
case 'j':
case '\0':
case '*':
r_flag_space_list (core->flags, input[1]);
break;
case ' ': case ' ':
r_flag_space_set (core->flags, input+2); r_flag_space_set (core->flags, input+2);
break; break;
case '*':
r_flag_space_set (core->flags, "*");
break;
case 'm': case 'm':
{ RFlagItem *f; { RFlagItem *f;
ut64 off = core->offset; ut64 off = core->offset;

View File

@ -1,6 +1,7 @@
/* radare - LGPL - Copyright 2008-2012 - pancake */ /* radare - LGPL - Copyright 2008-2013 - pancake */
#include <r_flags.h> #include <r_flags.h>
#include <r_cons.h>
R_API int r_flag_space_get(RFlag *f, const char *name) { R_API int r_flag_space_get(RFlag *f, const char *name) {
int i; int i;
@ -54,11 +55,29 @@ R_API void r_flag_space_set(RFlag *f, const char *name) {
} }
} }
R_API void r_flag_space_list(RFlag *f) { R_API int r_flag_space_list(RFlag *f, int mode) {
int i, j = 0; int i, j = 0;
if (mode == 'j')
r_cons_printf ("[");
for (i=0; i<R_FLAG_SPACES_MAX; i++) { for (i=0; i<R_FLAG_SPACES_MAX; i++) {
if (f->spaces[i]) if (!f->spaces[i]) continue;
printf ("%02d %c %s\n", j++, if (mode=='j') {
(i==f->space_idx)?'*':' ', f->spaces[i]); r_cons_printf ("%s{\"name\":\"%s\"%s}",
j? ",":"", f->spaces[i],
(i==f->space_idx)?
",\"selected\":true":"");
} else if (mode=='*') {
r_cons_printf ("fs %02d %c %s\n", j++,
(i==f->space_idx)?'*':' ',
f->spaces[i]);
} else {
r_cons_printf ("%02d %c %s\n", j++,
(i==f->space_idx)?'*':' ',
f->spaces[i]);
} }
j++;
}
if (mode == 'j')
r_cons_printf ("]\n");
return j;
} }

View File

@ -66,7 +66,7 @@ R_API RFlagItem *r_flag_get_at(RFlag *f, ut64 off);
R_API int r_flag_space_get(RFlag *f, const char *name); R_API int r_flag_space_get(RFlag *f, const char *name);
R_API const char *r_flag_space_get_i(RFlag *f, int idx); R_API const char *r_flag_space_get_i(RFlag *f, int idx);
R_API void r_flag_space_set(RFlag *f, const char *name); R_API void r_flag_space_set(RFlag *f, const char *name);
R_API void r_flag_space_list(RFlag *f); R_API int r_flag_space_list(RFlag *f, int mode);
#endif #endif
#endif #endif

View File

@ -35,7 +35,8 @@
} }
.r2ui-input { .r2ui-input {
background-color: #606060; margin-top:8px;
background-color: #909090;
width: 90%; width: 90%;
display: inline-block; display: inline-block;
} }

File diff suppressed because one or more lines are too long

View File

@ -1,24 +1,20 @@
enyo.kind({ enyo.kind({
name: "Assembler", name: "Assembler",
kind: "Scroller", // kind: "Scroller",
style: "background-color:#303030",
components: [ components: [
{tag: "center", components: [ {tag: "form", style:"margin-top:8px;margin-left:8px", attributes: {action:"javascript:#"}, components: [
{tag: "h1", style: "color:#f0f0f0", content: "Assembler"},
]},
{tag: "form", style:"margin-left:10px", attributes: {action:"javascript:#"}, components: [
{kind: "FittableRows", fit: true, components: [ {kind: "FittableRows", fit: true, components: [
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [ {kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
{tag: "p", content: "opcode", style:"margin-right:20px"}, {tag: "font", content: "opcode", style:"font-weight:bold;margin-right:20px"},
{kind: "Input", value: '', style:"width:90%", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "opcode"}, {kind: "Input", value: '', style:"width:89%", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "opcode"},
]}, ]},
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [ {kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
{tag: "p", content: "bytes", style:"margin-right:20px"}, {tag: "font", content: "bytes", style:"margin-right:20px;font-weight:bold"},
{kind: "Input", value: '', style:"width:90%", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "bytes"}, {kind: "Input", value: '', style:"width:120px", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "bytes"},
]}, ]},
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [ {kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
{tag: "p", content: "offset", style:"margin-right:20px"}, {tag: "font", content: "offset", style:"margin-right:20px;font-weight:bold"},
{kind: "Input", value: 'entry0', style:"width:90%", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "offset"}, {kind: "Input", value: 'entry0', style:"width:120px", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "offset"},
]} ]}
]} ]}
]} ]}

View File

@ -0,0 +1,7 @@
var Config = {
"keys": {
"C-1": "this.setIndex(0)",
"C-2": "this.setIndex(1)",
"C-3": "this.setIndex(2)",
}
}

View File

@ -2,12 +2,12 @@ enyo.kind({
name: "Console", name: "Console",
kind: "Scroller", kind: "Scroller",
tag: "div", tag: "div",
style:"margin-left:16px", style:"margin-left:8px",
components: [ components: [
{tag: "form", attributes: {action:"javascript:#"}, components: [ {tag: "form", attributes: {action:"javascript:#"}, components: [
{kind: "FittableRows", fit: true, classes: "fittable-sample-shadow", components: [ {kind: "FittableRows", fit: true, classes: "fittable-sample-shadow", components: [
{kind: "onyx.InputDecorator", style: "width: 90%;display:inline-block", components: [ {kind: "onyx.InputDecorator", style: "margin-top:8px;background-color:#404040;width: 90%;display:inline-block", components: [
{kind: "Input", style:"width:100%", value: '', onkeydown: "runCommand", attributes: {autocapitalize:"off"}, name: "input"}, {kind: "Input", style:"width:100%;color:white", value: '', onkeydown: "runCommand", attributes: {autocapitalize:"off"}, name: "input"},
]}, ]},
{tag: "pre", classes:"r2ui-terminal", style:"width:90%;", fit: true, allowHtml: true, name:"output"} {tag: "pre", classes:"r2ui-terminal", style:"width:90%;", fit: true, allowHtml: true, name:"output"}
]} ]}

View File

@ -5,21 +5,27 @@ enyo.kind({
style:"margin-left:16px", style:"margin-left:16px",
data: [ "pop eax", "push ecx", "jmp 0x80040", "call 0x80404", "xor eax, eax", "int 0x80" ], data: [ "pop eax", "push ecx", "jmp 0x80040", "call 0x80404", "xor eax, eax", "int 0x80" ],
components: [ components: [
{tag: "h2",content: "TODO : Disasm"}, {tag: "pre", allowHtml: true, name: "text", content: "TODO : Disasm"},
// 3 /*
{kind: "List", count:3, name: "list", style:"height:400px", realtimeFit:false, onSetupItem: "setupItem", components: [ {kind: "List", count:3, name: "list", style:"height:400px", realtimeFit:false, onSetupItem: "setupItem", components: [
{kind: "onyx.Item", layoutKind: "HFlexLayout", style:"padding:0px", components: [ {kind: "onyx.Item", layoutKind: "HFlexLayout", style:"padding:0px", components: [
{kind: "onyx.Button", name: "msg", fit:true, active: true, ontap: "rowTap"} {kind: "onyx.Button", name: "msg", fit:true, active: true, ontap: "rowTap"}
]} ]}
]} ]}
*/
], ],
create: function() { create: function() {
this.inherited (arguments); this.inherited (arguments);
this.$.list.setCount (this.data.length) ; // this.$.list.setCount (this.data.length) ;
var text = this.$.text;
r2.get_disasm ("entry0", 1024, function (x) {
x = r2.filter_asm (x, "pd");
text.setContent (x);
});
//this.refresh ();
}, },
setupItem: function (inSender, inIndex) { setupItem: function (inSender, inIndex) {
this.$.msg.setContent (this.data[inIndex.index]); //"patata"); //item.name); this.$.msg.setContent (this.data[inIndex.index]); //"patata"); //item.name);
return true; return true;
} }
}); });

View File

@ -7,20 +7,14 @@ enyo.kind ({
components: [ components: [
{ name: "lp", kind: "LeftPanel" }, { name: "lp", kind: "LeftPanel" },
{ name: "mp", kind: "MainPanel" }, { name: "mp", kind: "MainPanel" },
{ name: "rp", kind: "RightPanel" } { name: "rp", kind: "RightPanel" },
{ kind: enyo.Signals, onkeypress: "handleKeyPress" }
], ],
setPanel0: function () { setPanel0: function () {
this.$.RadareApp.setIndex (1); this.$.RadareApp.setIndex (1);
}, },
create: function() { create: function() {
this.inherited (arguments); this.inherited (arguments);
var mp = this.$.mp;
var ra = this.$.RadareApp;
this.$.lp.openCallback = function (idx) {
mp.openPage (idx);
};
this.$.mp.ra = this;
this.$.lp.ra = this;
var data = [ var data = [
{ name: "Disassembler", active: true }, { name: "Disassembler", active: true },
{ name: "Assembler" }, { name: "Assembler" },
@ -31,7 +25,44 @@ enyo.kind ({
]; ];
this.$.lp.data = data; this.$.lp.data = data;
this.$.mp.data = data; this.$.mp.data = data;
this.$.mp.ra =
this.$.lp.ra =
this.$.rp.ra = this;
var mp = this.$.mp;
this.$.lp.openCallback = function (idx) {
mp.openPage (idx);
};
this.$.lp.refresh (); this.$.lp.refresh ();
},
handleKeyPress: function(inSender, inEvent) {
for (var key in Config.keys) {
if (key.substring (0, 2) == "C-") {
if (inEvent.ctrlKey) {
var k = key.substring (2).charCodeAt (0);
if (inEvent.charCode == k) {
var cmd = Config.keys[key];
eval (cmd+";");
}
}
} else {
var k = key.substring (2).charCodeAt (0);
if (inEvent.charCode == k) {
var cmd = Config.keys[key];
eval (cmd+";");
}
}
}
//dump (inEvent);
//alert (inEvent.ctrlKey);
// Use inEvent.charCode to detect spacebar
/*
if (inEvent.charCode === 32) {
this.$.myContent.setContent("I thought");
} else {
var key = String.fromCharCode(inEvent.charCode).toUpperCase();
this.$.myContent.setContent("Last key pressed: " + key);
}
*/
} }
}); });

View File

@ -10,6 +10,7 @@ enyo.kind ({
{content: "Disassembler", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Disassembler", active: true}, {content: "Disassembler", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Disassembler", active: true},
{content: "Assembler", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Assembler" }, {content: "Assembler", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Assembler" },
{content: "Hexdump", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Hexdump" }, {content: "Hexdump", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Hexdump" },
{content: "Search", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Search" },
{content: "Console", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Console" }, {content: "Console", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Console" },
{content: "Settings", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Settings" }, {content: "Settings", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Settings" },
{content: "About", classes: "onyx-dark menu-button" , ontap: "openPanel", name:"About"}, {content: "About", classes: "onyx-dark menu-button" , ontap: "openPanel", name:"About"},

View File

@ -6,10 +6,12 @@ enyo.kind ({
classes: "enyo-fit", classes: "enyo-fit",
style: "background-color: #c0c0c0", style: "background-color: #c0c0c0",
data: null, data: null,
/*
refresh: function () { refresh: function () {
this.$.list.setCount (this.data.length); this.$.list.setCount (this.data.length);
this.$.list.refresh (); // necessary?? // inherit?? this.$.list.refresh (); // necessary?? // inherit??
}, },
*/
buttonClicked: function (x) { buttonClicked: function (x) {
alert ("let's play!"); alert ("let's play!");
}, },
@ -20,13 +22,14 @@ enyo.kind ({
{kind: "FittableColumns", noStretch: true, classes: "onyx-toolbar onyx-toolbar-inline", components: [ {kind: "FittableColumns", noStretch: true, classes: "onyx-toolbar onyx-toolbar-inline", components: [
{kind: "Scroller", thumb: false, fit: true, touch: false, vertical: "hidden", style: "margin: 0;", components: [ {kind: "Scroller", thumb: false, fit: true, touch: false, vertical: "hidden", style: "margin: 0;", components: [
{classes: "onyx-toolbar-inline", style: "white-space: nowrap;", components: [ {classes: "onyx-toolbar-inline", style: "white-space: nowrap;", components: [
{kind: "onyx.Button", content: "=", ontap: "openSidebar"}, {kind: "onyx.Button", content: "[", ontap: "openSidebar", style: "padding:8px"},
{kind: "onyx.Button", content: "]", ontap: "openSidebar2", style: "padding:8px"},
{kind: "onyx.Button", content: "<", ontap: "prevSeek"}, {kind: "onyx.Button", content: "<", ontap: "prevSeek"},
{kind: "onyx.Button", content: ">", ontap: "nextSeek"}, {kind: "onyx.Button", content: ">", ontap: "nextSeek"},
{kind: "onyx.InputDecorator", style: "width: 200px;", components: [ {kind: "onyx.InputDecorator", style: "width: 200px;", components: [
{kind: "onyx.Input", value: 'entry0', onchange: "gotoSeek"} {kind: "onyx.Input", value: 'entry0', onchange: "gotoSeek"}
]}, ]},
{kind: "onyx.Button", content: "Go", ontap: "gotoSeek"}, //{kind: "onyx.Button", content: "Go", ontap: "gotoSeek"},
{kind: "onyx.PickerDecorator", components: [ {kind: "onyx.PickerDecorator", components: [
{kind: "onyx.Button", content: "Actions"}, {kind: "onyx.Button", content: "Actions"},
{kind: "onyx.Picker", components: [ {kind: "onyx.Picker", components: [
@ -66,6 +69,7 @@ enyo.kind ({
{kind:"Disassembler", name: "pageDisassembler"}, {kind:"Disassembler", name: "pageDisassembler"},
{kind:"Assembler", name:"pageAssembler"}, {kind:"Assembler", name:"pageAssembler"},
{kind:"Hexdump", name: "pageHexdump"}, {kind:"Hexdump", name: "pageHexdump"},
{kind:"Search", name: "pageSearch"},
{kind:"Console", name: "pageConsole"}, {kind:"Console", name: "pageConsole"},
{kind:"Preferences", name:"pagePreferences"}, {kind:"Preferences", name:"pagePreferences"},
{kind:"About", name: "pageAbout"}, {kind:"About", name: "pageAbout"},
@ -81,6 +85,9 @@ enyo.kind ({
openSidebar: function() { openSidebar: function() {
this.ra.setIndex (this.ra.index? 0:1); this.ra.setIndex (this.ra.index? 0:1);
}, },
openSidebar2: function() {
this.ra.setIndex (2); //(this.ra.index<2)? 2:1);
},
rendered: function() { rendered: function() {
this.inherited(arguments); this.inherited(arguments);
}, },
@ -92,9 +99,10 @@ enyo.kind ({
case "Disassembler": idx = 0; break; case "Disassembler": idx = 0; break;
case "Assembler": idx = 1; break; case "Assembler": idx = 1; break;
case "Hexdump": idx = 2; break; case "Hexdump": idx = 2; break;
case "Console": idx = 3; break; case "Search": idx = 3; break;
case "Settings": idx = 4; break; case "Console": idx = 4; break;
case "About": idx = 5; break; case "Settings": idx = 5; break;
case "About": idx = 6; break;
} }
//x.setContent (str); //x.setContent (str);
sp.setIndex (idx); sp.setIndex (idx);

View File

@ -1,5 +1,13 @@
/* radare2 Copyleft 2013 pancake */
var r2 = {}; var r2 = {};
var backward = false;
var next_curoff = 0;
var next_lastoff = 0;
var prev_curoff = 0;
var prev_lastoff = 0;
r2.root = ""; // prefix path r2.root = ""; // prefix path
Array.prototype.push = function (x) { Array.prototype.push = function (x) {
@ -31,8 +39,7 @@ function Ajax (method, uri, body, fn) {
x.open (method, uri, false); x.open (method, uri, false);
x.setRequestHeader ('Accept', 'text/plain'); x.setRequestHeader ('Accept', 'text/plain');
x.setRequestHeader ('Accept', 'text/html'); x.setRequestHeader ('Accept', 'text/html');
x.setRequestHeader ("Content-Type", x.setRequestHeader ("Content-Type", "application/x-ww-form-urlencoded; charset=UTF-8");
"application/x-ww-form-urlencoded; charset=UTF-8");
x.onreadystatechange = function (y) { x.onreadystatechange = function (y) {
if (x.status == 200) { if (x.status == 200) {
if (fn) fn (x.responseText); if (fn) fn (x.responseText);
@ -48,10 +55,15 @@ r2.assemble = function (offset, opcode, fn) {
r2.disassemble = function (offset, bytes, fn) { r2.disassemble = function (offset, bytes, fn) {
var off = offset? "@"+offset:''; var off = offset? "@"+offset:'';
var str = 'pi 1@b:'+bytes+off; var str = 'pi @b:'+bytes+off;
r2.cmd (str, fn); r2.cmd (str, fn);
} }
r2.get_disasm = function (offset, length, cb) {
// TODO: honor offset and length
r2.cmd ("b 512;pd", cb);
}
r2.config_set = function (fn) { r2.config_set = function (fn) {
// TODO // TODO
} }
@ -61,12 +73,18 @@ r2.config_get = function (fn) {
} }
r2.set_flag_space = function (ns, fn) { r2.set_flag_space = function (ns, fn) {
// TODO r2.cmd ("fs "+ns, fn);
r2.cmd ("fs ", fn); }
r2.set_flag_space = function (ns, fn) {
r2.cmd ("fs "+ns, fn);
} }
r2.get_flags = function (fn) { r2.get_flags = function (fn) {
r2.cmd ("fj", fn); r2.cmd ("fj", function (x) {
if (x) x = JSON.parse (x);
fn (x);
});
} }
r2.get_opcodes = function (off, n, cb) { r2.get_opcodes = function (off, n, cb) {
@ -180,3 +198,93 @@ r2.get_logger = function (obj) {
} }
return obj; return obj;
} }
r2.filter_asm = function (x, display) {
var curoff = backward? prev_curoff: next_curoff;;
var lastoff = backward? prev_lastoff: next_lastoff;;
var lines = x.split (/\n/g);
r2.cmd ("s", function (x) { curoff = x; });
for (var i=lines.length-1;i>0;i--) {
var a = lines[i].match (/0x([a-fA-F0-9]*)/);
if (a && a.length>0) {
lastoff = a[0].replace (/:/g, "");
break;
}
}
if (display == "afl") {
//hasmore (false);
var z = "";
for (var i=0;i<lines.length;i++) {
var row = lines[i].replace (/\ +/g," ").split (/ /g);
z += row[0]+ " "+row[3]+"\n";
}
x = z;
} else
if (display[0] == 'f') {
//hasmore (false);
if (display[1] == 's') {
var z = "";
for (var i=0; i<lines.length; i++) {
var row = lines[i].replace (/\ +/g," ").split (/ /g);
var mark = row[1]=='*'? '*': ' ';
var space = row[2]? row[2]: row[1];
if (!space) continue;
z += row[0]+ " "+mark+" <a href=\"javascript:runcmd('fs "+
space+"')\">"+space+"</a>\n";
}
x = z;
} else {
}
} else
if (display[0] == "i") {
//hasmore (false);
if (display[1]) {
var z = "";
for (var i=0;i<lines.length;i++) {
var elems = lines[i].split (/ /g);
var name = "";
var addr = "";
for (var j=0;j<elems.length;j++) {
var kv = elems[j].split (/=/);
if (kv[0] == "addr") addr = kv[1];
if (kv[0] == "name") name = kv[1];
if (kv[0] == "string") name = kv[1];
}
z += addr+ " "+name+"\n";
}
x = z;
}
} //else hasmore (true);
function haveDisasm(x) {
if (x[0]=='p' && x[1]=='d') return true;
if (x.indexOf (";pd") != -1) return true;
return false;
}
if (haveDisasm (display)) {
x = x.replace (/function:/g,"<span style=color:red>function:</span>");
x = x.replace (/;(\s+)/g, ";");
x = x.replace (/;(.*)/g, "// <span style='color:red'>$1</span>");
x = x.replace (/(bl|call)/g, "<b style='color:green'>call</b>");
x = x.replace (/(jmp|bne|beq|jnz|jae|jge|jbe|jg|je|jl|jz|jb|ja|jne)/g, "<b style='color:green'>$1</b>");
x = x.replace (/(dword|qword|word|byte|movzx|movsxd|cmovz|mov\ |lea\ )/g, "<b style='color:orange'>$1</b>");
x = x.replace (/(hlt|leave|retn|ret)/g, "<b style='color:red'>$1</b>");
x = x.replace (/(add|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g, "<b style='color:orange'>$1</b>");
x = x.replace (/(push|pop)/g, "<b style='color:magenta'>$1</b>");
x = x.replace (/(test|cmp)/g, "<b style='color:green'>$1</b>");
x = x.replace (/nop/g, "<b style='color:blue'>nop</b>");
x = x.replace (/(sym|fcn|imp|loc).(.*)/g, "<a href='javascript:r2ui.seek(\"$1.$2\")'>$1.$2</a>");
}
x = x.replace (/0x([a-zA-Z0-9]*)/g, "<a href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
// registers
if (backward) {
prev_curoff = curoff;
prev_lastoff = lastoff;
} else {
next_curoff = curoff;
next_lastoff = lastoff;
if (!prev_curoff)
prev_curoff = next_curoff;
}
return x;
}

View File

@ -3,7 +3,10 @@ enyo.kind ({
classes: "onyx onyx-toolbar", classes: "onyx onyx-toolbar",
kind: "Control", kind: "Control",
style: "width:25px", style: "width:25px",
ra: null,
components: [ components: [
{kind: "FittableColumns", components: [
{kind: "onyx.Button", content: "[", ontap: "closeSidebar", style: "padding:8px;margin-right:8px"},
{kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [ {kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [
{content: "List elements"}, {content: "List elements"},
{kind: "onyx.Menu", components: [ {kind: "onyx.Menu", components: [
@ -25,6 +28,7 @@ enyo.kind ({
{tag: "h3", style:"background-color:red",name: "msg", fit:true, active: true, ontap: "rowTap"} {tag: "h3", style:"background-color:red",name: "msg", fit:true, active: true, ontap: "rowTap"}
]} ]}
]} ]}
]}
], ],
rowTap: function () { rowTap: function () {
/* do something here */ /* do something here */
@ -32,6 +36,7 @@ enyo.kind ({
create: function() { create: function() {
this.inherited (arguments); this.inherited (arguments);
this.$.list.setCount (3); this.$.list.setCount (3);
this.$.list.refresh();
}, },
data: [], data: [],
setupItem: function (inSender, inIndex) { setupItem: function (inSender, inIndex) {
@ -48,8 +53,12 @@ enyo.kind ({
// trycatch here or wtf // trycatch here or wtf
self.data = JSON.parse (flags); self.data = JSON.parse (flags);
self.$.list.setCount (self.data.length); self.$.list.setCount (self.data.length);
self.$.list.refresh();
}); });
break; break;
} }
},
closeSidebar: function() {
this.ra.setIndex (1);
} }
}); });

View File

@ -0,0 +1,10 @@
enyo.kind ({
name: "Search",
kind: "Scroller",
style: "background-color:#303030",
components: [
{tag: "center", components: [
{tag: "h1", style: "color:#f0f0f0", content: "TODO: Search"},
]}
]
});