Skip to content

Commit c5ddafe

Browse files
committed
Build the archlist for enyo/ instead of hardcoding it
1 parent be4f8d6 commit c5ddafe

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

www/enyo/js/about.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ enyo.kind({
88
{kind: 'Image', src: 'icon.png'},
99
{tag: 'h3', style: 'color:#707070;margin-bottom:50px',
1010
content: 'the web frontend for radare2'},
11-
{tag: 'h2', style: 'color:#a0a0a0', content: 'author: pancake 2013-2014'},
11+
{tag: 'h2', style: 'color:#a0a0a0', content: 'author: pancake 2013-2024'},
1212
{tag: 'h2', style: 'color:#a0a0a0', content: 'version: ???', name: 'vertext'},
1313
{tag: 'h2', style: 'color:#a0a0a0', content: 'revision: ???', name: 'revtext'}
1414
]}

www/enyo/js/settings.js

+17-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2+
const archList = [];
3+
r2.cmd("-a", function(curArch) {
4+
curArch = curArch.trim();
5+
r2.cmd("-a?", function(arches) {
6+
for (let arch of arches.trim().split("\n")) {
7+
const entry = {
8+
content: arch,
9+
active: (arch === curArch)
10+
};
11+
archList.push(entry);
12+
}
13+
})
14+
});
15+
116
enyo.kind({
217
name: 'Settings',
318
classes: 'panels-sample-sliding-content r2panel',
@@ -23,26 +38,7 @@ enyo.kind({
2338
{tag: 'p', content: 'Arch', classes: 'rowline'},
2439
{kind: 'onyx.PickerDecorator', components: [
2540
{},
26-
{kind: 'onyx.Picker', name: 'arch', components: [
27-
/* TODO: construct from code */
28-
{content: 'arc'},
29-
{content: 'arm'},
30-
{content: 'avr'},
31-
{content: 'ppc'},
32-
{content: 'bf'},
33-
{content: 'dalvik'},
34-
{content: 'dcpu16'},
35-
{content: 'i8080'},
36-
{content: 'java'},
37-
{content: 'm68k'},
38-
{content: 'mips'},
39-
{content: 'msil'},
40-
{content: 'rar'},
41-
{content: 'sh'},
42-
{content: 'sparc'},
43-
{content: 'x86', active: true},
44-
{content: 'z80'}
45-
]}
41+
{kind: 'onyx.Picker', name: 'arch', components: archList }
4642
]}
4743
]}
4844
,{kind: 'onyx.InputDecorator', components: [
@@ -127,7 +123,7 @@ enyo.kind({
127123
self.$.toggle_pseudo.setActive(r2.settings['asm.pseudo']);
128124
self.$.toggle_flags.setActive(r2.settings['asm.flags']);
129125
self.$.toggle_xrefs.setActive(r2.settings['asm.xrefs']);
130-
self.$.toggle_cmtright.setActive(r2.settings['asm.cmtright']);
126+
self.$.toggle_cmtright.setActive(r2.settings['asm.cmt.right']);
131127
self.$.toggle_offset.setActive(r2.settings['asm.offset']);
132128
self.$.toggle_lines.setActive(r2.settings['asm.lines']);
133129
var mode = readCookie('r2_view_mode');

0 commit comments

Comments
 (0)