Sync all webuis from r2w
@ -1,30 +0,0 @@
|
||||
.PHONY: index.js
|
||||
all: index.js
|
||||
|
||||
node_modules/.bin/uglifyjs:
|
||||
mkdir -p node_modules
|
||||
npm install uglify-js
|
||||
|
||||
debug:
|
||||
cat js/*.js > index.js
|
||||
|
||||
U=node_modules/.bin/uglifyjs
|
||||
index.js: $U
|
||||
# cat js/*.js > index.js
|
||||
cat js/*.js | $U > index.js || cat js/*.js > index.js
|
||||
|
||||
ENYO=http://enyojs.com/sampler/latest/build
|
||||
JOINT=http://www.jointjs.com/cms/downloads/
|
||||
|
||||
enyo-sync:
|
||||
mkdir -p build
|
||||
# ENYO UI
|
||||
wget -O build/enyo.css $(ENYO)/enyo.css
|
||||
wget -O build/enyo.js $(ENYO)/enyo.js
|
||||
wget -O build/app.css $(ENYO)/app.css
|
||||
wget -O build/app.js $(ENYO)/app.js
|
||||
# Joint.JS Graph
|
||||
wget -O build/joint.min.js $(JOINT)/joint.min.js
|
||||
wget -O build/joint.min.css $(JOINT)/joint.min.css
|
||||
# jQuery
|
||||
wget -O build/jquery.min.js http://code.jquery.com/jquery-2.0.3.min.js
|
@ -1,181 +0,0 @@
|
||||
|
||||
/* ../source/dom/dom.css */
|
||||
|
||||
/* things we always want */
|
||||
body {
|
||||
font-family: 'Helvetica Neue', 'Nimbus Sans L', Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* allow hw-accelerated scrolling on platforms that support it */
|
||||
body.webkitOverflowScrolling {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* for apps */
|
||||
.enyo-document-fit {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
/* note: giving html overflow: auto is odd and was only ever done to avoid duplication
|
||||
however, android 4.04 sometimes does not hide nodes when their display is set to none
|
||||
if document is overflow auto.
|
||||
*/
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.enyo-body-fit {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
/* helps prevent ios page scroll */
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.enyo-no-touch-action {
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
|
||||
/* reset */
|
||||
|
||||
button {
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
button::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* user selection */
|
||||
|
||||
.enyo-unselectable {
|
||||
cursor: default;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: -moz-none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.enyo-unselectable::selection, .enyo-unselectable ::selection {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.enyo-selectable {
|
||||
cursor: auto;
|
||||
-ms-user-select: element;
|
||||
-webkit-user-select: text;
|
||||
-moz-user-select: text;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.enyo-selectable::selection, .enyo-selectable ::selection {
|
||||
background: #3297FD;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* layout */
|
||||
|
||||
body .enyo-fit {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.enyo-clip {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.enyo-border-box {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* compositing */
|
||||
|
||||
.enyo-composite {
|
||||
-webkit-transform: translateZ(0);
|
||||
-moz-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
-o-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
|
||||
/* ../source/touch/Thumb.css */
|
||||
|
||||
.enyo-thumb {
|
||||
position: absolute;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
background: #333;
|
||||
border: 1px solid #666;
|
||||
opacity: 0.75;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.enyo-vthumb {
|
||||
top: 0;
|
||||
right: 2px;
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.enyo-hthumb {
|
||||
left: 0;
|
||||
bottom: 2px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
|
||||
/* ../source/touch/Scroller.css */
|
||||
|
||||
.enyo-scroller {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.enyo-fit.enyo-scroller {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.enyo-touch-scroller {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.enyo-touch-strategy-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.enyo-scrollee-fit {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* ../source/ui/ui.css */
|
||||
|
||||
.enyo-inline, .enyo-tool-decorator {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.enyo-children-inline > *, .enyo-tool-decorator > * {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.enyo-children-middle > *, .enyo-tool-decorator > * {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.enyo-positioned {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.enyo-fill {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.enyo-popup {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.b0xff { color: red; }
|
||||
.b0x00 { color: yellow; }
|
||||
.b0x7f { color: orange; }
|
||||
.other { color: #f07; }
|
||||
.offset { color: yellow ; }
|
||||
.other { color: blue; }
|
||||
.push { color: green; }
|
||||
.cjmp { color: #ff0; }
|
||||
.call { color: #f0f; }
|
||||
h3 {
|
||||
color: white;
|
||||
font-family: Verdana;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
spacing:0px;
|
||||
}
|
||||
body { background-color:#202020; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table style=width:100%>
|
||||
<tr>
|
||||
<td width="100%" valign=top>
|
||||
<div style='overflow:hidden'>
|
||||
<pre>
|
||||
<font class='prompt'>[0x000027ba]> </font> <font style='color:#f0f0f0'>pd 42</font>
|
||||
<font class='fline'>/</font> <font class='fname'>(fcn) entry0 1495</font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027ba</font> <font class='cjmp'>41<font class='cjmp'>54</font> </font><font class='push'>push<font class='reg'> r12</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027bb</font> <font class='cjmp'>58</font> </font><font class='pop'>pop<font class='reg'> rax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027bc</font> <font class='cjmp'>53</font> </font><font class='push'>push<font class='reg'> rbx</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027bd</font> <font class='cjmp'>48<font class='other'>81<font class='other'>ec<font class='cjmp'>48<font class='other'>06<font class='other'>0.</font> </font><font class='other'>sub<font class='reg'> rsp</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x648</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027c4</font> <font class='cjmp'>49<font class='other'>89<font class='other'>f5</font> </font><font class='mov'>mov<font class='reg'> r13</font>,<font class='b0xff'><font class='reg'> rsi</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027c7</font> <font class='other'>89<font class='other'>bd<font class='other'>b0<font class='other'>f9<font class='b0xff'>ff<font class='b0xff'>ff</font> </font><font class='mov'>mov<font class='b0xff'> </font>[<font class='b0xff'>rbp</font>-<font class='b0xff'><font class='push'>0x650</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='reg'> edi</font></font>
|
||||
<font class='fline'>|</font> <font class='comment'> ; jaja</font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027cd</font> <font class='cjmp'>48<font class='other'>8d<font class='other'>85<font class='other'>c0<font class='other'>f9<font class='other'>f.</font> </font><font class='push'>lea<font class='reg'> rax</font>,<font class='b0xff'><font class='b0xff'> </font>[<font class='b0xff'>rbp</font>-<font class='b0xff'><font class='push'>0x640</font>]<font class='b0xff'></font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027d4</font> <font class='cjmp'>48<font class='other'>89<font class='other'>85<font class='other'>b8<font class='other'>f9<font class='other'>f.</font> </font><font class='mov'>mov<font class='b0xff'> </font>[<font class='b0xff'>rbp</font>-<font class='b0xff'><font class='push'>0x648</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='reg'> rax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027db</font> <font class='other'>85<font class='b0xff'>ff</font> </font><font class='cmp'>test<font class='reg'> edi</font>,<font class='b0xff'><font class='reg'> edi</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,=< </font><font class='offset'>0x000027dd</font> <font class='b0x7f'>7f<font class='other'>05</font> </font><font class='cjmp'>jg 0x27e4</font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x000027df</font> <font class='other'>e8<font class='other'>b1<font class='cjmp'>30<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call 0x5895</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> | </font> 0x00005895(unk, unk) ; entry0</font>
|
||||
<font class='fline'>|</font> <font class='flow'> `-> </font><font class='offset'>0x000027e4</font> <font class='cjmp'>48<font class='other'>8d<font class='cjmp'>35<font class='other'>1d<font class='cjmp'>37<font class='other'>0.</font> </font><font class='push'>lea<font class='reg'> rsi</font>,<font class='b0xff'><font class='b0xff'> </font>[<font class='b0xff'>rip</font>+<font class='b0xff'><font class='push'>0x371d</font>]<font class='b0xff'></font></font> <font class='comment'>; 0x00005f08 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027eb</font> <font class='cjmp'>31<font class='b0xff'>ff</font> </font><font class='math'>xor<font class='reg'> edi</font>,<font class='b0xff'><font class='reg'> edi</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027ed</font> <font class='other'>e8<font class='cjmp'>2e<font class='cjmp'>32<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call sym.imp.setlocale</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> </font> 0x00005a20() ; sym.imp.setlocale</font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027f2</font> <font class='other'>bb<font class='other'>01<font class='b0x00'>00<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='mov'>mov<font class='reg'> ebx</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x1</font></font> <font class='comment'>; 0x00000001 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027f7</font> <font class='other'>bf<font class='other'>01<font class='b0x00'>00<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='mov'>mov<font class='reg'> edi</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x1</font></font> <font class='comment'>; 0x00000001 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x000027fc</font> <font class='other'>e8<font class='other'>cb<font class='cjmp'>31<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call sym.imp.isatty</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> </font> 0x000059cc() ; sym.imp.isatty</font>
|
||||
<font class='fline'>|</font> <font class='flow'> </font><font class='offset'>0x00002801</font> <font class='other'>85<font class='other'>c0</font> </font><font class='cmp'>test<font class='reg'> eax</font>,<font class='b0xff'><font class='reg'> eax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,==< </font><font class='offset'>0x00002803</font> <font class='cjmp'>74<font class='cjmp'>60</font> </font><font class='cjmp'>je 0x2865</font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x00002805</font> <font class='other'>c7<font class='other'>05<font class='cjmp'>59<font class='cjmp'>3e<font class='b0x00'>00<font class='other'>0.</font> </font><font class='mov'>mov dword<font class='b0xff'> </font>[<font class='b0xff'>rip</font>+<font class='b0xff'><font class='push'>0x3e59</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x50</font></font> <font class='comment'>; "P" ; 0x00000050 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x0000280f</font> <font class='cjmp'>48<font class='other'>8d<font class='cjmp'>3d<font class='other'>f3<font class='cjmp'>36<font class='other'>0.</font> </font><font class='push'>lea<font class='reg'> rdi</font>,<font class='b0xff'><font class='b0xff'> </font>[<font class='b0xff'>rip</font>+<font class='b0xff'><font class='push'>0x36f3</font>]<font class='b0xff'></font></font> <font class='comment'>; 0x00005f09 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x00002816</font> <font class='other'>e8<font class='cjmp'>7b<font class='cjmp'>31<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call sym.imp.getenv</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> | </font> 0x00005996() ; sym.imp.getenv</font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x0000281b</font> <font class='cjmp'>48<font class='other'>85<font class='other'>c0</font> </font><font class='cmp'>test<font class='reg'> rax</font>,<font class='b0xff'><font class='reg'> rax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,===< </font><font class='offset'>0x0000281e</font> <font class='cjmp'>74<font class='other'>0f</font> </font><font class='cjmp'>je 0x282f</font>
|
||||
<font class='fline'>|</font> <font class='flow'> || </font><font class='offset'>0x00002820</font> <font class='other'>80<font class='cjmp'>38<font class='b0x00'>00</font> </font><font class='cmp'>cmp byte<font class='b0xff'> </font>[<font class='b0xff'>rax</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x0</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,====< </font><font class='offset'>0x00002823</font> <font class='cjmp'>74<font class='other'>0a</font> </font><font class='cjmp'>je 0x282f</font>
|
||||
<font class='fline'>|</font> <font class='flow'> ||| </font><font class='offset'>0x00002825</font> <font class='cjmp'>48<font class='other'>89<font class='other'>c7</font> </font><font class='mov'>mov<font class='reg'> rdi</font>,<font class='b0xff'><font class='reg'> rax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ||| </font><font class='offset'>0x00002828</font> <font class='other'>e8<font class='other'>0f<font class='cjmp'>31<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call sym.imp.atoi</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> ||| </font> 0x0000593c() ; sym.imp.atoi</font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,=====< </font><font class='offset'>0x0000282d</font> <font class='other'>eb<font class='cjmp'>22</font> </font><font class='jmp'>jmp 0x2851</font>
|
||||
<font class='fline'>|</font> <font class='flow'> |``---> </font><font class='offset'>0x0000282f</font> <font class='cjmp'>48<font class='other'>8d<font class='cjmp'>55<font class='other'>d0</font> </font><font class='push'>lea<font class='reg'> rdx</font>,<font class='b0xff'><font class='b0xff'> </font>[<font class='b0xff'>rbp</font>-<font class='b0xff'><font class='push'>0x30</font>]<font class='b0xff'></font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> | | </font><font class='offset'>0x00002833</font> <font class='other'>bf<font class='other'>01<font class='b0x00'>00<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='mov'>mov<font class='reg'> edi</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x1</font></font> <font class='comment'>; 0x00000001 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> | | </font><font class='offset'>0x00002838</font> <font class='other'>be<font class='cjmp'>68<font class='cjmp'>74<font class='other'>08<font class='cjmp'>40</font> </font><font class='mov'>mov<font class='reg'> esi</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x40087468</font></font> <font class='comment'>; 0x40087468 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> | | </font><font class='offset'>0x0000283d</font> <font class='cjmp'>30<font class='other'>c0</font> </font><font class='math'>xor<font class='reg'> al</font>,<font class='b0xff'><font class='reg'> al</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> | | </font><font class='offset'>0x0000283f</font> <font class='other'>e8<font class='other'>82<font class='cjmp'>31<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='call'>call sym.imp.ioctl</font>
|
||||
<font class='fline'>|</font><font class='b0xff'> </font><font class='flow'> | | </font> 0x000059c6() ; sym.imp.ioctl</font>
|
||||
<font class='fline'>|</font> <font class='flow'> | | </font><font class='offset'>0x00002844</font> <font class='other'>83<font class='other'>f8<font class='b0xff'>ff</font> </font><font class='cmp'>cmp<font class='reg'> eax</font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0xffffffff</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> ,======< </font><font class='offset'>0x00002847</font> <font class='cjmp'>74<font class='other'>0e</font> </font><font class='cjmp'>je 0x2857</font>
|
||||
<font class='fline'>|</font> <font class='flow'> || | </font><font class='offset'>0x00002849</font> <font class='other'>0f<font class='other'>b7<font class='cjmp'>45<font class='other'>d2</font> </font><font class='other'>movzx<font class='reg'> eax</font>,<font class='b0xff'> word<font class='b0xff'> </font>[<font class='b0xff'>rbp</font>-<font class='b0xff'><font class='push'>0x2e</font>]<font class='b0xff'></font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> || | </font><font class='offset'>0x0000284d</font> <font class='other'>85<font class='other'>c0</font> </font><font class='cmp'>test<font class='reg'> eax</font>,<font class='b0xff'><font class='reg'> eax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'>,=======< </font><font class='offset'>0x0000284f</font> <font class='cjmp'>74<font class='other'>06</font> </font><font class='cjmp'>je 0x2857</font>
|
||||
<font class='fline'>|</font> <font class='flow'>||`-----> </font><font class='offset'>0x00002851</font> <font class='other'>89<font class='other'>05<font class='other'>11<font class='cjmp'>3e<font class='b0x00'>00<font class='b0x00'>00</font> </font><font class='mov'>mov<font class='b0xff'> </font>[<font class='b0xff'>rip</font>+<font class='b0xff'><font class='push'>0x3e11</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='reg'> eax</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'>``------> </font><font class='offset'>0x00002857</font> <font class='other'>c7<font class='other'>05<font class='cjmp'>7b<font class='cjmp'>41<font class='b0x00'>00<font class='other'>0.</font> </font><font class='mov'>mov dword<font class='b0xff'> </font>[<font class='b0xff'>rip</font>+<font class='b0xff'><font class='push'>0x417b</font>]<font class='b0xff'></font>,<font class='b0xff'><font class='b0xff'> <font class='push'>0x1</font></font> <font class='comment'>; 0x00000001 </font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x00002861</font> <font class='cjmp'>31<font class='other'>db</font> </font><font class='math'>xor<font class='reg'> ebx</font>,<font class='b0xff'><font class='reg'> ebx</font></font>
|
||||
<font class='fline'>|</font> <font class='flow'> | </font><font class='offset'>0x00002863</font> <font class='other'>eb<font class='other'>1f</font> </font><font class='jmp'>jmp 0x2884</font>
|
||||
</pre>
|
||||
</div>
|
||||
</td>
|
||||
<td valign=top style='height:100%'>
|
||||
<center>
|
||||
<h3>r2 theme</h3>
|
||||
</center>
|
||||
<br />
|
||||
<textarea id='profile' rows=40 style='border:0;padding:3px;background-color:#a0a0a0'>
|
||||
ec comment rgb:dd2
|
||||
ec fname rgb:7d7
|
||||
ec fline rgb:fd7
|
||||
ec help yellow
|
||||
ec args blue
|
||||
ec flag rgb:557
|
||||
ec label rgb:ffd
|
||||
ec flow rgb:fa2
|
||||
ec prompt rgb:d52
|
||||
ec offset rgb:5df
|
||||
ec input rgb:a52
|
||||
ec other rgb:5a7
|
||||
ec b0x00 rgb:a52
|
||||
ec b0x7f rgb:522
|
||||
ec b0xff rgb:a2a
|
||||
ec math rgb:755
|
||||
ec bin rgb:f75
|
||||
ec btext rgb:5df
|
||||
ec push rgb:dad
|
||||
ec pop rgb:555
|
||||
ec jmp rgb:22d
|
||||
ec cjmp rgb:552
|
||||
ec call rgb:275
|
||||
ec nop rgb:d55
|
||||
ec ret rgb:777
|
||||
ec trap rgb:5da
|
||||
ec swi rgb:2dd
|
||||
ec cmp rgb:d7d
|
||||
ec reg rgb:5dd
|
||||
ec creg rgb:5dd
|
||||
ec num rgb:7d7
|
||||
ec mov rgb:f72
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
function setColor(X,Y) {
|
||||
/* radare to html rgb syntax */
|
||||
try {
|
||||
if (Y.substr(0,4)=='rgb:') {
|
||||
var rgb = '#';
|
||||
rgb+=Y[4]; rgb+=Y[4];
|
||||
rgb+=Y[5]; rgb+=Y[5];
|
||||
rgb+=Y[6]; rgb+=Y[6];
|
||||
Y = rgb;
|
||||
}
|
||||
var x = document.getElementsByClassName (X);
|
||||
for (var i in x) { try { x[i].style.color=Y;}catch(e) {} }
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateProfile() {
|
||||
var txt = document.getElementById('profile').value;
|
||||
var lines = txt.replace(/ec\ /g,'').split("\n")
|
||||
for (row in lines) {
|
||||
var kv = lines[row].split(' ')
|
||||
setColor(kv[0],kv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('profile').onkeyup = function() {
|
||||
updateProfile();
|
||||
}
|
||||
updateProfile();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,176 +0,0 @@
|
||||
.bbcanvas { float: left; }
|
||||
|
||||
.flatcanvas { float: left; }
|
||||
|
||||
.insaddr {
|
||||
min-width: 7em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#outergbox {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.instruction {
|
||||
font-family: monospace;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.instructiondesc {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.data {
|
||||
text-align: right;
|
||||
min-width: 18px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.instructionbox {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#gbox {
|
||||
position: relative;
|
||||
/*margin: 10px;*/
|
||||
}
|
||||
|
||||
.bytes {
|
||||
display: inline-block;
|
||||
width: 170px;
|
||||
}
|
||||
|
||||
input:focus {outline: none; }
|
||||
|
||||
.ec_fline {color: rgb(0,127,127);}
|
||||
.ec_help {color: rgb(0,127,127);}
|
||||
.ec_args {color: rgb(0,127,127);}
|
||||
.ec_label {color: rgb(0,127,127);}
|
||||
.ec_flow {color: rgb(0,127,127);}
|
||||
.ec_prompt {color: rgb(0,127,127);}
|
||||
.ec_input {color: rgb(0,127,127);}
|
||||
.ec_btext {color: rgb(0,127,127);}
|
||||
.ec_swi {color: rgb(0,127,127);}
|
||||
.ec_comment {color: rgb(0,127,127);}
|
||||
.ec_fname {color: rgb(127,0,0);}
|
||||
.ec_flag {color: rgb(0,127,127);}
|
||||
.ec_offset {color: rgb(0,127,0);}
|
||||
.ec_other {color: rgb(127,127,127);} /* byte color bu default */
|
||||
.ec_b0x00 {color: rgb(0,127,0);}
|
||||
.ec_b0x7f {color: rgb(0,127,127);}
|
||||
.ec_b0xff {color: rgb(127,0,0);}
|
||||
.ec_math {color: rgb(127,127,0);}
|
||||
.ec_bin {color: rgb(127,127,0);}
|
||||
.ec_push {color: rgb(127,0,127);}
|
||||
.ec_pop {color: rgb(255,0,255);}
|
||||
.ec_jmp {color: rgb(0,127,0);}
|
||||
.ec_cjmp {color: rgb(0,127,0);}
|
||||
.ec_call {color: rgb(0,255,0);}
|
||||
.ec_nop {color: rgb(0,0,127);}
|
||||
.ec_ret {color: rgb(127,0,0);}
|
||||
.ec_trap {color: rgb(255,0,0);}
|
||||
.ec_invalid {color: rgb(255,0,0);}
|
||||
.ec_cmp {color: rgb(0,127,127);}
|
||||
.ec_reg {color: rgb(0,127,127);} /* (also applies to qword, brackets, etc) */
|
||||
.ec_creg {color: rgb(0,127,127);}
|
||||
.ec_mov {color: rgb(127,127,127);}
|
||||
.ec_num {color: rgb(127,127,0);}
|
||||
|
||||
.ec_gui_cflow {color: rgb(255,255,0);}
|
||||
.ec_gui_dataoffset {color: rgb(127,127,0);}
|
||||
.ec_gui_background {background-color: rgb(20,20,20); }
|
||||
.ec_gui_alt_background {background-color: rgb(50,50,50); }
|
||||
.ec_gui_border {border-color: rgb(50,50,50); }
|
||||
|
||||
.autohighlight { background-color: #8AFF77 !important; }
|
||||
.autohighlighti { background-color: #8AFF77; }
|
||||
|
||||
.hidden {display:none;}
|
||||
|
||||
.lines {margin-left: 100px;}
|
||||
|
||||
.basicblock {
|
||||
border: 1px solid;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
-webkit-user-select: none;
|
||||
box-sizing: border-box;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.basicblock .instruction,
|
||||
.basicblock input {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
background: transparent;
|
||||
width:100%;
|
||||
height:100%;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
#canvas svg,
|
||||
#minimap svg {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#minimap svg .link,
|
||||
#canvas svg .link {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#minimap svg .connection {
|
||||
stroke-width: 5;
|
||||
}
|
||||
|
||||
#minimap {
|
||||
/*border: 1px solid black;*/
|
||||
position:absolute;
|
||||
width:200px;
|
||||
height:200px;
|
||||
z-index: 1000;
|
||||
background: #999;
|
||||
/*opacity: 0.8;*/
|
||||
filter: alpha(opacity=80); [> For IE8 and earlier <]
|
||||
}
|
||||
|
||||
#minimap .basicblock {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#canvas #minimap_area {
|
||||
display: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#canvas #minimap_area svg {
|
||||
stroke: transparent;
|
||||
}
|
||||
|
||||
#minimap_area {
|
||||
border: 1px solid black;
|
||||
position:absolute;
|
||||
background: black;
|
||||
opacity: 0.2;
|
||||
filter: alpha(opacity=20); /* For IE8 and earlier */
|
||||
}
|
||||
|
||||
#radareApp_mp_panels_pageDisassembler {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#main_panel {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.right_label {
|
||||
float: right;
|
||||
}
|
||||
|
1
shlr/www/enyo/disassembler_old.js
Normal file
@ -0,0 +1 @@
|
||||
function docss(t){return"<font color=black>"+t+"</font>"}enyo.kind({name:"DisassemblerOld",kind:"Scroller",tag:"div",style:"margin:0px;background-color:#c0c0c0",data:null,components:[{tag:"div",allowHtml:!0,classes:"colorbar",name:"colorbar"},{tag:"br"},{tag:"div",content:"^",classes:"moreless",ontap:"less"},{tag:"pre",allowHtml:!0,name:"text",content:"..",style:"margin-left:5px"},{tag:"div",content:"v",classes:"moreless",ontap:"more"}],min:0,max:0,block:512,base:"entry0",less:function(){var t=this.$.text;this.min+=this.block,r2.get_disasm(this.base+"-"+this.min,this.block,function(e){e=docss(r2.filter_asm(e,"pd"));var s=r2ui._dis.getScrollBounds().height;t.setContent("<div class='enyo-selectable'>"+e+t.getContent()+"</div>");var i=r2ui._dis.getScrollBounds().height;r2ui._dis.scrollTo(0,i-s)})},more:function(){var t=this.$.text;this.max+=this.block,r2.get_disasm(this.base+"+"+this.max,this.block,function(e){e=docss(r2.filter_asm(e,"pd")),t.setContent("<div class='enyo-selectable'>"+t.getContent()+e+"</div>")})},seek:function(t){var e=this.$.text;this.base=t,this.min=this.max=0,r2.get_disasm(t,this.block,function(t){t=docss(r2.filter_asm(t,"pd")),e.setContent("<div class='enyo-selectable'>"+t+"</div>")}),this.scrollTo(0,0)},create:function(){this.inherited(arguments);this.$.text;r2.cmd("e asm.lineswidth = 20",function(t){}),this.seek("entry0"),r2ui._dis=this,r2ui.history_push("entry0")},colorbar_create:function(){var t=this;r2.cmd("p-j 24",function(e){try{var s=JSON.parse(e)}catch(i){return void alert(i)}console.log(s);for(var o="<table class='colorbar'><tr valign=top style='height:8px;border-spacing:0'>",r={flags:"#c0c0c0",comments:"yellow",functions:"#5050f0",strings:"orange"},n="",l=16,a=0;a<s.blocks.length;a++){var c=s.blocks[a],d="<div style='overflow:hidden;width:12px;'>____</div>";if(c.offset){var d="<table width='width:100%' height="+l+" style='border-spacing:0px'>",h=0;for(var b in r)c[b]&&h++;if(h++,1==h)break;var m=l/h;for(var b in r){r[b];c[b]&&(d+="<tr><td class='colorbar_item' style='background-color:"+r[b]+"'><div style='width:12px;overflow:hidden;height:"+m+"px'>____</div></td></tr>")}d+="</table>",n="0x"+c.offset.toString(16)}else n="0x"+(s.from+s.blocksize*a).toString(16);o+="<td onclick='r2ui.seek("+n+",true)' title='"+n+"' style='height:"+l+"px' width=15px>"+d+"</td>"}o+="</tr></table>",t.$.colorbar.setContent(o)})}});
|
2
shlr/www/enyo/enyo.css
Normal file
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 1.4 KiB |
BIN
shlr/www/enyo/gradient-invert.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
shlr/www/enyo/gradient.png
Normal file
After Width: | Height: | Size: 255 B |
@ -1,134 +0,0 @@
|
||||
a {
|
||||
color: #3030a0;
|
||||
}
|
||||
.sourcecode {
|
||||
width:280px;
|
||||
height:200px;
|
||||
margin-left:10px;
|
||||
font-size:12px;
|
||||
background-color:#e0e0e0;
|
||||
font-family: Consolas, monospace;
|
||||
}
|
||||
|
||||
.sourcebutton {
|
||||
margin:4px;
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding-left:14px;
|
||||
}
|
||||
|
||||
.app-panels > * {
|
||||
width: 320px;
|
||||
background-color: #eaeaea;
|
||||
box-shadow: -4px -4px 4px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.menu-button {
|
||||
clear:none;
|
||||
float:left;
|
||||
margin:10px !important;
|
||||
width:150px;
|
||||
}
|
||||
|
||||
.rowline {
|
||||
width:200px;
|
||||
color:black;
|
||||
}
|
||||
|
||||
@media all and (max-width: 600px) {
|
||||
.app-panels > * {
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.onyx-sample-tools {
|
||||
padding-bottom:10px;
|
||||
}
|
||||
.onyx-sample-tools > * {
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.r2ui-terminal {
|
||||
color: black;
|
||||
editable: false;
|
||||
}
|
||||
|
||||
.r2ui-label {
|
||||
color:black;
|
||||
}
|
||||
|
||||
.r2ui-input {
|
||||
color: black;
|
||||
margin-top:8px;
|
||||
background-color: #909090;
|
||||
width: 90%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* TODO: :hover change mouse pointer */
|
||||
.moreless:hover {
|
||||
background-color:#d0d0d0;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.moreless {
|
||||
background-color:#a0a0a0;
|
||||
width:90%;
|
||||
height:24px;
|
||||
padding-left:10px;
|
||||
border:0px;
|
||||
}
|
||||
|
||||
.r2panel {
|
||||
color: black !important;
|
||||
/*background-color:#b0b0b0;*/
|
||||
/* padding-left:8px; */
|
||||
}
|
||||
|
||||
.colorbar {
|
||||
padding: 0px;
|
||||
border-spacing:0px;
|
||||
spacing: 0px;
|
||||
border: 0px;
|
||||
height: 16px;
|
||||
background-color: black;
|
||||
width: 380px;
|
||||
max-width:100%;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
.colorbar_item {
|
||||
max-width:100%;
|
||||
width:100%;
|
||||
border:0px;
|
||||
spacing:0px;
|
||||
padding:0px;
|
||||
}
|
||||
.topbox {
|
||||
position:absolute;
|
||||
left: 70px;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
top:0px;
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.top {
|
||||
display:inline-block;
|
||||
position:relative;
|
||||
vertical-align:top;
|
||||
padding:10px;
|
||||
margin:1px;
|
||||
margin-top:0px;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.addr {
|
||||
-moz-user-select: text;
|
||||
}
|
@ -7,18 +7,32 @@
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="icon.png"/>
|
||||
<title> onyx r2ui </title>
|
||||
<!-- enyo+onyx -->
|
||||
<script type='text/javascript' src='build/enyo.js'></script>
|
||||
<script type='text/javascript' src='build/app.js'></script>
|
||||
<link href="build/enyo.css" rel="stylesheet">
|
||||
<link href="build/app.css" rel="stylesheet">
|
||||
<!-- my code -->
|
||||
<script type='text/javascript' src="index.js"> </script>
|
||||
<link href="index.css" rel="stylesheet">
|
||||
<link href="disasm.css" rel="stylesheet">
|
||||
<link href="joint.min.css" rel="stylesheet" />
|
||||
<link href="../p/lib/css/layout-default-latest.css" rel="stylesheet" />
|
||||
<link href="../p/lib/css/main.css" rel="stylesheet" />
|
||||
|
||||
<!-- bower deps -->
|
||||
<script type="text/javascript" src="vendors/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="vendors/jquery.scrollTo.min.js"></script>
|
||||
<script type="text/javascript" src="vendors/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="vendors/jquery.layout-latest.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="vendors/lodash.min.js"></script>
|
||||
<script type="text/javascript" src="vendors/backbone-min.js"></script>
|
||||
|
||||
<link href="vendors/joint.min.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="vendors/joint.min.js"></script>
|
||||
<script type="text/javascript" src="vendors/joint.layout.DirectedGraph.js"></script>
|
||||
|
||||
<!-- enyo CP -->
|
||||
<script type="text/javascript" src="enyo_app.js"></script>
|
||||
<link href="enyo.css" rel="stylesheet" />
|
||||
|
||||
<!-- r2 core : r2, r2ui, disasm -->
|
||||
<script type="text/javascript" src="disassembler_old.js"></script>
|
||||
<script type="text/javascript" src="r2core.js"></script>
|
||||
<script type="text/javascript" src="r2app.js"></script>
|
||||
|
||||
<!-- Global CSS except enyo -->
|
||||
<link href="stylesheet.css" rel="stylesheet" />
|
||||
<link href="r2core.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
|
9
shlr/www/enyo/joint.min.css
vendored
@ -1,9 +0,0 @@
|
||||
/*! JointJS v0.9.2 - JavaScript diagramming library 2014-09-17
|
||||
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
.viewport{-webkit-user-select:none;-moz-user-select:none;user-select:none}[magnet=true]:not(.element){cursor:crosshair}[magnet=true]:not(.element):hover{opacity:.7}.element{cursor:move}.element *{vector-effect:non-scaling-stroke;-moz-user-select:none;user-drag:none}.connection-wrap{fill:none;stroke:#000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;opacity:0;cursor:move}.connection-wrap:hover{opacity:.4;stroke-opacity:.4}.connection{fill:none;stroke-linejoin:round}.marker-source,.marker-target{vector-effect:non-scaling-stroke}.marker-vertices{opacity:0;cursor:move}.marker-arrowheads{opacity:0;cursor:move;cursor:-webkit-grab;cursor:-moz-grab}.link-tools{opacity:0;cursor:pointer}.link-tools .tool-options{display:none}.link-tools .tool-remove circle{fill:red}.link-tools .tool-remove path{fill:#fff}.link:hover .marker-vertices,.link:hover .marker-arrowheads,.link:hover .link-tools{opacity:1}.marker-vertex{fill:#1ABC9C}.marker-vertex:hover{fill:#34495E;stroke:none}.marker-arrowhead{fill:#1ABC9C}.marker-arrowhead:hover{fill:#F39C12;stroke:none}.marker-vertex-remove{cursor:pointer;opacity:.1;fill:#fff}.marker-vertex-group:hover .marker-vertex-remove{opacity:1}.marker-vertex-remove-area{opacity:.1;cursor:pointer}.marker-vertex-group:hover .marker-vertex-remove-area{opacity:1}.highlighted{opacity:.7}text.highlighted{fill:red}@media screen and (-webkit-min-device-pixel-ratio:0){.highlighted{outline:2px solid red;opacity:initial}}.element .fobj body{background-color:transparent;margin:0}.element .fobj div{text-align:center;vertical-align:middle;display:table-cell;padding:0 5px}
|
@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Default Layout Theme
|
||||
*
|
||||
* Created for jquery.layout
|
||||
*
|
||||
* Copyright (c) 2010
|
||||
* Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
* Kevin Dalman (http://allpro.net)
|
||||
*
|
||||
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
*
|
||||
* Last Updated: 2010-02-10
|
||||
* NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars
|
||||
*/
|
||||
|
||||
/*
|
||||
* DEFAULT FONT
|
||||
* Just to make demo-pages look better - not actually relevant to Layout!
|
||||
*/
|
||||
body {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 100%;
|
||||
*font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
* PANES & CONTENT-DIVs
|
||||
*/
|
||||
.ui-layout-pane { /* all 'panes' */
|
||||
border: 1px solid #BBB;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
/* DO NOT add scrolling (or padding) to 'panes' that have a content-div,
|
||||
otherwise you may get double-scrollbars - on the pane AND on the content-div
|
||||
- use ui-layout-wrapper class if pane has a content-div
|
||||
- use ui-layout-container if pane has an inner-layout
|
||||
*/
|
||||
}
|
||||
/* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */
|
||||
.ui-layout-content {
|
||||
padding: 10px;
|
||||
position: relative; /* contain floated or positioned elements */
|
||||
overflow: auto; /* add scrolling to content-div */
|
||||
}
|
||||
|
||||
/*
|
||||
* UTILITY CLASSES
|
||||
* Must come AFTER pane-class above so will override
|
||||
* These classes are NOT auto-generated and are NOT used by Layout
|
||||
*/
|
||||
.layout-child-container,
|
||||
.layout-content-container {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.layout-child-container {
|
||||
border: 0; /* remove border because inner-layout-panes probably have borders */
|
||||
}
|
||||
.layout-scroll {
|
||||
overflow: auto;
|
||||
}
|
||||
.layout-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* RESIZER-BARS
|
||||
*/
|
||||
.ui-layout-resizer { /* all 'resizer-bars' */
|
||||
background: #DDD;
|
||||
border: 1px solid #BBB;
|
||||
border-width: 0;
|
||||
}
|
||||
.ui-layout-resizer-drag { /* REAL resizer while resize in progress */
|
||||
}
|
||||
.ui-layout-resizer-hover { /* affects both open and closed states */
|
||||
}
|
||||
/* NOTE: It looks best when 'hover' and 'dragging' are set to the same color,
|
||||
otherwise color shifts while dragging when bar can't keep up with mouse */
|
||||
.ui-layout-resizer-open-hover , /* hover-color to 'resize' */
|
||||
.ui-layout-resizer-dragging { /* resizer beging 'dragging' */
|
||||
background: #C4E1A4;
|
||||
}
|
||||
.ui-layout-resizer-dragging { /* CLONED resizer being dragged */
|
||||
border: 1px solid #BBB;
|
||||
}
|
||||
.ui-layout-resizer-north-dragging,
|
||||
.ui-layout-resizer-south-dragging {
|
||||
border-width: 1px 0;
|
||||
}
|
||||
.ui-layout-resizer-west-dragging,
|
||||
.ui-layout-resizer-east-dragging {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
/* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */
|
||||
.ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */
|
||||
background: #E1A4A4; /* red */
|
||||
}
|
||||
|
||||
.ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */
|
||||
background: #EBD5AA;
|
||||
}
|
||||
.ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */
|
||||
opacity: .10; /* show only a slight shadow */
|
||||
filter: alpha(opacity=10);
|
||||
}
|
||||
.ui-layout-resizer-sliding-hover { /* sliding resizer - hover */
|
||||
opacity: 1.00; /* on-hover, show the resizer-bar normally */
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
/* sliding resizer - add 'outside-border' to resizer on-hover
|
||||
* this sample illustrates how to target specific panes and states */
|
||||
.ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; }
|
||||
.ui-layout-resizer-south-sliding-hover { border-top-width: 1px; }
|
||||
.ui-layout-resizer-west-sliding-hover { border-right-width: 1px; }
|
||||
.ui-layout-resizer-east-sliding-hover { border-left-width: 1px; }
|
||||
|
||||
/*
|
||||
* TOGGLER-BUTTONS
|
||||
*/
|
||||
.ui-layout-toggler {
|
||||
border: 1px solid #BBB; /* match pane-border */
|
||||
background-color: #BBB;
|
||||
}
|
||||
.ui-layout-resizer-hover .ui-layout-toggler {
|
||||
opacity: .60;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
.ui-layout-toggler-hover , /* need when NOT resizable */
|
||||
.ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */
|
||||
background-color: #FC6;
|
||||
opacity: 1.00;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.ui-layout-toggler-north ,
|
||||
.ui-layout-toggler-south {
|
||||
border-width: 0 1px; /* left/right borders */
|
||||
}
|
||||
.ui-layout-toggler-west ,
|
||||
.ui-layout-toggler-east {
|
||||
border-width: 1px 0; /* top/bottom borders */
|
||||
}
|
||||
/* hide the toggler-button when the pane is 'slid open' */
|
||||
.ui-layout-resizer-sliding .ui-layout-toggler {
|
||||
display: none;
|
||||
}
|
||||
/*
|
||||
* style the text we put INSIDE the togglers
|
||||
*/
|
||||
.ui-layout-toggler .content {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */
|
||||
}
|
||||
|
||||
/*
|
||||
* PANE-MASKS
|
||||
* these styles are hard-coded on mask elems, but are also
|
||||
* included here as !important to ensure will overrides any generic styles
|
||||
*/
|
||||
.ui-layout-mask {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
overflow: hidden !important;
|
||||
position: absolute !important;
|
||||
opacity: 0 !important;
|
||||
filter: Alpha(Opacity="0") !important;
|
||||
}
|
||||
.ui-layout-mask-inside-pane { /* masks always inside pane EXCEPT when pane is an iframe */
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
div.ui-layout-mask {} /* standard mask for iframes */
|
||||
iframe.ui-layout-mask {} /* extra mask for objects/applets */
|
||||
|
||||
/*
|
||||
* Default printing styles
|
||||
*/
|
||||
@media print {
|
||||
/*
|
||||
* Unless you want to print the layout as it appears onscreen,
|
||||
* these html/body styles are needed to allow the content to 'flow'
|
||||
*/
|
||||
html {
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
body.ui-layout-container {
|
||||
position: static !important;
|
||||
top: auto !important;
|
||||
bottom: auto !important;
|
||||
left: auto !important;
|
||||
right: auto !important;
|
||||
/* only IE6 has container width & height set by Layout */
|
||||
_width: auto !important;
|
||||
_height: auto !important;
|
||||
}
|
||||
.ui-layout-resizer, .ui-layout-toggler {
|
||||
display: none !important;
|
||||
}
|
||||
/*
|
||||
* Default pane print styles disables positioning, borders and backgrounds.
|
||||
* You can modify these styles however it suit your needs.
|
||||
*/
|
||||
.ui-layout-pane {
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
bottom: auto !important;
|
||||
left: auto !important;
|
||||
right: auto !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
}
|
||||
|
@ -1,29 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "About",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#303030",
|
||||
components: [
|
||||
{tag: "center", components: [
|
||||
{tag: "h1", style: "color:#f0f0f0", content: "r2wui"},
|
||||
{kind: "Image", src: "icon.png" },
|
||||
{tag: "h3", style: "color:#707070;margin-bottom:50px",
|
||||
content: "the web frontend for radare2"},
|
||||
{tag: "h2", style: "color:#a0a0a0", content: "author: pancake 2013-2014"},
|
||||
{tag: "h2", style: "color:#a0a0a0", content: "version: ???", name: "vertext"},
|
||||
{tag: "h2", style: "color:#a0a0a0", content: "revision: ???", name: "revtext"}
|
||||
]}
|
||||
],
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
(function(me) {
|
||||
setTimeout (function() {
|
||||
r2.cmd ("?V", function (v) {
|
||||
var version = v.split (" ")[0];
|
||||
var revision = v.split (" ")[2];
|
||||
me.$.vertext.setContent ("version: "+version);
|
||||
me.$.revtext.setContent ("revision: "+revision);
|
||||
});
|
||||
}, 1000);
|
||||
})(this);
|
||||
}
|
||||
});
|
@ -1,65 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Assembler",
|
||||
kind: "Scroller",
|
||||
classes: "r2panel",
|
||||
style: "background-color:#c0c0c0;",
|
||||
components: [
|
||||
{tag: "form", style:"margin-top:8px;margin-left:8px", attributes: {action:"javascript:#"}, components: [
|
||||
{kind: "FittableRows", fit: true, components: [
|
||||
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
|
||||
{tag: "font", content: "opcode", classes:"r2ui-input", style: "width:64px;font-weight:bold"},
|
||||
{kind: "Input", value: '', style:"width:60%", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "opcode"},
|
||||
]},
|
||||
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
|
||||
{tag: "font", content: "bytes", classes:"r2ui-input", style: "width:64px;font-weight:bold"},
|
||||
{kind: "Input", value: '', style:"width:120px", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "bytes"},
|
||||
]},
|
||||
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
|
||||
{tag: "font", content: "offset", classes: "r2ui-input", style:"width:64px;font-weight:bold"},
|
||||
{kind: "Input", value: 'entry0', style:"width:120px", onkeydown: "assembleOpcode", attributes: {autocapitalize:"off"}, name: "offset"}
|
||||
]},
|
||||
]}
|
||||
]},
|
||||
{tag: "form", style:"margin-top:8px;margin-left:8px", attributes: {action:"javascript:#"}, components: [
|
||||
{tag: "h2", content: "Calculator" },
|
||||
{kind: "onyx.InputDecorator", classes: "r2ui-input", components: [
|
||||
{tag: "font", name: "value", content: "0", classes: "r2ui-input", style:"width:200px;font-weight:bold"},
|
||||
{kind: "Input", name: "ivalue", value: '0', style:"width:300",
|
||||
onkeydown: "calculateValue", attributes: {autocapitalize:"off"} }
|
||||
]}
|
||||
]}
|
||||
],
|
||||
calculateValue: function (inSender, inEvent) {
|
||||
if (inEvent.keyCode === 13) {
|
||||
var v = this.$.value;
|
||||
var val = inSender.getValue ();
|
||||
v.setContent ("...");
|
||||
r2.cmd ('?v '+val, function (x) {
|
||||
v.setContent (x);
|
||||
});
|
||||
}
|
||||
},
|
||||
assembleOpcode: function (inSender, inEvent) {
|
||||
if (inEvent.keyCode === 13) {
|
||||
var arg = inSender.getValue ();
|
||||
var off = this.$.offset.getValue ();
|
||||
switch (inSender.name) {
|
||||
case 'opcode':
|
||||
var hex = this.$.bytes;
|
||||
r2.assemble (off, arg, function (bytes) {
|
||||
hex.setValue (bytes); // ? s/\n/;/g
|
||||
});
|
||||
break;
|
||||
case 'bytes':
|
||||
var op = this.$.opcode;
|
||||
//r2.cmd ("pi 1@b:"+arg, function (x) {
|
||||
r2.disassemble (off, arg, function (x) {
|
||||
op.setValue (x); // ? s/\n/;/g
|
||||
});
|
||||
break;
|
||||
case 'offset':
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
@ -1,17 +0,0 @@
|
||||
var Config = {
|
||||
"keys": {
|
||||
"1": "this.setIndex(0)",
|
||||
"2": "this.setIndex(1)",
|
||||
"3": "this.setIndex(2)",
|
||||
// Most of this keya are used in disassembly so it makes no sense leaving the rest. maybe moving around with numbers
|
||||
//"d": "r2ui.openpage(0)",
|
||||
// "a": "r2ui.openpage(1)",
|
||||
//"h": "r2ui.openpage(2)",
|
||||
//"g": "r2ui.openpage(3)",
|
||||
//"c": "r2ui.openpage(5)",
|
||||
// "s": "r2ui.openpage(8)",
|
||||
// Moved to disassembled panel
|
||||
//";": "r2.cmd('CC '+prompt('comment'));r2ui.seek('$$',false);",
|
||||
//"C-3": "this.setIndex(2)",
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Console",
|
||||
kind: "Scroller",
|
||||
classes: "r2panel",
|
||||
style: "background-color:#c0c0c0;padding-left:7px",
|
||||
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"},
|
||||
]},
|
||||
{tag: "pre", classes:"r2ui-terminal", style:"width:90%;", fit: true, allowHtml: true, name:"output"}
|
||||
]}
|
||||
]}
|
||||
],
|
||||
runCommand: function (inSender, inEvent) {
|
||||
if (inEvent.keyCode === 13) {
|
||||
var cmd = this.$.input.getValue ();
|
||||
this.$.input.setValue ("");
|
||||
(function (out) {
|
||||
r2.cmd (cmd, function (x) {
|
||||
out.setContent (x);
|
||||
});
|
||||
})(this.$.output);
|
||||
}
|
||||
}
|
||||
});
|
@ -1,10 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Debugger",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#303030",
|
||||
components: [
|
||||
{tag: "center", components: [
|
||||
{tag: "h1", style: "color:#f0f0f0", content: "TODO: Debugger"}
|
||||
]}
|
||||
]
|
||||
});
|
@ -1,605 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Disassembler",
|
||||
kind: "Scroller",
|
||||
tag: "div",
|
||||
classes:"ec_gui_background",
|
||||
style:"margin:0px;position: relative;",
|
||||
data: null,
|
||||
components: [
|
||||
// {tag: "div", allowHtml: true, classes: "colorbar", name: "colorbar" },
|
||||
{
|
||||
tag: "div",
|
||||
allowHtml: true,
|
||||
name: "minimap",
|
||||
style : "width:200px; height:200px; position:fixed; top:0; right 0px",
|
||||
id: "minimap"
|
||||
},
|
||||
{
|
||||
tag: "div",
|
||||
allowHtml: true,
|
||||
name: "panel",
|
||||
content: "<div id='main_panel' class='ui-layout-center ec_gui_background'><div id='center_panel'></div></div>"
|
||||
+ "<div class='ui-layout-south' style='display: none;background-color:rgb(20,20,20);'><pre id='cmd_output' class='ui-layout-content'></pre><div><input id='command' type='text' value=''/></div></div>",
|
||||
style:"margin-right:5px;width:100%;height:100%",
|
||||
},
|
||||
{kind: enyo.Signals,
|
||||
onkeypress: "handleKeyPress"
|
||||
},
|
||||
{name: "menuPopup", kind: "onyx.Popup", floating: true, onHide:'hideContextMenu', onShow:"showContextMenu", style:"padding: 0px;",
|
||||
style: "padding: 10px", components: [
|
||||
{name: "menu", kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [
|
||||
{content: "Show menu"},
|
||||
{kind: "onyx.Menu", name: "contextMenu", components: [
|
||||
{content: "rename", value: "rename"},
|
||||
{content: "comment", value: "comment"},
|
||||
{content: "switch view", value: "do_switchview"},
|
||||
{content: "random colors", value: "do_randomcolors"}
|
||||
]}
|
||||
]}
|
||||
]
|
||||
},
|
||||
],
|
||||
handlers: {
|
||||
ontap: "handleTap",
|
||||
onhold: "handleHold",
|
||||
ondblclick: "handleDoubleClick",
|
||||
onTransitionFinish: "handleTransitionFinish",
|
||||
},
|
||||
handleTransitionFinish: function() {
|
||||
if (r2ui._dis.display == "graph" && r2ui._dis.minimap) update_minimap();
|
||||
},
|
||||
itemSelected: function (inSender, inEvent) {
|
||||
if (inEvent.originator.content) {
|
||||
var itemContent = inEvent.originator.content;
|
||||
if (itemContent == "rename") {
|
||||
this.do_rename(this.selected, inEvent);
|
||||
} else if (itemContent == "comment") {
|
||||
this.do_comment(this.selected_offset);
|
||||
} else if (itemContent == "random colors") {
|
||||
do_randomcolors();
|
||||
} else if (itemContent == "switch view") {
|
||||
this.switch_view();
|
||||
}
|
||||
}
|
||||
this.$.menuPopup.hide();
|
||||
},
|
||||
handleHold: function (inSender, inEvent) {
|
||||
this.handleTap(inSender, inEvent);
|
||||
if (typeof inEvent.target.className === "string" && (inEvent.target.className.indexOf(" addr ") > -1 || inEvent.target.className.indexOf(" faddr ") > -1)) {
|
||||
var address = get_address_from_class(inEvent.target);
|
||||
this.selected = inEvent.target;
|
||||
this.selected_offset = address;
|
||||
rehighlight_iaddress(address);
|
||||
this.showContextMenu(inEvent.pageY, inEvent.pageX);
|
||||
}
|
||||
},
|
||||
showContextMenu:function(inSender, inEvent){
|
||||
|
||||
if((parseFloat(inSender) == parseInt(inSender)) && !isNaN(inSender) && (parseFloat(inEvent) == parseInt(inEvent)) && !isNaN(inEvent)){
|
||||
this.$.menuPopup.addStyles('top:'+inSender+'px; left:'+inEvent+'px;padding:0px;');
|
||||
this.$.menuPopup.show();
|
||||
this.$.menuPopup.children[0].children[0].hide();
|
||||
this.$.menuPopup.children[0].children[1].show();
|
||||
this.$.menuPopup.render();
|
||||
}
|
||||
},
|
||||
hideContextMenu:function(inSender,inEvent){
|
||||
},
|
||||
handleDoubleClick: function (inSender, inEvent) {
|
||||
if (inEvent.target.className.indexOf(" addr ") > -1 && inEvent.target.className.indexOf("insaddr") === -1) {
|
||||
this.handleTap(inSender, inEvent);
|
||||
this.goToAddress();
|
||||
}
|
||||
},
|
||||
|
||||
handleKeyPress: function(inSender, inEvent) {
|
||||
var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
var key = String.fromCharCode(keynum);
|
||||
// console.log(key);
|
||||
|
||||
if (inEvent.ctrlKey||inEvent.metaKey) return;
|
||||
if ($(inEvent.target).prop("tagName") === "INPUT" || $(inEvent.target).prop("tagName") === "TEXTAREA") return;
|
||||
|
||||
|
||||
// show help
|
||||
if (key === '?') {
|
||||
r2ui.mp.show_popup();
|
||||
}
|
||||
// Spacebar Switch flat and graph views
|
||||
if (key === ' ') {
|
||||
this.switch_view();
|
||||
}
|
||||
// h Seek to previous address in history
|
||||
if (key === 'h') {
|
||||
var addr = r2ui.history_prev();
|
||||
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
|
||||
}
|
||||
// l Seek to next address in history
|
||||
if (key === 'l') {
|
||||
var addr = r2ui.history_next();
|
||||
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
|
||||
}
|
||||
if (key === 'm' && r2ui._dis.display == "graph") toggle_minimap();
|
||||
// j Seek to next Instruction
|
||||
if (key === 'j') {
|
||||
var get_more_instructions = false;
|
||||
if ($(this.selected).hasClass("insaddr")) {
|
||||
var next_instruction;
|
||||
if (this.display == "flat") {
|
||||
next_instruction = $(this.selected).closest(".instructionbox").next().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(this.selected).closest(".instructionbox")[0]) > $("#gbox .instructionbox").length - 10) get_more_instructions = true;
|
||||
}
|
||||
if (this.display == "graph") {
|
||||
var next_instruction = $(this.selected).closest(".instruction").next().find('.insaddr')[0];
|
||||
if (next_instruction === undefined || next_instruction === null) {
|
||||
next_instruction = $(this.selected).closest(".basicblock").next().find('.insaddr')[0];
|
||||
}
|
||||
}
|
||||
|
||||
// if (next_instruction === null || next_instruction === undefined) return;
|
||||
var address = get_address_from_class(next_instruction);
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
} else {
|
||||
r2ui.history_push(address);
|
||||
this.selected = next_instruction;
|
||||
this.selected_offset = address;
|
||||
}
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
// k Seek to previous instruction
|
||||
if (key === 'k') {
|
||||
var get_more_instructions = false;
|
||||
if ($(this.selected).hasClass("insaddr")) {
|
||||
var prev_instruction;
|
||||
if (this.display == "flat") {
|
||||
prev_instruction = $(this.selected).closest(".instructionbox").prev().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(this.selected).closest(".instructionbox")[0]) < 10) get_more_instructions = true;
|
||||
}
|
||||
if (this.display == "graph") {
|
||||
var prev_instruction = $(this.selected).closest(".instruction").prev().find('.insaddr')[0];
|
||||
if (prev_instruction === undefined || prev_instruction === null) {
|
||||
prev_instruction = $(this.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
|
||||
}
|
||||
}
|
||||
var address = get_address_from_class(prev_instruction);
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
} else {
|
||||
r2ui.history_push(address);
|
||||
this.selected = prev_instruction;
|
||||
this.selected_offset = address;
|
||||
}
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
// c Define function
|
||||
if (key === 'c') {
|
||||
var msg = prompt ('Function name?');
|
||||
if (msg !== null) {
|
||||
r2.cmd("af " + msg, function() {
|
||||
r2.update_flags();
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
}
|
||||
}
|
||||
// d Clear function metadata
|
||||
if (key === 'd') {
|
||||
r2.cmd("af-", function() {
|
||||
r2.update_flags();
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
}
|
||||
// g Go to address
|
||||
if (key === 'g') {
|
||||
var a = prompt('Go to');
|
||||
if (a !== null) r2ui.opendis(a);
|
||||
}
|
||||
// ; Add comment
|
||||
if (key === ';') {
|
||||
this.do_comment(this.selected_offset);
|
||||
}
|
||||
// n Rename
|
||||
if (key === 'n') {
|
||||
this.do_rename(this.selected, inEvent);
|
||||
}
|
||||
|
||||
if (key === 'R') do_randomcolors();
|
||||
|
||||
// esc
|
||||
if (keynum === 27) {
|
||||
// Esc belongs to renaming
|
||||
if(this.renaming !== null) {
|
||||
this.renaming.innerHTML = this.renameOldValue;
|
||||
this.renaming = null;
|
||||
} else {
|
||||
// go back in history
|
||||
var addr = r2ui.history_prev();
|
||||
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
|
||||
}
|
||||
}
|
||||
// enter
|
||||
if (keynum === 13) {
|
||||
// Enter means go to address
|
||||
this.goToAddress();
|
||||
}
|
||||
},
|
||||
handleTap: function(inSender, inEvent) {
|
||||
if (typeof inEvent.target.className === 'string') {
|
||||
if (inEvent.target.className.indexOf(" addr ") > -1) {
|
||||
var address = get_address_from_class(inEvent.target);
|
||||
rehighlight_iaddress(address);
|
||||
this.selected = inEvent.target;
|
||||
this.selected_offset = address;
|
||||
|
||||
// If instruction address, add address to history
|
||||
if ($(inEvent.target).hasClass('insaddr')) {
|
||||
r2ui.history_push(address);
|
||||
var get_more_instructions = false;
|
||||
var next_instruction;
|
||||
var prev_instruction;
|
||||
var address = get_address_from_class(inEvent.target);
|
||||
if (r2ui._dis.display == "flat") {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".instructionbox").next().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) > $("#gbox .instructionbox").length - 10) {
|
||||
get_more_instructions = true;
|
||||
address = get_address_from_class(next_instruction);
|
||||
}
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".instructionbox").prev().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) < 10) {
|
||||
get_more_instructions = true;
|
||||
address = get_address_from_class(prev_instruction);
|
||||
}
|
||||
}
|
||||
if (r2ui._dis.display == "graph") {
|
||||
var next_instruction = $(r2ui._dis.selected).closest(".instruction").next().find('.insaddr')[0];
|
||||
if (next_instruction === undefined || next_instruction === null) {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".basicblock").next().find('.insaddr')[0];
|
||||
}
|
||||
var prev_instruction = $(r2ui._dis.selected).closest(".instruction").prev().find('.insaddr')[0];
|
||||
if (prev_instruction === undefined || prev_instruction === null) {
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
|
||||
}
|
||||
}
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
document.getElementById("canvas").focus();
|
||||
}
|
||||
}
|
||||
} else if ($(inEvent.target).hasClass('fvar') || $(inEvent.target).hasClass('farg')) {
|
||||
var eid = null;
|
||||
var address = get_address_from_class(inEvent.target, "faddr");
|
||||
r2ui._dis.selected = inEvent.target;
|
||||
r2ui._dis.selected_offset = address;
|
||||
var classes = inEvent.target.className.split(' ');
|
||||
for (var j in classes) {
|
||||
var klass = classes[j];
|
||||
if (klass.indexOf("id_") === 0) eid = klass.substring(3);
|
||||
}
|
||||
if (eid !== null) rehighlight_iaddress(eid, "id");
|
||||
}
|
||||
}
|
||||
},
|
||||
goToAddress: function() {
|
||||
if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(" addr ") ) -1) {
|
||||
var address = get_address_from_class(this.selected);
|
||||
if (this.selected.className.indexOf("ec_dataoffset") > -1) {
|
||||
// address is located in not executable memory, switching to hex view
|
||||
r2ui.openpage(address, 2);
|
||||
return;
|
||||
}
|
||||
if (address !== undefined && address !== null) {
|
||||
address = address_canonicalize(address);
|
||||
if (this.display === "flat") {
|
||||
r2ui.seek(address, true);
|
||||
} else {
|
||||
// check if address belong to current function //
|
||||
r2.cmdj("pdfj", function(x) {
|
||||
if (x !== null && x !== undefined) {
|
||||
var ops = x.ops;
|
||||
var found = false;
|
||||
for (var i in ops) {
|
||||
if (ops[i].offset === parseInt(address,16)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
r2ui.seek_in_graph(address, true);
|
||||
} else {
|
||||
r2ui.seek(address, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleInputTextChange: function() {
|
||||
if (this.renaming !== null && this.rbox.value.length > 0) {
|
||||
if ($(this.selected).hasClass('insaddr')) {
|
||||
var old_value = get_offset_flag(r2ui._dis.selected_offset);
|
||||
var type = "offsets";
|
||||
r2.cmdj("afij @ " + r2ui._dis.selected_offset, function(x) {
|
||||
if (x !== null && x !== undefined) {
|
||||
if ("0x" + x[0].offset.toString(16) === r2ui._dis.selected_offset) {
|
||||
type = "functions";
|
||||
}
|
||||
}
|
||||
});
|
||||
rename(r2ui._dis.selected_offset, old_value, this.rbox.value, type);
|
||||
} else if ($(this.selected).hasClass('faddr')) {
|
||||
if ($(this.selected).hasClass('fvar'))
|
||||
r2.cmd("afvn " + r2ui._dis.renameOldValue + " " + r2ui._dis.rbox.value + " @ " + r2ui._dis.selected_offset, function(x){});
|
||||
else if ($(this.selected).hasClass('farg'))
|
||||
r2.cmd("afan " + r2ui._dis.renameOldValue + " " + r2ui._dis.rbox.value + " @ " + r2ui._dis.selected_offset, function(x){});
|
||||
} else {
|
||||
// TODO, try to recognize other spaces
|
||||
var old_value = r2ui._dis.renameOldValue;
|
||||
if (old_value.indexOf("0x") === 0) old_value = "";
|
||||
rename(r2ui._dis.selected_offset, old_value, r2ui._dis.rbox.value, "*");
|
||||
}
|
||||
var instruction;
|
||||
if (this.display == "flat") instruction = $(this.selected).closest(".instructionbox").find('.insaddr')[0];
|
||||
if (this.display == "graph") instruction = $(this.selected).closest(".instruction").find('.insaddr')[0];
|
||||
this.renaming = null;
|
||||
var address = get_address_from_class(instruction);
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
},
|
||||
min: 0,
|
||||
max: 0,
|
||||
block: 512,
|
||||
base: "entry0",
|
||||
display: "flat",
|
||||
selected: null,
|
||||
renaming: null,
|
||||
renameOldValue: "",
|
||||
rbox: null,
|
||||
minimap:true,
|
||||
console_history: [],
|
||||
console_history_idx: 0,
|
||||
instructions: [],
|
||||
scrolling: false,
|
||||
do_comment: function(address) {
|
||||
var c = prompt('Comment');
|
||||
if (c !== null) {
|
||||
r2.cmd('CC- ' + " @ " + address + ';CC ' + c + " @ " + address);
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
},
|
||||
do_rename: function(element, inEvent) {
|
||||
if (this.renaming === null && this.selected !== null && this.selected.className.indexOf(" addr ") > -1) {
|
||||
var address = get_address_from_class(this.selected);
|
||||
this.renaming = this.selected;
|
||||
this.renameOldValue = this.selected.innerHTML;
|
||||
this.rbox = document.createElement('input');
|
||||
this.rbox.setAttribute("type", "text");
|
||||
this.rbox.setAttribute("id", "rename");
|
||||
this.rbox.setAttribute("style", "border-width: 0;padding: 0;");
|
||||
this.rbox.setAttribute("onChange", "handleInputTextChange()");
|
||||
if (this.selected.className.indexOf("insaddr") > -1) {
|
||||
var value = get_offset_flag(address);
|
||||
this.rbox.setAttribute("value",value);
|
||||
this.rbox.setSelectionRange(value.length, value.length);
|
||||
} else {
|
||||
this.rbox.setAttribute("value", this.renameOldValue);
|
||||
this.rbox.setSelectionRange(this.renameOldValue.length, this.renameOldValue.length);
|
||||
}
|
||||
this.renaming.innerHTML = "";
|
||||
this.renaming.appendChild(this.rbox);
|
||||
setTimeout('r2ui._dis.rbox.focus();', 200);
|
||||
} else if (this.renaming === null && element !== null && $(element).hasClass("faddr")) {
|
||||
var address = get_address_from_class(element, "faddr");
|
||||
this.selected = element;
|
||||
this.selected_offset = address;
|
||||
this.renaming = element;
|
||||
this.renameOldValue = element.innerText;
|
||||
this.rbox = document.createElement('input');
|
||||
this.rbox.setAttribute("type", "text");
|
||||
this.rbox.setAttribute("id", "rename");
|
||||
this.rbox.setAttribute("style", "border-width: 0;padding: 0;");
|
||||
this.rbox.setAttribute("onChange", "handleInputTextChange()");
|
||||
this.rbox.setAttribute("value", this.renameOldValue);
|
||||
this.rbox.setSelectionRange(this.renameOldValue.length, this.renameOldValue.length);
|
||||
this.renaming.innerHTML = "";
|
||||
this.renaming.appendChild(r2ui._dis.rbox);
|
||||
setTimeout('r2ui._dis.rbox.focus();', 200);
|
||||
}
|
||||
},
|
||||
switch_view: function() {
|
||||
if (this.display === "flat") this.display_graph();
|
||||
else this.display_flat();
|
||||
var addr = r2ui.history_last();
|
||||
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
|
||||
},
|
||||
display_graph: function() {
|
||||
this.display = "graph";
|
||||
$("#main_panel").removeClass("ec_gui_background");
|
||||
$("#main_panel").addClass("ec_gui_alt_background");
|
||||
},
|
||||
display_flat: function() {
|
||||
this.display = "flat";
|
||||
$("#main_panel.ui-layout-pane").removeClass("ec_gui_alt_background");
|
||||
$("#main_panel.ui-layout-pane").addClass("ec_gui_background");
|
||||
},
|
||||
// less: function() {
|
||||
// this.min += this.block;
|
||||
// r2.get_disasm_before(this.base + "-" + this.min, this.block, function(x) {
|
||||
// x = render_instructions(x);
|
||||
// var oldy = r2ui._dis.getScrollBounds().height;
|
||||
// $("#center_panel").html(x+text.getContent());
|
||||
// var newy = r2ui._dis.getScrollBounds().height;
|
||||
// r2ui._dis.scrollTo(0, newy-oldy);
|
||||
// });
|
||||
// rehighlight_iaddress(this.base);
|
||||
// },
|
||||
// more: function() {
|
||||
// this.max += this.block;
|
||||
// r2.get_disasm_after(this.base + "+" + this.max, this.block, function(x) {
|
||||
// x = render_instructions(x);
|
||||
// $("#center_panel").html(text.getContent() + x);
|
||||
// });
|
||||
// rehighlight_iaddress(this.base);
|
||||
// },
|
||||
seek: function(addr, scroll) {
|
||||
var error = false;
|
||||
if (this.display === "graph") {
|
||||
this.$.minimap.show();
|
||||
$("#center_panel").html("");
|
||||
r2.cmd ("agj " + addr, function(x) {
|
||||
$("#center_panel").html("<div id='center_panel' style='width:100%;height:100%;overflow: auto;'><div id='canvas' class='canvas enyo-selectable ec_gui_background'></div></div>");
|
||||
if (render_graph(x) === false) error = true;
|
||||
});
|
||||
}
|
||||
if (error) this.display_flat();
|
||||
if (this.display === "flat") {
|
||||
$("#main_panel").scroll(on_scroll);
|
||||
this.$.minimap.hide();
|
||||
this.min = this.max = 0;
|
||||
r2.get_disasm_before_after(addr, -100, 100, function(x) {
|
||||
$("#center_panel").html("<div id='canvas' class='canvas enyo-selectable ec_gui_background'></div>");
|
||||
r2ui._dis.instructions = x;
|
||||
render_instructions(r2ui._dis.instructions);
|
||||
});
|
||||
}
|
||||
this.selected = get_element_by_address(addr);
|
||||
this.selected_offset = addr;
|
||||
|
||||
rehighlight_iaddress(addr);
|
||||
if (scroll === undefined || scroll === true) {
|
||||
scroll_to_address(addr);
|
||||
}
|
||||
},
|
||||
create: function() {
|
||||
this.inherited(arguments);
|
||||
this.base = "entry0";
|
||||
r2ui._dis = this;
|
||||
|
||||
// TODO: Move this to the application constructor
|
||||
r2.update_flags();
|
||||
r2.analAll();
|
||||
r2.load_mmap();
|
||||
r2ui.load_colors();
|
||||
},
|
||||
resizeHandler: function() {
|
||||
this.inherited(arguments);
|
||||
if (r2ui._dis.display == "graph" && r2ui._dis.minimap) update_minimap();
|
||||
},
|
||||
rendered: function() {
|
||||
this.inherited(arguments);
|
||||
myLayout = $('#radareApp_mp_panels_pageDisassembler_panel').layout({
|
||||
south__size: 200,
|
||||
});
|
||||
this.display_flat();
|
||||
r2ui.seek(this.base,true);
|
||||
|
||||
var console_history = this.console_history;
|
||||
var console_history_idx = this.console_history_idx;
|
||||
|
||||
// Handle commands in console
|
||||
$("#command").keypress(function( inEvent ) {
|
||||
var key = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
if (key === 13) {
|
||||
var cmd = inEvent.target.value.trim();
|
||||
var reloadUI = cmd == '';
|
||||
|
||||
console_history[console_history.length] = cmd;
|
||||
console_history_idx += 1;
|
||||
/* empty input reloads UI */
|
||||
if (cmd != '') {
|
||||
r2.cmd(inColor(cmd), function(x) {
|
||||
var old_value = $("#cmd_output").text();
|
||||
$("#cmd_output").html(old_value + "\n> " + cmd + "\n" + x );
|
||||
$('#cmd_output').scrollTo($('#cmd_output')[0].scrollHeight);
|
||||
});
|
||||
if (cmd.indexOf("s ") === 0) {
|
||||
r2ui.history_push(r2ui._dis.selected_offset);
|
||||
}
|
||||
}
|
||||
inEvent.target.value = "";
|
||||
/* if command starts with :, do not reload */
|
||||
if (reloadUI) {
|
||||
r2.load_settings();
|
||||
r2ui.load_colors();
|
||||
r2ui.seek("$$", false);
|
||||
scroll_to_element(r2ui._dis.selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#command").keydown(function( inEvent ) {
|
||||
var key = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
if (key === 40) {
|
||||
console_history_idx++;
|
||||
if (console_history_idx > console_history.length - 1) console_history_idx = console_history.length;
|
||||
inEvent.target.value = console_history[console_history_idx] === undefined ? "" : console_history[console_history_idx];
|
||||
}
|
||||
if (key === 38) {
|
||||
console_history_idx--;
|
||||
if (console_history_idx < 0) console_history_idx = 0;
|
||||
inEvent.target.value = console_history[console_history_idx] === undefined ? "" : console_history[console_history_idx];
|
||||
}
|
||||
});
|
||||
},
|
||||
// colorbar_create: function () {
|
||||
// var self = this;
|
||||
// r2.cmd ("pvj 24", function(x) {
|
||||
// try {
|
||||
// var y = JSON.parse (x);
|
||||
// } catch (e) {
|
||||
// alert (e);
|
||||
// return;
|
||||
// }
|
||||
// // console.log (y);
|
||||
|
||||
// // TODO: use canvas api for faster rendering and smaller dom
|
||||
// var c = "<table class='colorbar'>"+
|
||||
// "<tr valign=top style='height:8px;border-spacing:0'>";
|
||||
// var colors = {
|
||||
// flags: "#c0c0c0",
|
||||
// comments: "yellow",
|
||||
// functions: "#5050f0",
|
||||
// strings: "orange",
|
||||
// };
|
||||
// var off = "";
|
||||
// var WIDTH = '100%';
|
||||
// var HEIGHT = 16;
|
||||
// for (var i=0; i< y.blocks.length; i++) {
|
||||
// var block = y.blocks[i];
|
||||
// var r = "<div style='overflow:hidden;width:12px;'>____</div>";
|
||||
// if (block.offset) { // Object.keys(block).length>1) {
|
||||
// var r = "<table width='width:100%' height="+HEIGHT+" style='border-spacing:0px'>";
|
||||
// var count = 0;
|
||||
// for (var k in colors)
|
||||
// if (block[k])
|
||||
// count++;
|
||||
// count++; // avoid 0div wtf
|
||||
// if (count==1) break;
|
||||
// var h = HEIGHT / count;
|
||||
// for (var k in colors) {
|
||||
// var color = colors[k];
|
||||
// if (block[k])
|
||||
// r += "<tr><td class='colorbar_item' style='background-color:"
|
||||
// + colors[k]+"'><div style='width:12px;overflow:"
|
||||
// + "hidden;height:"+h+"px'>____</div></td></tr>";
|
||||
// }
|
||||
// r += "</table>";
|
||||
// off = "0x"+block.offset.toString (16);
|
||||
// } else {
|
||||
// off = "0x"+(y.from + (y.blocksize * i)).toString (16);
|
||||
// }
|
||||
// c += "<td onclick='r2ui.seek("+off+",true)' title='"+off
|
||||
// + "' style='height:"+HEIGHT+"px' "
|
||||
// + "width=15px>"+r+"</td>";
|
||||
// }
|
||||
// c += "</tr></table>";
|
||||
// self.$.colorbar.setContent (c);
|
||||
// });
|
||||
// }
|
||||
});
|
@ -1,120 +0,0 @@
|
||||
function docss(x) {
|
||||
return '<font color=black>'+x+'</font>';
|
||||
}
|
||||
|
||||
enyo.kind ({
|
||||
name: "DisassemblerOld",
|
||||
kind: "Scroller",
|
||||
tag: "div",
|
||||
style:"margin:0px;background-color:#c0c0c0",
|
||||
data: null,
|
||||
components: [
|
||||
{tag: "div", allowHtml: true, classes: "colorbar", name: "colorbar" },
|
||||
{tag: "br" },
|
||||
{tag: "div", content: "^", classes: "moreless", ontap: "less"},
|
||||
{tag: "pre", allowHtml: true, name: "text", content: "..", style:"margin-left:5px"},
|
||||
{tag: "div", content: "v", classes: "moreless", ontap: "more"},
|
||||
],
|
||||
min: 0,
|
||||
max: 0,
|
||||
block: 512,
|
||||
base: "entry0",
|
||||
less: function() {
|
||||
var self = this;
|
||||
var text = this.$.text;
|
||||
this.min += this.block;
|
||||
r2.get_disasm (this.base+"-"+this.min, this.block, function (x) {
|
||||
x = docss (r2.filter_asm (x, "pd"));
|
||||
var oldy = r2ui._dis.getScrollBounds().height;
|
||||
text.setContent ("<div class='enyo-selectable'>" + x + text.getContent() + "</div>");
|
||||
var newy = r2ui._dis.getScrollBounds().height;
|
||||
r2ui._dis.scrollTo (0, newy-oldy);
|
||||
});
|
||||
},
|
||||
more: function() {
|
||||
var text = this.$.text;
|
||||
this.max += this.block;
|
||||
r2.get_disasm (this.base+"+"+this.max, this.block, function (x) {
|
||||
x = docss (r2.filter_asm (x, "pd"));
|
||||
text.setContent ("<div class='enyo-selectable'>" + text.getContent() + x + "</div>");
|
||||
});
|
||||
},
|
||||
seek: function(addr) {
|
||||
var text = this.$.text;
|
||||
this.base = addr;
|
||||
this.min = this.max = 0;
|
||||
r2.get_disasm (addr, this.block, function (x) {
|
||||
x = docss (r2.filter_asm (x, "pd"));
|
||||
text.setContent("<div class='enyo-selectable'>" + x + "</div>");
|
||||
});
|
||||
this.scrollTo (0, 0);
|
||||
//this.colorbar_create ();
|
||||
},
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
// this.$.list.setCount (this.data.length) ;
|
||||
var text = this.$.text;
|
||||
r2.cmd("e asm.lineswidth = 20", function(x){});
|
||||
this.seek ("entry0");
|
||||
r2ui._dis = this;
|
||||
r2ui.history_push ("entry0");
|
||||
|
||||
//this.colorbar_create ();
|
||||
//this.refresh ();
|
||||
},
|
||||
colorbar_create: function () {
|
||||
var self = this;
|
||||
r2.cmd ("pvj 24", function(x) {
|
||||
try {
|
||||
var y = JSON.parse (x);
|
||||
} catch (e) {
|
||||
alert (e);
|
||||
return;
|
||||
}
|
||||
console.log (y);
|
||||
|
||||
// TODO: use canvas api for faster rendering and smaller dom
|
||||
var c = "<table class='colorbar'>"+
|
||||
"<tr valign=top style='height:8px;border-spacing:0'>";
|
||||
var colors = {
|
||||
flags: "#c0c0c0",
|
||||
comments: "yellow",
|
||||
functions: "#5050f0",
|
||||
strings: "orange",
|
||||
};
|
||||
var off = "";
|
||||
var WIDTH = '100%';
|
||||
var HEIGHT = 16;
|
||||
for (var i=0; i< y.blocks.length; i++) {
|
||||
var block = y.blocks[i];
|
||||
var r = "<div style='overflow:hidden;width:12px;'>____</div>";
|
||||
if (block.offset) { // Object.keys(block).length>1) {
|
||||
var r = "<table width='width:100%' height="+HEIGHT+" style='border-spacing:0px'>";
|
||||
var count = 0;
|
||||
for (var k in colors)
|
||||
if (block[k])
|
||||
count++;
|
||||
count++; // avoid 0div wtf
|
||||
if (count==1) break;
|
||||
var h = HEIGHT / count;
|
||||
for (var k in colors) {
|
||||
var color = colors[k];
|
||||
if (block[k])
|
||||
r += "<tr><td class='colorbar_item' style='background-color:"
|
||||
+ colors[k]+"'><div style='width:12px;overflow:"
|
||||
+ "hidden;height:"+h+"px'>____</div></td></tr>";
|
||||
}
|
||||
r += "</table>";
|
||||
off = "0x"+block.offset.toString (16);
|
||||
} else {
|
||||
off = "0x"+(y.from + (y.blocksize * i)).toString (16);
|
||||
}
|
||||
c += "<td onclick='r2ui.seek("+off+",true)' title='"+off
|
||||
+ "' style='height:"+HEIGHT+"px' "
|
||||
+ "width=15px>"+r+"</td>";
|
||||
}
|
||||
c += "</tr></table>";
|
||||
self.$.colorbar.setContent (c);
|
||||
});
|
||||
}
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Graph",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#c0c0c0",
|
||||
components: [
|
||||
{tag: "h2", content: "Open graph", style:"margin-left:10px;"},
|
||||
{kind: "Group", classes: "enyo-border-box group", defaultKind: "onyx.Button", components: [
|
||||
{content: "Basic blocks", classes: "onyx-dark menu-button", ontap:"openGraphBB" },
|
||||
{content: "Callgraph", classes: "onyx-dark menu-button", ontap:"openGraphCG" }
|
||||
]}
|
||||
],
|
||||
openGraphBB: function () {
|
||||
window.open ('/graph/', '_self');
|
||||
},
|
||||
openGraphCG: function () {
|
||||
window.open ('/d3/', '_self');
|
||||
}
|
||||
});
|
@ -1,131 +0,0 @@
|
||||
function docss(x) {
|
||||
return '<font color=black>'+x+'</font>';
|
||||
}
|
||||
|
||||
enyo.kind ({
|
||||
name: "Hexdump",
|
||||
kind: "Scroller",
|
||||
tag: "div",
|
||||
style:"margin:0px;background-color:#c0c0c0;color:black",
|
||||
data: null,
|
||||
components: [
|
||||
{tag: "div", allowHtml: true, classes: "colorbar", name: "colorbar" },
|
||||
{tag: "div", content: "^", classes: "moreless", ontap: "less"},
|
||||
{tag: "pre", allowHtml: true, name: "text", content: "..", style:"margin-left:5px;color:black"},
|
||||
{tag: "div", content: "v", classes: "moreless", ontap: "more"},
|
||||
/*
|
||||
{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.Button", name: "msg", fit:true, active: true, ontap: "rowTap"}
|
||||
]}
|
||||
]}
|
||||
*/
|
||||
],
|
||||
min: 0,
|
||||
max: 0,
|
||||
block: 1024,
|
||||
base: "entry0",
|
||||
less: function() {
|
||||
var self = this;
|
||||
var text = this.$.text;
|
||||
this.min += this.block;
|
||||
r2.get_hexdump (this.base+"-"+this.min, this.block, function (x) {
|
||||
x = css (r2.filter_asm (x, "px"));
|
||||
var oldy = r2ui._hex.getScrollBounds().height;
|
||||
text.setContent ("<div class='enyo-selectable'>" + x + text.getContent() + "</div>");
|
||||
var newy = r2ui._hex.getScrollBounds().height;
|
||||
r2ui._hex.scrollTo (0, newy-oldy);
|
||||
});
|
||||
},
|
||||
more: function() {
|
||||
var text = this.$.text;
|
||||
this.max += this.block;
|
||||
r2.get_hexdump (this.base+"+"+this.max, this.block, function (x) {
|
||||
x = docss (r2.filter_asm (x, "px"));
|
||||
text.setContent ("<div class='enyo-selectable'>" + text.getContent() + x + "</div>");
|
||||
});
|
||||
},
|
||||
seek: function(addr) {
|
||||
var text = this.$.text;
|
||||
this.base = addr;
|
||||
this.min = this.max = 0;
|
||||
r2.get_hexdump (addr, this.block, function (x) {
|
||||
x = docss (r2.filter_asm (x, "px"));
|
||||
text.setContent ("<div class='enyo-selectable'>" + x + "</div>");
|
||||
});
|
||||
this.colorbar_create ();
|
||||
},
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
// this.$.list.setCount (this.data.length) ;
|
||||
var text = this.$.text;
|
||||
this.seek ("entry0");
|
||||
r2ui._hex = this;
|
||||
// r2ui.history_push("entry0");
|
||||
|
||||
this.colorbar_create();
|
||||
//this.refresh ();
|
||||
},
|
||||
setupItem: function (inSender, inIndex) {
|
||||
this.$.msg.setContent (this.data[inIndex.index]);
|
||||
return true;
|
||||
},
|
||||
/* TODO: spaggety. see disassemble.js . must be a separate kind */
|
||||
colorbar_create: function () {
|
||||
var self = this;
|
||||
r2.cmd ("pvj", function(x) {
|
||||
try {
|
||||
var y = JSON.parse (x);
|
||||
} catch (e) {
|
||||
alert (e);
|
||||
return;
|
||||
}
|
||||
// console.log (y);
|
||||
|
||||
// TODO: use canvas api for faster rendering and smaller dom
|
||||
var c = "<table class='colorbar'><tr valign=top style='height:20px;border-spacing:0'>";
|
||||
var colors = {
|
||||
flags: "#c0c0c0",
|
||||
comments: "yellow",
|
||||
functions: "#5050f0",
|
||||
strings: "orange",
|
||||
};
|
||||
|
||||
var off = "";
|
||||
var WIDTH = 10;
|
||||
var HEIGHT = 30;
|
||||
for (var i=0; i< y.blocks.length; i++) {
|
||||
var block = y.blocks[i];
|
||||
var r = "<div style='overflow:hidden;background-color:#404040;width:"
|
||||
+ WIDTH+"px;'> </div>";
|
||||
if (block.offset) { // Object.keys(block).length>1) {
|
||||
var r = "<table height="+HEIGHT+" style='color:black;border-spacing:0px'>";
|
||||
var count = 0;
|
||||
for (var k in colors) {
|
||||
if (block[k])
|
||||
count++;
|
||||
}
|
||||
count++; // avoid 0div wtf
|
||||
if (count==1) break;
|
||||
var h = HEIGHT / count;
|
||||
for (var k in colors) {
|
||||
var color = colors[k];
|
||||
if (block[k])
|
||||
r += "<tr><td style='width:"+WIDTH+"px;background-color:"
|
||||
+ colors[k]+"'><div style='width:"+WIDTH+"px;overflow:"
|
||||
+ "hidden;height:"+h+"px'> </div></td></tr>";
|
||||
}
|
||||
r += "</table>";
|
||||
off = "0x"+block.offset.toString (16);
|
||||
} else {
|
||||
off = "0x"+(y.from + (y.blocksize * i)).toString (16);
|
||||
}
|
||||
c += "<td onclick='r2ui.seek("+off+",true)' title='"+off
|
||||
+ "' style='height:"+HEIGHT+"px' "
|
||||
+ "width=15px>"+r+"</td>";
|
||||
}
|
||||
c += "</tr></table>";
|
||||
self.$.colorbar.setContent (c);
|
||||
});
|
||||
}
|
||||
});
|
9555
shlr/www/enyo/js/jquery-1.9.0.js
vendored
14879
shlr/www/enyo/js/jquery-ui-latest.js
vendored
@ -1,187 +0,0 @@
|
||||
/*!
|
||||
* jQuery.scrollTo
|
||||
* Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
|
||||
* @projectDescription Easy element scrolling using jQuery.
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.14
|
||||
*/
|
||||
;(function (define) {
|
||||
'use strict';
|
||||
|
||||
define(['jquery'], function ($) {
|
||||
|
||||
var $scrollTo = $.scrollTo = function( target, duration, settings ) {
|
||||
return $(window).scrollTo( target, duration, settings );
|
||||
};
|
||||
|
||||
$scrollTo.defaults = {
|
||||
axis:'xy',
|
||||
duration: 0,
|
||||
limit:true
|
||||
};
|
||||
|
||||
// Returns the element that needs to be animated to scroll the window.
|
||||
// Kept for backwards compatibility (specially for localScroll & serialScroll)
|
||||
$scrollTo.window = function( scope ) {
|
||||
return $(window)._scrollable();
|
||||
};
|
||||
|
||||
// Hack, hack, hack :)
|
||||
// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
|
||||
$.fn._scrollable = function() {
|
||||
return this.map(function() {
|
||||
var elem = this,
|
||||
isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;
|
||||
|
||||
if (!isWin)
|
||||
return elem;
|
||||
|
||||
var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
|
||||
|
||||
return /webkit/i.test(navigator.userAgent) || doc.compatMode == 'BackCompat' ?
|
||||
doc.body :
|
||||
doc.documentElement;
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.scrollTo = function( target, duration, settings ) {
|
||||
if (typeof duration == 'object') {
|
||||
settings = duration;
|
||||
duration = 0;
|
||||
}
|
||||
if (typeof settings == 'function')
|
||||
settings = { onAfter:settings };
|
||||
|
||||
if (target == 'max')
|
||||
target = 9e9;
|
||||
|
||||
settings = $.extend( {}, $scrollTo.defaults, settings );
|
||||
// Speed is still recognized for backwards compatibility
|
||||
duration = duration || settings.duration;
|
||||
// Make sure the settings are given right
|
||||
settings.queue = settings.queue && settings.axis.length > 1;
|
||||
|
||||
if (settings.queue)
|
||||
// Let's keep the overall duration
|
||||
duration /= 2;
|
||||
settings.offset = both( settings.offset );
|
||||
settings.over = both( settings.over );
|
||||
|
||||
return this._scrollable().each(function() {
|
||||
// Null target yields nothing, just like jQuery does
|
||||
if (target == null) return;
|
||||
|
||||
var elem = this,
|
||||
$elem = $(elem),
|
||||
targ = target, toff, attr = {},
|
||||
win = $elem.is('html,body');
|
||||
|
||||
switch (typeof targ) {
|
||||
// A number will pass the regex
|
||||
case 'number':
|
||||
case 'string':
|
||||
if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
|
||||
targ = both( targ );
|
||||
// We are done
|
||||
break;
|
||||
}
|
||||
// Relative/Absolute selector, no break!
|
||||
targ = win ? $(targ) : $(targ, this);
|
||||
if (!targ.length) return;
|
||||
case 'object':
|
||||
// DOMElement / jQuery
|
||||
if (targ.is || targ.style)
|
||||
// Get the real position of the target
|
||||
toff = (targ = $(targ)).offset();
|
||||
}
|
||||
|
||||
var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
|
||||
|
||||
$.each( settings.axis.split(''), function( i, axis ) {
|
||||
var Pos = axis == 'x' ? 'Left' : 'Top',
|
||||
pos = Pos.toLowerCase(),
|
||||
key = 'scroll' + Pos,
|
||||
old = elem[key],
|
||||
max = $scrollTo.max(elem, axis);
|
||||
|
||||
if (toff) {// jQuery / DOMElement
|
||||
attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );
|
||||
|
||||
// If it's a dom element, reduce the margin
|
||||
if (settings.margin) {
|
||||
attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
|
||||
attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
|
||||
}
|
||||
|
||||
attr[key] += offset[pos] || 0;
|
||||
|
||||
if(settings.over[pos])
|
||||
// Scroll to a fraction of its width/height
|
||||
attr[key] += targ[axis=='x'?'width':'height']() * settings.over[pos];
|
||||
} else {
|
||||
var val = targ[pos];
|
||||
// Handle percentage values
|
||||
attr[key] = val.slice && val.slice(-1) == '%' ?
|
||||
parseFloat(val) / 100 * max
|
||||
: val;
|
||||
}
|
||||
|
||||
// Number or 'number'
|
||||
if (settings.limit && /^\d+$/.test(attr[key]))
|
||||
// Check the limits
|
||||
attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max );
|
||||
|
||||
// Queueing axes
|
||||
if (!i && settings.queue) {
|
||||
// Don't waste time animating, if there's no need.
|
||||
if (old != attr[key])
|
||||
// Intermediate animation
|
||||
animate( settings.onAfterFirst );
|
||||
// Don't animate this axis again in the next iteration.
|
||||
delete attr[key];
|
||||
}
|
||||
});
|
||||
|
||||
animate( settings.onAfter );
|
||||
|
||||
function animate( callback ) {
|
||||
$elem.animate( attr, duration, settings.easing, callback && function() {
|
||||
callback.call(this, targ, settings);
|
||||
});
|
||||
}
|
||||
}).end();
|
||||
};
|
||||
|
||||
// Max scrolling position, works on quirks mode
|
||||
// It only fails (not too badly) on IE, quirks mode.
|
||||
$scrollTo.max = function( elem, axis ) {
|
||||
var Dim = axis == 'x' ? 'Width' : 'Height',
|
||||
scroll = 'scroll'+Dim;
|
||||
|
||||
if (!$(elem).is('html,body'))
|
||||
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
|
||||
|
||||
var size = 'client' + Dim,
|
||||
html = elem.ownerDocument.documentElement,
|
||||
body = elem.ownerDocument.body;
|
||||
|
||||
return Math.max( html[scroll], body[scroll] ) - Math.min( html[size] , body[size] );
|
||||
};
|
||||
|
||||
function both( val ) {
|
||||
return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
|
||||
}
|
||||
|
||||
// AMD requirement
|
||||
return $scrollTo;
|
||||
})
|
||||
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
// Node
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}));
|
@ -1,73 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "LeftPanel",
|
||||
classes: "onyx-toolbar",
|
||||
kind: "Scroller",
|
||||
/* touch:true, */
|
||||
style: "width: 200px;height:100%;margin:0px;",
|
||||
accelerated: true,
|
||||
horizontal: "hidden",
|
||||
//strategyKind: "TranslateScrollStrategy",
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
this.$.strategy.setTranslateOptimized = true;
|
||||
},
|
||||
components: [
|
||||
{tag: "center", components:[
|
||||
{tag: "img", ontap: "openRoot",src: "rlogo-tr.png", style: "margin:0px;margin-bottom:20px;cursor:pointer" },
|
||||
{kind: "Group", onActivate:"buttonActivated", classes: "enyo-border-box group", defaultKind: "onyx.Button", highlander: true, components: [
|
||||
{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: "Hexdump", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Hexdump" },
|
||||
{content: "Graph", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Graph" },
|
||||
{content: "Search", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Search" },
|
||||
{content: "Console", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Console" },
|
||||
{content: "Debugger", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Debugger" },
|
||||
{content: "Script", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Script" },
|
||||
{content: "Settings", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Settings" },
|
||||
{content: "Logs", classes: "onyx-dark menu-button", ontap:"openPanel", name: "Logs" },
|
||||
{content: "About", classes: "onyx-dark menu-button" , ontap: "openPanel", name:"About"},
|
||||
]}
|
||||
]},
|
||||
],
|
||||
openRoot: function() {
|
||||
window.location = "..";
|
||||
},
|
||||
openPanel2: function() {
|
||||
this.ra.setIndex (2);
|
||||
},
|
||||
openPanel: function (x) {
|
||||
if (enyo.Panels.isScreenNarrow())
|
||||
this.ra.setIndex (1);
|
||||
if (x.name == this.oname)
|
||||
this.ra.setIndex (1);
|
||||
this.oname = x.name;
|
||||
r2ui.selected_panel = this.oname;
|
||||
if (this.oname === "Logs")
|
||||
r2ui._log.connect();
|
||||
if (this.openCallback)
|
||||
this.openCallback (x.name);
|
||||
},
|
||||
oname: null,
|
||||
ra: null,
|
||||
oldSender: null,
|
||||
rowTap: function (inSender, inIndex) {
|
||||
if (this.oldSender)
|
||||
this.oldSender.setStyle ("width:100%"); // background of row
|
||||
// TODO. use applystall
|
||||
//this.$.list.render ();
|
||||
inSender.setStyle ("background-color: #202020;width:100%"); // background of row
|
||||
this.oldSender = inSender;
|
||||
if (this.openCallback)
|
||||
this.openCallback (inIndex.index); //this.data[inIndex.index]);
|
||||
},
|
||||
openCallback: undefined,
|
||||
data: [],
|
||||
iter: 1,
|
||||
refresh: function () {
|
||||
this.iter++;
|
||||
/*
|
||||
this.$.list.setCount (this.data.length);
|
||||
this.$.list.refresh ();
|
||||
*/
|
||||
},
|
||||
});
|
@ -1,34 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Logs",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#c0c0c0;padding-left:8px",
|
||||
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: "sendMessage", attributes: {autocapitalize:"off"}, name: "input"},
|
||||
]},
|
||||
{tag: "pre", classes:"r2ui-terminal", style:"width:90%;", fit: true, allowHtml: true, name:"output"}
|
||||
]}
|
||||
]}
|
||||
],
|
||||
logger: null,
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
r2ui._log = this;
|
||||
},
|
||||
connect: function() {
|
||||
var out = this.$.output;
|
||||
this.logger = r2.getTextLogger ().on ("message", function (msg) {
|
||||
out.setContent (out.getContent() + msg.text + "\n");
|
||||
});
|
||||
this.logger.autorefresh (3);
|
||||
},
|
||||
sendMessage: function (inSender, inEvent) {
|
||||
if (inEvent.keyCode === 13) {
|
||||
var msg = this.$.input.getValue ();
|
||||
this.$.input.setValue ("");
|
||||
this.logger.send (msg);
|
||||
}
|
||||
}
|
||||
});
|
@ -1,86 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "RadareApp",
|
||||
kind: "Panels",
|
||||
classes: "panels enyo-unselectable",
|
||||
realtimeFit: true,
|
||||
fit: true,
|
||||
arrangerKind: "CollapsingArranger",
|
||||
components: [
|
||||
{ name: "lp", kind: "LeftPanel" },
|
||||
{ name: "mp", kind: "MainPanel" },
|
||||
{ name: "rp", kind: "RightPanel" },
|
||||
{ kind: enyo.Signals, onkeypress: "handleKeyPress" }
|
||||
],
|
||||
handlers: {
|
||||
onTransitionFinish: "handleTransitionFinish"
|
||||
},
|
||||
handleTransitionFinish: function() {
|
||||
if (r2ui._dis.display == "graph" && r2ui._dis.minimap) update_minimap();
|
||||
},
|
||||
setPanel0: function () {
|
||||
this.$.RadareApp.setIndex (1);
|
||||
},
|
||||
create: function() {
|
||||
r2.load_settings();
|
||||
this.inherited (arguments);
|
||||
var data = [
|
||||
{ name: "Disassembler", active: true },
|
||||
{ name: "Assembler" },
|
||||
{ name: "Hexdump" },
|
||||
{ name: "Graph" },
|
||||
{ name: "Search" },
|
||||
{ name: "Console" },
|
||||
{ name: "Debugger" },
|
||||
{ name: "Script" },
|
||||
{ name: "Settings", separator: true },
|
||||
{ name: "Logs" },
|
||||
{ name: "About" }
|
||||
];
|
||||
this.$.lp.data = data;
|
||||
this.$.mp.data = data;
|
||||
r2ui.ra =
|
||||
this.$.mp.ra =
|
||||
this.$.lp.ra =
|
||||
this.$.rp.ra = this;
|
||||
var mp = this.$.mp;
|
||||
r2ui.mp = mp;
|
||||
this.$.lp.openCallback = function (idx) {
|
||||
mp.openPage (idx);
|
||||
};
|
||||
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.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);
|
||||
}
|
||||
*/
|
||||
}
|
||||
});
|
||||
|
||||
window.onload = function() {
|
||||
var obj = new RadareApp ().renderInto (document.body)
|
||||
}
|
@ -1,359 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "MainPanel",
|
||||
classes: "onyx",
|
||||
kind: "FittableRows",
|
||||
classes: "enyo-fit",
|
||||
style: "margin:0px;padding:0px;border:0px",
|
||||
//style: "background-color: #c0c0c0",
|
||||
data: null,
|
||||
/*
|
||||
refresh: function () {
|
||||
this.$.list.setCount (this.data.length);
|
||||
this.$.list.refresh (); // necessary?? // inherit??
|
||||
},
|
||||
*/
|
||||
/* callbacks */
|
||||
buttonClicked: function (x) {
|
||||
alert ("let's play!");
|
||||
},
|
||||
cancelClicked: function (x) {
|
||||
alert ("nothing to see here! move along.");
|
||||
},
|
||||
inputKey: function (inSender, inEvent) {
|
||||
if (inEvent.keyCode === 13) {
|
||||
var off = this.$.input.getValue ();
|
||||
// this.$.input.setValue ("");
|
||||
r2ui.opendis(off);
|
||||
}
|
||||
},
|
||||
/* menu actions */
|
||||
goRename: function() {
|
||||
var msg = prompt ('New name?', '');
|
||||
if(msg)
|
||||
r2.cmd("afr "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goComment: function() {
|
||||
var msg = prompt ('Comment?', '');
|
||||
if(msg)
|
||||
r2.cmd("CC "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goFlag: function() {
|
||||
var msg = prompt ('Flag name?', '');
|
||||
if(msg)
|
||||
r2.cmd("f "+msg, function() {
|
||||
r2.update_flags();
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goUnflag: function() {
|
||||
r2.cmd("f-$$", function() {
|
||||
r2.update_flags();
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goAnalyze: function() {
|
||||
r2.cmd("af", function() {
|
||||
r2.update_flags();
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goCopy: function() {
|
||||
var msg = prompt ('How many bytes?', '');
|
||||
if(msg && msg>0)
|
||||
r2.cmd("y "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
goPaste: function() {
|
||||
r2.cmd("yy", function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
/*-- write */
|
||||
wrString: function() {
|
||||
var msg = prompt ('Text', '');
|
||||
if(msg)
|
||||
r2.cmd("w "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
wrOpcode: function() {
|
||||
var msg = prompt ('Opcode', '');
|
||||
if(msg)
|
||||
r2.cmd ("wa "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
wrFile: function() {
|
||||
var msg = prompt ('Filename', '');
|
||||
if(msg)
|
||||
r2.cmd("wf "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
wrHex: function() {
|
||||
var msg = prompt ('Hexpair', '');
|
||||
if(msg)
|
||||
r2.cmd("wx "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
/* -- convert */
|
||||
coCode: function() {
|
||||
var msg = prompt ('How many bytes?', '');
|
||||
if(msg)
|
||||
r2.cmd("y "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
coString: function() {
|
||||
r2.cmd("Cz", function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
coData: function() {
|
||||
var msg = prompt ('How many bytes?', '');
|
||||
if(msg)
|
||||
r2.cmd("Cd "+msg, function() {
|
||||
r2ui.seek("$$", false);
|
||||
});
|
||||
},
|
||||
setTitle: function (title) {
|
||||
if (title) {
|
||||
this.$.title.setContent (title);
|
||||
this.$.title.setStyle ("visibility:visible;top:8px");
|
||||
this.$.extra.setStyle ("visibility:hidden;");//position:absolute;left:48px;scroll:overflow");
|
||||
} else {
|
||||
this.$.title.setStyle ("visibility:hidden");
|
||||
this.$.extra.setStyle ("visibility:visible;");//position:absolute;left:48px;scroll:overflow");
|
||||
}
|
||||
},
|
||||
/* widgets dom */
|
||||
components: [
|
||||
{kind: "onyx.Toolbar", name: "toolbar", components: [
|
||||
//{kind: "onyx.MoreToolbar", components: [
|
||||
{kind: "onyx.Button", content: "[", ontap: "openSidebar", classes: "top" },
|
||||
{kind: "onyx.Button", content: "]", ontap: "openSidebar2", classes: "top" },
|
||||
// {kind: "onyx.Button", content: "C", ontap: "openConsole", classes: "top" },
|
||||
{name: "title", tag: "h2", content: "Assembler", classes: "topbox", style: "visibility:hidden;" },
|
||||
{name: "extra", tag: "div", classes: "topbox", components: [
|
||||
//style: "position:absolute;top:0px;left:48px;scroll:overflow;visibility:visible", components: [
|
||||
/*
|
||||
{kind: "onyx.Button", content: "]", ontap: "openSidebar2", style: "padding:4px"},
|
||||
*/
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", name: "actionsButton", content: "Actions"},
|
||||
{kind: "onyx.Picker", name: "actionsPicker", components: [
|
||||
{content: "Analyze", ontap: "goAnalyze"},
|
||||
{content: "Rename", ontap: "goRename"},
|
||||
{content: "Comment", ontap: "goComment"},
|
||||
{content: "Flag", ontap: "goFlag"},
|
||||
{content: "Unflag", ontap: "goUnflag"},
|
||||
{content: "Copy", ontap: "goCopy"},
|
||||
{content: "Paste", ontap: "goPaste"}
|
||||
]}
|
||||
]},
|
||||
{kind: "onyx.Button", content: "<", ontap: "prevSeek", classes: "top", style: "top:10px" },
|
||||
{kind: "onyx.Button", content: ">", ontap: "nextSeek", classes: "top", style: "top:10px" },
|
||||
{kind: "onyx.InputDecorator", style: "width: 200px;top:10px", classes: "top", components: [
|
||||
{kind: "onyx.Input", name:"input", value: 'entry0', onchange: "gotoSeek", onkeydown:"inputKey" }
|
||||
]},
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", content: "Convert"},
|
||||
{kind: "onyx.Picker", components: [
|
||||
{content: "Data", ontap: 'coData'},
|
||||
{content: "Code", ontap: 'coCode'},
|
||||
{content: "String", ontap: 'coString'},
|
||||
]}
|
||||
]},
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", content: "Write"},
|
||||
{kind: "onyx.Picker", components: [
|
||||
{content: "File", ontap: 'wrFile'},
|
||||
{content: "Hexpair", ontap: 'wrHex'},
|
||||
{content: "String", ontap: 'wrString'},
|
||||
{content: "Opcode", ontap: 'wrOpcode'},
|
||||
]}
|
||||
]},
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", name: "saveButton", content: "Save", ontap: "save_project"}
|
||||
]},
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", name: "switchButton", content: "Switch View", ontap: "switch_view"}
|
||||
]},
|
||||
{kind: "onyx.PickerDecorator", classes: "top", components: [
|
||||
{kind: "onyx.Button", name: "helpButton", content: "?", ontap: "show_popup"},
|
||||
{name: "basicPopup", kind: "onyx.Popup", floating: true, centered: true,
|
||||
style: "padding: 10px", components: [
|
||||
{name: "popupContent", allowHtml: true, content: ".."}
|
||||
]
|
||||
}
|
||||
]},
|
||||
]},
|
||||
]},
|
||||
{kind: "Panels",
|
||||
name:"panels",
|
||||
fit:true,
|
||||
realtimeFit: true,
|
||||
components: []}
|
||||
],
|
||||
show_popup: function(inSender, inEvent) {
|
||||
this.$.basicPopup.show();
|
||||
},
|
||||
switch_view: function(inSender, inEvent) {
|
||||
r2ui._dis.switch_view();
|
||||
},
|
||||
save_project: function(inSender, inEvent) {
|
||||
var project_name = prompt("Project Name:", r2.project_name);
|
||||
r2.cmd (":Ps " + project_name, function (x){});
|
||||
r2.project_name = project_name;
|
||||
},
|
||||
create: function() {
|
||||
this.inherited(arguments);
|
||||
|
||||
var mode = readCookie('r2_view_mode');
|
||||
if (!mode) mode = "old";
|
||||
|
||||
if (mode === "old") {
|
||||
this.$.panels.createComponents([
|
||||
{kind:"DisassemblerOld", name: "pageDisassembler"},
|
||||
{kind:"Assembler", name:"pageAssembler"},
|
||||
{kind:"Hexdump", name: "pageHexdump"},
|
||||
{kind:"Graph", name: "pageGraph"},
|
||||
{kind:"Search", name: "pageSearch"},
|
||||
{kind:"Console", name: "pageConsole"},
|
||||
{kind:"Debugger", name: "pageDebugger"},
|
||||
{kind:"Logs", name: "pageLogs"},
|
||||
{kind:"Script", name: "pageScript"},
|
||||
{kind:"Settings", name:"pageSettings"},
|
||||
{kind:"About", name: "pageAbout"},
|
||||
]);
|
||||
this.$.helpButton.hide();
|
||||
this.$.switchButton.hide();
|
||||
} else {
|
||||
this.$.panels.createComponents([
|
||||
{kind:"Disassembler", name: "pageDisassembler"},
|
||||
{kind:"Assembler", name:"pageAssembler"},
|
||||
{kind:"Hexdump", name: "pageHexdump"},
|
||||
{kind:"Graph", name: "pageGraph"},
|
||||
{kind:"Search", name: "pageSearch"},
|
||||
{kind:"Console", name: "pageConsole"},
|
||||
{kind:"Debugger", name: "pageDebugger"},
|
||||
{kind:"Logs", name: "pageLogs"},
|
||||
{kind:"Script", name: "pageScript"},
|
||||
{kind:"Settings", name:"pageSettings"},
|
||||
{kind:"About", name: "pageAbout"},
|
||||
]);
|
||||
var helpMsg = "<table class='help'>" +
|
||||
"<tr><td>h,l</td><td>Move back and forth in history</td></tr>" +
|
||||
"<tr><td>j,k</td><td>Move to next or previous instruction</td></tr>" +
|
||||
"<tr><td>g</td><td>Go to address</td></tr>" +
|
||||
"<tr><td>n</td><td>Rename</td></tr>" +
|
||||
"<tr><td>c</td><td>Define function at current address</td></tr>" +
|
||||
"<tr><td>d</td><td>Remove function metadata for current address</td></tr>" +
|
||||
"<tr><td>enter</td><td>When address is selected, go to address</td></tr>" +
|
||||
"<tr><td>;</td><td>Add comment</td></tr>" +
|
||||
"<tr><td>m</td>Toggle minimap</td></tr>" +
|
||||
"<tr><td>?</td><td>Display this help</td></tr>" +
|
||||
"</table>";
|
||||
|
||||
this.$.popupContent.setContent(helpMsg);
|
||||
}
|
||||
this.render();
|
||||
r2ui.panels = this.$.panels;
|
||||
this.$.panels.setIndex(0);
|
||||
},
|
||||
ra: null,
|
||||
openSidebar: function() {
|
||||
this.ra.setIndex (this.ra.index? 0:1);
|
||||
},
|
||||
openSidebar2: function() {
|
||||
this.ra.setIndex (2); //(this.ra.index<2)? 2:1);
|
||||
},
|
||||
rendered: function() {
|
||||
this.inherited(arguments);
|
||||
},
|
||||
openPage: function(idx) {
|
||||
var str, sp = this.$.panels;
|
||||
// TODO: this is just a hack
|
||||
var r = -1;
|
||||
switch (idx) {
|
||||
case "Disassembler": r = 0; break;
|
||||
case "Assembler": r = 1; break;
|
||||
case "Hexdump": r = 2; break;
|
||||
case "Graph": r = 3; break;
|
||||
case "Search": r = 4; break;
|
||||
case "Console": r = 5; break;
|
||||
case "Debugger": r = 6; break;
|
||||
case "Logs": r = 7; break;
|
||||
case "Script": r = 8; break;
|
||||
case "Settings": r = 9; break;
|
||||
case "About": r = 10; break;
|
||||
}
|
||||
if (r==-1) {
|
||||
// alert ("Unknown page");
|
||||
sp.setIndex (idx);
|
||||
return;
|
||||
}
|
||||
eval("var x = this.$.page"+idx);
|
||||
switch (r) {
|
||||
case 0:
|
||||
case 2:
|
||||
this.setTitle ();
|
||||
break;
|
||||
default:
|
||||
this.setTitle (idx);
|
||||
break;
|
||||
}
|
||||
//x.setContent (str);
|
||||
sp.setIndex (r);
|
||||
},
|
||||
seekStack: [],
|
||||
nextSeek: function() {
|
||||
var addr = r2ui.history_next();
|
||||
if (!addr) return;
|
||||
r2ui.seek(addr, false);
|
||||
//alert ("nxt "+addr);
|
||||
},
|
||||
prevSeek: function() {
|
||||
var addr = r2ui.history_prev();
|
||||
if (!addr) return;
|
||||
r2ui.seek(addr, false);
|
||||
//r2ui.history_prev (), true);
|
||||
//alert ("pop "+addr);
|
||||
},
|
||||
gotoSeek: function() {
|
||||
var addr = this.$.input.getValue();
|
||||
if (addr[0]=='!') {
|
||||
r2.cmd (addr.slice (1), function (x) {
|
||||
alert (x);
|
||||
});
|
||||
} else {
|
||||
r2ui.seek(addr);
|
||||
// this.seekStack.push ();
|
||||
}
|
||||
/*
|
||||
var sp = this.$.panels;
|
||||
//this.openPage (this.$.input.getValue());
|
||||
//sp.components[3].setContent ("JAJAJ");
|
||||
this.$.page3.setContent ("content-a");
|
||||
alert (sp.components[3].content);
|
||||
sp.components[3].content = "JAJAJ";
|
||||
sp.reflow();
|
||||
sp.render ();
|
||||
sp.setIndex(3);
|
||||
var i = 3;
|
||||
var p = sp.createComponent ({
|
||||
style:"background: red",
|
||||
content:i
|
||||
});
|
||||
p.render();
|
||||
sp.reflow();
|
||||
sp.setIndex(3);
|
||||
*/
|
||||
}
|
||||
});
|
@ -1,593 +0,0 @@
|
||||
/* radare2 Copyleft 2013-2014 pancake */
|
||||
|
||||
var r2 = {};
|
||||
|
||||
// TODO: avoid globals
|
||||
var backward = false;
|
||||
var next_curoff = 0;
|
||||
var next_lastoff = 0;
|
||||
var prev_curoff = 0;
|
||||
var prev_lastoff = 0;
|
||||
var hascmd = false;
|
||||
|
||||
// async helper
|
||||
function asyncLoop(iterations, func, callback) {
|
||||
var index = 0;
|
||||
var done = false;
|
||||
var loop = {
|
||||
next: function() {
|
||||
if (done) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (index < iterations) {
|
||||
index++;
|
||||
func(loop);
|
||||
|
||||
} else {
|
||||
done = true;
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
iteration: function() {
|
||||
return index - 1;
|
||||
},
|
||||
|
||||
break: function() {
|
||||
done = true;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
loop.next();
|
||||
return loop;
|
||||
}
|
||||
|
||||
if (typeof (module) !== 'undefined') {
|
||||
module.exports = function(r) {
|
||||
if (typeof (r) == 'function') {
|
||||
hascmd = r;
|
||||
} else {
|
||||
hascmd = r.cmd;
|
||||
}
|
||||
return r2;
|
||||
}
|
||||
}
|
||||
|
||||
r2.project_name = "";
|
||||
|
||||
r2.plugin = function() {
|
||||
console.error ("r2.plugin is not available in this environment");
|
||||
}
|
||||
try {
|
||||
if (r2plugin) {
|
||||
r2.plugin = r2plugin
|
||||
}
|
||||
} catch ( e ) {}
|
||||
|
||||
r2.root = ""; // prefix path
|
||||
|
||||
/* helpers */
|
||||
function dump(obj) {
|
||||
var x = "";
|
||||
for (var a in obj) x += a + "\n";
|
||||
if (typeof ('alert') != 'undefined') {
|
||||
alert (x);
|
||||
} else {
|
||||
console.log (x);
|
||||
}
|
||||
}
|
||||
|
||||
r2.analAll = function() {
|
||||
r2.cmd ("aa", function() {});
|
||||
}
|
||||
|
||||
r2.analOp = function(addr, cb) {
|
||||
r2.cmd ("aoj 1 @ " + addr, function(txt) {
|
||||
try {
|
||||
cb(JSON.parse (txt)[0]);
|
||||
} catch ( e ) {
|
||||
console.error (e)
|
||||
cb (txt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.varMap = [];
|
||||
r2.argMap = [];
|
||||
|
||||
function objtostr(obj) {
|
||||
var str = "";
|
||||
for (var a in obj)
|
||||
str += a + ": " + obj[a] + ",\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
function Ajax(method, uri, body, fn) {
|
||||
if (typeof (XMLHttpRequest) == "undefined")
|
||||
return false;
|
||||
var x = new XMLHttpRequest ();
|
||||
if (!x)
|
||||
return false;
|
||||
x.open (method, uri, false);
|
||||
x.setRequestHeader ('Accept', 'text/plain');
|
||||
x.setRequestHeader ('Accept', 'text/html');
|
||||
x.setRequestHeader ("Content-Type", "application/x-ww-form-urlencoded; charset=UTF-8");
|
||||
x.onreadystatechange = function(y) {
|
||||
if (x.status == 200) {
|
||||
if (fn) {
|
||||
fn (x.responseText);
|
||||
}
|
||||
} else {
|
||||
console.error ("ajax " + x.status)
|
||||
}
|
||||
}
|
||||
x.send (body);
|
||||
return true;
|
||||
}
|
||||
|
||||
r2.assemble = function(offset, opcode, fn) {
|
||||
var off = offset ? "@" + offset : '';
|
||||
r2.cmd ('"pa ' + opcode + '"' + off, fn);
|
||||
}
|
||||
|
||||
r2.disassemble = function(offset, bytes, fn) {
|
||||
var off = offset ? "@" + offset : '';
|
||||
var str = 'pi @b:' + bytes + off;
|
||||
r2.cmd (str, fn);
|
||||
}
|
||||
|
||||
r2.get_hexdump = function(offset, length, cb) {
|
||||
r2.cmd ("px " + length + "@" + offset, cb);
|
||||
}
|
||||
|
||||
r2.get_disasm = function(offset, length, cb) {
|
||||
// TODO: honor offset and length
|
||||
r2.cmd ("pD " + length + "@" + offset, cb);
|
||||
}
|
||||
|
||||
r2.get_disasm_before = function(offset, start, cb) {
|
||||
var before = [];
|
||||
r2.cmd("pdj -" + start + "@" + offset, function(x) {
|
||||
before = JSON.parse(x);
|
||||
});
|
||||
cb(before);
|
||||
}
|
||||
|
||||
r2.get_disasm_after = function(offset, end, cb) {
|
||||
var after = [];
|
||||
r2.cmd("pdj " + end + "@" + offset, function(x) {
|
||||
after = JSON.parse(x);
|
||||
});
|
||||
cb(after);
|
||||
}
|
||||
|
||||
r2.get_disasm_before_after = function(offset, start, end, cb) {
|
||||
var before = [];
|
||||
var after = [];
|
||||
r2.cmd("pdj " + start + " @" + offset, function(x) {
|
||||
before = JSON.parse(x);
|
||||
});
|
||||
r2.cmd("pdj " + end + "@" + offset, function(x) {
|
||||
after = JSON.parse(x);
|
||||
});
|
||||
var opcodes = before.concat(after);
|
||||
cb(opcodes);
|
||||
}
|
||||
|
||||
r2.Config = function(k, v, fn) {
|
||||
if (typeof v == 'function' || !v) { // get
|
||||
r2.cmd ("e " + k, fn || v);
|
||||
} else { // set
|
||||
r2.cmd ("e " + k + "=" + v, fn);
|
||||
}
|
||||
return r2;
|
||||
}
|
||||
|
||||
r2.sections = {};
|
||||
|
||||
r2.load_mmap = function() {
|
||||
r2.cmdj("iSj", function(x) {
|
||||
if (x !== undefined && x !== null) {
|
||||
r2.sections = x;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_address_type = function(address) {
|
||||
var offset = parseInt(address, 16);
|
||||
for (var i in r2.sections) {
|
||||
if (offset >= r2.sections[i].addr && offset < r2.sections[i].addr + r2.sections[i].size) {
|
||||
if (r2.sections[i].flags.indexOf("x") > -1) {
|
||||
return "instruction";
|
||||
}
|
||||
else {
|
||||
return "memory";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
r2.settings = {};
|
||||
|
||||
r2.load_settings = function() {
|
||||
r2.cmd ("e asm.arch", function(x) {r2.settings['asm.arch'] = x.trim();});
|
||||
r2.cmd ("e asm.bits", function(x) {r2.settings['asm.bits'] = x.trim();});
|
||||
r2.cmd ("e asm.bytes", function(x) {r2.settings['asm.bytes'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.flags", function(x) {r2.settings['asm.flags'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.offset", function(x) {r2.settings['asm.offset'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.lines", function(x) {r2.settings['asm.lines'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.xrefs", function(x) {r2.settings['asm.xrefs'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.cmtright", function(x) {r2.settings['asm.cmtright'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.pseudo", function(x) {r2.settings['asm.pseudo'] = toBoolean(x.trim());});
|
||||
// console.log("Loading settings from r2");
|
||||
// console.log(r2.settings);
|
||||
}
|
||||
|
||||
|
||||
r2.flags = {};
|
||||
|
||||
r2.update_flags = function() {
|
||||
r2.cmd ("fs *;fj", function(x) {
|
||||
|
||||
var fs = JSON.parse (x);
|
||||
if (fs !== undefined && fs !== null) {
|
||||
r2.flags = {};
|
||||
for (var f in fs) {
|
||||
var addr = "0x" + fs[f].offset.toString(16);
|
||||
addr = address_canonicalize(addr);
|
||||
if (addr in r2.flags) {
|
||||
var fl = r2.flags[addr];
|
||||
fl[fl.length] = { name: fs[f].name, size: fs[f].size};
|
||||
r2.flags[addr] = fl;
|
||||
} else {
|
||||
r2.flags[addr] = [{ name: fs[f].name, size: fs[f].size}];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_flag_address = function(name) {
|
||||
for (var f in r2.flags) {
|
||||
for (var v in r2.flags[f]) {
|
||||
if (name == r2.flags[f][v].name) return f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
r2.get_flag_names = function(offset) {
|
||||
var names = [];
|
||||
for (var i in r2.flags[offset]) {
|
||||
names[names.length] = r2.flags[offset][i].name;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
r2.set_flag_space = function(ns, fn) {
|
||||
r2.cmd ("fs " + ns, fn);
|
||||
}
|
||||
|
||||
r2.get_flags = function(fn) {
|
||||
r2.cmd ("fj", function(x) {
|
||||
fn (x ? JSON.parse (x) : []);
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_opcodes = function(off, n, cb) {
|
||||
r2.cmd ("pdj @" + off + "!" + n, function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_bytes = function(off, n, cb) {
|
||||
r2.cmd ("pcj @" + off + "!" + n, function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.asm_config = {};
|
||||
|
||||
r2.store_asm_config = function() {
|
||||
config = {};
|
||||
r2.cmd ("e", function(x) {
|
||||
conf = x.split("\n");
|
||||
for (var prop in conf) {
|
||||
var fields = conf[prop].split(" ");
|
||||
if (fields.length == 3) {
|
||||
// TODO: Dont know why byt e~asm. is not working so filtering here
|
||||
if (fields[0].trim().indexOf("asm.") == 0) config[fields[0].trim()] = fields[2].trim();
|
||||
}
|
||||
}
|
||||
r2.asm_config = config;
|
||||
});
|
||||
}
|
||||
|
||||
r2.restore_asm_config = function() {
|
||||
cmd = "";
|
||||
for (var prop in r2.asm_config) {
|
||||
cmd += "e " + prop + "=" + r2.asm_config[prop] + ";";
|
||||
}
|
||||
r2.cmd (cmd, function(x) {});
|
||||
}
|
||||
|
||||
r2.get_info = function(cb) {
|
||||
r2.cmd ("ij", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
r2.bin_relocs = function(cb) {
|
||||
r2.cmd ("irj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
r2.bin_imports = function(cb) {
|
||||
r2.cmd ("iij", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.bin_symbols = function(cb) {
|
||||
r2.cmd ("isj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.bin_sections = function(cb) {
|
||||
r2.cmd ("iSj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.cmds = function(cmds, cb) {
|
||||
if (cmds.length == 0) return;
|
||||
var cmd = cmds[0];
|
||||
cmds = cmds.splice (1);
|
||||
function lala() {
|
||||
if (cmd == undefined || cmds.length == 0) {
|
||||
return;
|
||||
}
|
||||
cmd = cmds[0];
|
||||
cmds = cmds.splice (1);
|
||||
r2.cmd (cmd, lala);
|
||||
if (cb) {
|
||||
cb ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
r2.cmd (cmd, lala);
|
||||
}
|
||||
|
||||
function _internal_cmd(c, cb) {
|
||||
if (typeof (r2cmd) != 'undefined') {
|
||||
hascmd = r2cmd;
|
||||
}
|
||||
if (hascmd) {
|
||||
// TODO: use setTimeout for async?
|
||||
if (typeof (r2plugin) != "undefined") {
|
||||
// duktape
|
||||
cb (r2cmd(c));
|
||||
} else {
|
||||
// node
|
||||
return hascmd (c, cb);
|
||||
}
|
||||
} else {
|
||||
Ajax ('GET', r2.root + "/cmd/" + encodeURI(c), '', function(x) {
|
||||
if (cb) {
|
||||
cb (x);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
r2.cmd = function(c, cb) {
|
||||
if (Array.isArray (c)) {
|
||||
var res = [];
|
||||
var idx = 0;
|
||||
asyncLoop (c.length, function(loop) {
|
||||
_internal_cmd (c[idx], function(result) {
|
||||
idx = loop.iteration();
|
||||
res[idx] = result.replace(/\n$/, "");
|
||||
idx++;
|
||||
loop.next ();
|
||||
});
|
||||
}, function() {
|
||||
// all iterations done
|
||||
cb (res);
|
||||
});
|
||||
} else {
|
||||
_internal_cmd (c, cb);
|
||||
}
|
||||
}
|
||||
|
||||
r2.cmdj = function(c, cb) {
|
||||
r2.cmd (c, function(x) {
|
||||
try {
|
||||
cb (JSON.parse(x));
|
||||
} catch ( e ) {
|
||||
cb (null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.alive = function(cb) {
|
||||
r2.cmd ("b", function(o) {
|
||||
var ret = false;
|
||||
if (o && o.length () > 0) {
|
||||
ret = true;
|
||||
}
|
||||
if (cb) {
|
||||
cb (o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.getTextLogger = function(obj) {
|
||||
if (typeof (obj) != "object") {
|
||||
obj = {};
|
||||
}
|
||||
obj.last = 0;
|
||||
obj.events = {};
|
||||
obj.interval = null;
|
||||
r2.cmd ("Tl", function(x) {
|
||||
obj.last = +x;
|
||||
});
|
||||
obj.load = function(cb) {
|
||||
r2.cmd ("Tj " + (obj.last + 1), function(ret) {
|
||||
if (cb) {
|
||||
cb (JSON.parse (ret));
|
||||
}
|
||||
});
|
||||
}
|
||||
obj.clear = function(cb) {
|
||||
// XXX: fix l-N
|
||||
r2.cmd ("T-", cb); //+obj.last, cb);
|
||||
}
|
||||
obj.send = function(msg, cb) {
|
||||
r2.cmd ("T " + msg, cb);
|
||||
}
|
||||
obj.refresh = function(cb) {
|
||||
obj.load (function(ret) {
|
||||
//obj.last = 0;
|
||||
for (var i = 0; i < ret.length; i++) {
|
||||
var message = ret[i];
|
||||
obj.events["message"] ({
|
||||
"id": message[0],
|
||||
"text": message[1]
|
||||
});
|
||||
if (message[0] > obj.last) {
|
||||
obj.last = message[0];
|
||||
}
|
||||
}
|
||||
if (cb) {
|
||||
cb ();
|
||||
}
|
||||
});
|
||||
}
|
||||
obj.autorefresh = function(n) {
|
||||
if (!n) {
|
||||
if (obj.interval) {
|
||||
obj.interval.stop ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
function to() {
|
||||
obj.refresh (function() {
|
||||
//obj.clear ();
|
||||
});
|
||||
if (r2ui.selected_panel === "Logs")
|
||||
setTimeout (to, n * 1000);
|
||||
else console.log("Not in logs :(");
|
||||
return true;
|
||||
}
|
||||
obj.interval = setTimeout (to, n * 1000);
|
||||
}
|
||||
obj.on = function(ev, cb) {
|
||||
obj.events[ev] = cb;
|
||||
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:green>function:</span>");
|
||||
x = x.replace (/;(\s+)/g, ";");
|
||||
x = x.replace (/;(.*)/g, "// <span style='color:#209020'>$1</span>");
|
||||
x = x.replace (/(bl|goto|call)/g, "<b style='color:green'>call</b>");
|
||||
x = x.replace (/(jmp|bne|beq|js|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:#1070d0'>$1</b>");
|
||||
x = x.replace (/(hlt|leave|iretd|retn|ret)/g, "<b style='color:red'>$1</b>");
|
||||
x = x.replace (/(add|sbb|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g, "<b style='color:#d06010'>$1</b>");
|
||||
x = x.replace (/(push|pop)/g, "<b style='color:#40a010'>$1</b>");
|
||||
x = x.replace (/(test|cmp)/g, "<b style='color:#c04080'>$1</b>");
|
||||
x = x.replace (/(outsd|out|string|invalid|int |int3|trap|main|in)/g, "<b style='color:red'>$1</b>");
|
||||
x = x.replace (/nop/g, "<b style='color:blue'>nop</b>");
|
||||
x = x.replace (/(sym|fcn|str|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;
|
||||
}
|
||||
|
@ -1,250 +0,0 @@
|
||||
var r2ui = {};
|
||||
|
||||
r2ui.selected_panel = "Disassembler";
|
||||
|
||||
r2ui.history = [];
|
||||
r2ui.history_idx = 0;
|
||||
|
||||
r2ui.colors = {};
|
||||
|
||||
r2ui.load_colors = function () {
|
||||
// change css on the fly!
|
||||
r2.cmdj("ecj", function(x) {
|
||||
for (var i in x) {
|
||||
r2ui.colors[".ec_" + i.replace("gui.","gui_")] = "rgb(" + String(x[i]) + ")";
|
||||
}
|
||||
});
|
||||
for (var k in document.styleSheets) {
|
||||
var mysheet = document.styleSheets[k];
|
||||
var myrules = mysheet.cssRules? mysheet.cssRules: mysheet.rules;
|
||||
var targetrule;
|
||||
for (var j in myrules) {
|
||||
if (myrules[j].selectorText !== undefined && myrules[j].selectorText !== null) {
|
||||
if (myrules[j].selectorText.toLowerCase().indexOf(".ec_") === 0) {
|
||||
var sel = myrules[j].selectorText; //.toLowerCase().replace("gui.","gui_");
|
||||
var color = r2ui.colors[sel];
|
||||
if (color !== undefined && color !== null) {
|
||||
if (sel == ".ec_gui_background" || sel == ".ec_gui_alt_background") {
|
||||
myrules[j].style.backgroundColor = color;
|
||||
} else if (sel == ".ec_border") myrules[j].style.borderColor = color;
|
||||
else myrules[j].style.color = color;
|
||||
} else {
|
||||
if (sel == ".ec_gui_background" || sel == ".ec_gui_alt_background") r2ui.colors[sel] = myrules[j].style.backgroundColor;
|
||||
else if (sel == ".ec_gui_border") r2ui.colors[sel] = myrules[j].style.borderColor;
|
||||
else r2ui.colors[sel] = myrules[j].style.color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
r2ui.basic_blocks = {};
|
||||
r2ui.use_sdb = false;
|
||||
r2ui.get_fcn_BB = function(fcn_offset, bb_offset) {
|
||||
if (r2ui.use_sdb) {
|
||||
var path = "webui/graph/" + fcn_offset + "/" + bb_offset;
|
||||
var bb = undefined;
|
||||
r2.cmd("k " + path, function(x) {
|
||||
var lines = decodeURIComponent(x).split("\n");
|
||||
for (var l in lines) {
|
||||
var line = lines[l];
|
||||
if (line !== "") {
|
||||
bb = {};
|
||||
var props = line.split(",");
|
||||
bb.x = props[0];
|
||||
bb.y = props[1];
|
||||
if (props[2] == "" || props[2] === undefined) props[2] = "transparent";
|
||||
bb.color = props[2].replace(/\*\*/g, ",");
|
||||
}
|
||||
}
|
||||
});
|
||||
return bb;
|
||||
} else {
|
||||
return r2ui.basic_blocks[bb_offset];
|
||||
}
|
||||
};
|
||||
r2ui.get_fcn_BBs = function(fcn_offset) {
|
||||
if (r2ui.use_sdb) {
|
||||
var path = "webui/graph/" + fcn_offset + "/*";
|
||||
var BBs = {};
|
||||
r2.cmd("k " + path, function(x) {
|
||||
var lines = decodeURIComponent(x).split("\n");
|
||||
for (var l in lines) {
|
||||
var line = lines[l];
|
||||
if (line !== "") {
|
||||
offset = line.split("=")[0];
|
||||
line = line.split("=")[1];
|
||||
var bb = {};
|
||||
var props = line.split(",");
|
||||
bb.x = props[0];
|
||||
bb.y = props[1];
|
||||
if (props[2] == "" || props[2] === undefined) props[2] = "transparent";
|
||||
bb.color = props[2].replace(/\*\*/g, ",");
|
||||
BBs[offset] = bb;
|
||||
}
|
||||
}
|
||||
});
|
||||
return BBs;
|
||||
} else {
|
||||
return r2ui.basic_blocks;
|
||||
}
|
||||
};
|
||||
r2ui.update_fcn_BB = function(fcn_offset, bb_offset, bbinfo) {
|
||||
if (r2ui.use_sdb) {
|
||||
var path = "webui/graph/" + fcn_offset + "/" + bb_offset;
|
||||
if (bbinfo.color === undefined) bbinfo.color = "transparent";
|
||||
var value = bbinfo.x + "," + bbinfo.y + "," + bbinfo.color.replace(/,/g, "**");
|
||||
r2.cmd("k " + path + "=" + encodeURIComponent(value), function(x) { });
|
||||
} else {
|
||||
r2ui.basic_blocks[bb_offset] = bbinfo;
|
||||
}
|
||||
};
|
||||
|
||||
r2ui.current_fcn_offset = null;
|
||||
r2ui.graph = null;
|
||||
r2ui.console_lang = "r2";
|
||||
r2ui.toggle_console_lang = function() {
|
||||
if (r2ui.console_lang == "r2") r2ui.console_lang = "js";
|
||||
else if (r2ui.console_lang == "js") r2ui.console_lang = "r2";
|
||||
$("#cmd_input > label").html(r2ui.console_lang);
|
||||
};
|
||||
|
||||
r2ui.history_push = function (x) {
|
||||
if (x != r2ui.history_last()) {
|
||||
if (r2ui.history_idx != r2ui.history.length)
|
||||
r2ui.history = r2ui.history.splice (0,r2ui.history_idx);
|
||||
r2ui.history_idx++;
|
||||
r2ui.history.push (x);
|
||||
}
|
||||
}
|
||||
|
||||
r2ui.history_pop = function () {
|
||||
// console.log("history pop");
|
||||
if (r2ui.history_idx == r2ui.history.length) r2ui.history_idx--;
|
||||
// console.log(r2ui.history_idx + "/" + r2ui.history.length);
|
||||
return r2ui.history.pop();
|
||||
}
|
||||
|
||||
r2ui.history_last = function () {
|
||||
if (r2ui.history.length > 0) {
|
||||
return r2ui.history[r2ui.history_idx - 1];
|
||||
}
|
||||
}
|
||||
|
||||
r2ui.history_prev = function () {
|
||||
// console.log("history prev");
|
||||
if (r2ui.history_idx > 1) r2ui.history_idx--;
|
||||
// console.log(r2ui.history_idx + "/" + r2ui.history.length);
|
||||
return r2ui.history[r2ui.history_idx - 1];
|
||||
}
|
||||
|
||||
r2ui.history_next = function () {
|
||||
// console.log("history next");
|
||||
var ret = r2ui.history[r2ui.history_idx];
|
||||
if (r2ui.history_idx < r2ui.history.length) r2ui.history_idx++;
|
||||
// console.log(r2ui.history_idx + "/" + r2ui.history.length);
|
||||
return ret;
|
||||
}
|
||||
|
||||
r2ui.next_instruction = function() {
|
||||
var offset = parseInt(r2ui.history_last(), 16);
|
||||
r2.cmd ("pdl 1", function (x) {
|
||||
offset += parseInt(x.trim());
|
||||
});
|
||||
return "0x" + offset.toString(16);
|
||||
}
|
||||
|
||||
r2ui.prev_instruction = function() {
|
||||
var offset = parseInt(r2ui.history_last(), 16);
|
||||
r2.cmdj("pdfj", function (x) {
|
||||
if (x !== undefined && x !== null) {
|
||||
for (var i in x.ops) {
|
||||
if (i === 0) continue;
|
||||
var opcode = x.ops[i];
|
||||
if (opcode.offset == offset) {
|
||||
offset = x.ops[i-1].offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return "0x" + offset.toString(16);;
|
||||
}
|
||||
|
||||
r2ui.seek = function (addr, push, scroll) {
|
||||
if (addr === undefined) return;
|
||||
// Resolve flag in case we dont have an address
|
||||
if (addr.indexOf("0x") === 0) {
|
||||
addr = address_canonicalize(addr);
|
||||
} else {
|
||||
var a = r2.get_flag_address(addr);
|
||||
if (a !== null) {
|
||||
addr = address_canonicalize(a);
|
||||
} else {
|
||||
r2.cmd("s " + addr + ";s", function(x) {
|
||||
addr = address_canonicalize(x.replace('\n',''));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (push) r2ui.history_push(addr);
|
||||
|
||||
// if (r2ui.ra.getIndex ()==2) r2ui.ra.setIndex (1);
|
||||
|
||||
r2.cmd ("s " + addr, function () {
|
||||
r2ui._dis.seek(addr, scroll);
|
||||
r2ui._hex.seek(addr, scroll);
|
||||
});
|
||||
// if (r2ui._dis.tmp_address !== undefined) r2ui._dis.tmp_address = addr;
|
||||
}
|
||||
|
||||
r2ui.seek_in_graph = function (addr, push) {
|
||||
if (push) r2ui.history_push (addr);
|
||||
|
||||
// if (r2ui.ra.getIndex ()==2) r2ui.ra.setIndex (1);
|
||||
|
||||
r2.cmd ("s "+addr, function () {
|
||||
rehighlight_iaddress(addr);
|
||||
r2ui._hex.seek(addr);
|
||||
r2ui._hex.scrollTo(0, 0);
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.seek_prev = function () {
|
||||
// XXX. this is only for disasm
|
||||
var addr = r2ui.history.pop ();
|
||||
r2.cmd("s "+addr, function () {
|
||||
r2ui._dis.seek(addr);
|
||||
r2ui._dis.scrollTo(0, 0);
|
||||
r2ui._hex.seek(addr);
|
||||
r2ui._hex.scrollTo(0, 0);
|
||||
});
|
||||
}
|
||||
|
||||
/* used from mainpanel */
|
||||
r2ui.openpage = function(addr, idx) {
|
||||
if (idx === undefined) {
|
||||
idx = addr;
|
||||
addr = undefined;
|
||||
}
|
||||
if (addr !== undefined) {
|
||||
r2ui.seek(addr, true);
|
||||
}
|
||||
|
||||
// What is this for?
|
||||
if (r2ui.ra.getIndex()==2) r2ui.ra.setIndex(1);
|
||||
|
||||
r2ui.mp.openPage(idx);
|
||||
|
||||
}
|
||||
|
||||
r2ui.opendis = function (addr) {
|
||||
r2ui.openpage(addr, 0);
|
||||
}
|
||||
|
||||
r2ui.openhex = function (addr) {
|
||||
r2ui.openpage(addr, 2);
|
||||
}
|
||||
|
||||
|
@ -1,167 +0,0 @@
|
||||
function makelist(x) {
|
||||
var z = "List of "+x.length+"\n\n";
|
||||
for (var i = 0; i<x.length; i++)
|
||||
z += "<a style='color:yellow' href='javascript:r2ui.opendis("+
|
||||
x[i].offset+")'>0x"+x[i].offset.toString (16) + "</a> "+ enyo.dom.escape(x[i].name)+"\n";
|
||||
return z;
|
||||
}
|
||||
|
||||
enyo.kind ({
|
||||
name: "RightPanel",
|
||||
style:"background-color:#404040;",
|
||||
classes: "onyx-toolbar",
|
||||
kind: "FittableRows",
|
||||
ra: null,
|
||||
components: [
|
||||
{kind:"FittableColumns", style:"margin-bottom:5px", components:[
|
||||
{kind: "onyx.Button", content: "[", ontap: "closeSidebar", style: "padding:8px;margin-right:8px"},
|
||||
{onup:"toggleScroll", style:"position:absolute;left:40px;top:0px;", kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [
|
||||
{content: "List elements" },
|
||||
{kind: "onyx.Menu", showOnTop: true, maxHeight:290, name: "menu", style:"height:300px", components: [
|
||||
{content: "flags", value: "2"},
|
||||
{content: "flagspaces", value: "2"},
|
||||
{classes: "onyx-menu-divider"},
|
||||
{content: "strings", value: "1"},
|
||||
{content: "symbols", value: "1"},
|
||||
{content: "imports", value: "1"},
|
||||
{content: "relocs", value: "1"},
|
||||
{content: "functions", value: "1"},
|
||||
{content: "comments", value: "1"},
|
||||
{classes: "onyx-menu-divider"},
|
||||
{content: "registers", value: "1"},
|
||||
{content: "stack", value: "2"},
|
||||
{content: "backtrace", value: "3"},
|
||||
]},
|
||||
]},
|
||||
]},
|
||||
{kind: "Scroller", animated: false, fit: true, horizontal: false, name: "scroll", components: [
|
||||
/*
|
||||
{kind: "FittableColumns",components:[
|
||||
{kind: "List", name: "list", style:"height:400px", realtimeFit:true, onSetupItem: "setupItem", components: [
|
||||
{kind: "onyx.Item", layoutKind: "HFlexLayout", style:"padding:0px", components: [
|
||||
{name:"separator", tag: "hr", style:"height:1px;visibility:hidden"},
|
||||
{kind: "onyx.Button", name: "msg", style: "width:100%", fit:true, active: true, ontap: "rowTap"}
|
||||
]}
|
||||
]},
|
||||
]},
|
||||
*/
|
||||
{tag: "pre", style:"font-size:14px", allowHtml:true, name: "output", content:".." }
|
||||
]}
|
||||
],
|
||||
toggleScroll: function() {
|
||||
var is_visible = this.$.menu.getShowing ();
|
||||
this.$.scroll.setShowing (is_visible);
|
||||
},
|
||||
rowTap: function () {
|
||||
/* do something here */
|
||||
},
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
/*
|
||||
this.$.list.setCount (3);
|
||||
this.$.list.refresh();
|
||||
*/
|
||||
},
|
||||
data: [],
|
||||
setupItem: function (inSender, inIndex) {
|
||||
var item = this.data[inIndex.index];
|
||||
if (!item)
|
||||
return false;
|
||||
var msg = item.name + " "+item.offset;
|
||||
console.log (msg);
|
||||
this.$.msg.setContent (msg);
|
||||
return true;
|
||||
},
|
||||
refresh: function () {
|
||||
//this.$.list.setCount (this.data.length);
|
||||
//this.$.list.refresh ();
|
||||
},
|
||||
itemSelected: function (inSender, inEvent) {
|
||||
var self = this;
|
||||
var selected = inEvent.originator.content;
|
||||
var is_visible = this.$.menu.getShowing ();
|
||||
r2ui.rp = self;
|
||||
this.$.scroll.setShowing (!!! is_visible);
|
||||
this.$.menu.setShowing (false);
|
||||
this.$.scroll.scrollToTop();
|
||||
//this.$.output.scrollToTop();
|
||||
switch (selected) {
|
||||
case "comments":
|
||||
r2.cmd ("CC*", function(x) {
|
||||
x = x.replace (/0x([a-zA-Z0-9]*)/g, "<a style='color:yellow' href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
|
||||
self.$.output.setContent (x);
|
||||
});
|
||||
break;
|
||||
case "functions":
|
||||
r2.cmd ("afl", function(x) {
|
||||
x = x.replace (/0x([a-zA-Z0-9]*)/g, "<a style='color:yellow' href='javascript:r2ui.seek(\"0x$1\")'>0x$1</a>");
|
||||
self.$.output.setContent (x);
|
||||
});
|
||||
break;
|
||||
case "flagspaces":
|
||||
this.updateFlagspace ();
|
||||
break;
|
||||
case "strings":
|
||||
r2.cmd ("izj", function(x) {
|
||||
var s = JSON.parse (x);
|
||||
var h = '';
|
||||
for (var i in s) {
|
||||
var off = (+s[i]['offset']).toString(16);
|
||||
h += '<a style="color:yellow" href="javascript:r2ui.opendis(0x'+
|
||||
off+')">0x'+off+'</a> '+enyo.dom.escape(s[i]['string'])+'<br />';
|
||||
}
|
||||
self.$.output.setContent (h);
|
||||
});
|
||||
break;
|
||||
case "sections":
|
||||
r2.bin_sections(function (x) {
|
||||
self.$.output.setContent (makelist (x));
|
||||
});
|
||||
break;
|
||||
case "symbols":
|
||||
r2.bin_symbols(function (x) {
|
||||
self.$.output.setContent (makelist (x));
|
||||
});
|
||||
break;
|
||||
case "relocs":
|
||||
r2.bin_relocs (function (x) {
|
||||
self.$.output.setContent (makelist (x));
|
||||
});
|
||||
break;
|
||||
case "imports":
|
||||
r2.bin_imports (function (x) {
|
||||
self.$.output.setContent (makelist (x));
|
||||
});
|
||||
break;
|
||||
case "flags":
|
||||
r2.get_flags (function (flags) {
|
||||
self.data = flags;
|
||||
self.$.output.setContent (makelist (flags));
|
||||
self.refresh();
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
closeSidebar: function() {
|
||||
this.ra.setIndex (1);
|
||||
},
|
||||
selectFlagspace: function (x) {
|
||||
r2.cmd ('fs '+x, function(x) {
|
||||
r2ui.rp.updateFlagspace();
|
||||
});
|
||||
},
|
||||
updateFlagspace: function() {
|
||||
var self = r2ui.rp;
|
||||
r2.cmd ("fsj", function (x) {
|
||||
var s = JSON.parse (x);
|
||||
var h = '';
|
||||
for (var i in s) {
|
||||
var nam = s[i].name;
|
||||
var sel = s[i].selected;
|
||||
h += '<a style="color:yellow" href="javascript:r2ui.rp.selectFlagspace(\''+
|
||||
nam+'\')">'+nam+'</a> '+(sel?" (selected)":"")+'<br />';
|
||||
}
|
||||
self.$.output.setContent (h);
|
||||
});
|
||||
}
|
||||
});
|
@ -1,55 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Script",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#c0c0c0",
|
||||
clear: function () {
|
||||
with (this.$.input) { setContent (value = ''); render() };
|
||||
},
|
||||
demo: function () {
|
||||
with (this.$.input) {
|
||||
setContent (value = [
|
||||
'r2.disassemble (0, "9090", function(text) {',
|
||||
' show (text)',
|
||||
' show ()',
|
||||
' r2.assemble (0, "mov eax, 33", function (text) {',
|
||||
' show (text);',
|
||||
' });',
|
||||
' show (r2)',
|
||||
'});'].join ('\n'));
|
||||
render();
|
||||
}
|
||||
},
|
||||
run: function () {
|
||||
var code = this.$.input.value;
|
||||
var out = "";
|
||||
/* helper functions */
|
||||
function show(x) {
|
||||
if (!x) out += "\n"; else
|
||||
if (typeof x == 'object') {
|
||||
out += "{";
|
||||
for (var y in x) {
|
||||
var v = x[y]; //(typeof x[y] == 'function')? 'function': x[y];
|
||||
out += y+": "+v+"\n , ";
|
||||
}
|
||||
out += "}";
|
||||
} else {
|
||||
out += x+"\n";
|
||||
}
|
||||
}
|
||||
try {
|
||||
eval (code);
|
||||
this.$.output.setContent (out);
|
||||
} catch (e) {
|
||||
alert (e);
|
||||
}
|
||||
},
|
||||
components: [
|
||||
{tag: "p", style:"margin-left:10px", components: [
|
||||
{kind: "onyx.Button", content: "Run", classes: "sourcebutton", ontap: "run" },
|
||||
{kind: "onyx.Button", content: "Clear", classes: "sourcebutton", ontap: "clear" },
|
||||
{kind: "onyx.Button", content: "Demo", classes: "sourcebutton", ontap: "demo" },
|
||||
]},
|
||||
{kind: "onyx.TextArea", name: "input", classes: "sourcecode" },
|
||||
{tag: "pre", name: "output", style:"margin-left:12px" }
|
||||
]
|
||||
});
|
@ -1,10 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Search",
|
||||
kind: "Scroller",
|
||||
style: "background-color:#303030",
|
||||
components: [
|
||||
{tag: "center", components: [
|
||||
{tag: "h1", style: "color:#f0f0f0", content: "TODO: Search"}
|
||||
]}
|
||||
]
|
||||
});
|
@ -1,190 +0,0 @@
|
||||
enyo.kind ({
|
||||
name: "Settings",
|
||||
classes: "panels-sample-sliding-content r2panel",
|
||||
kind: "Scroller",
|
||||
tag: "div",
|
||||
data: null,
|
||||
style:"background-color:#c0c0c0; color:black !important;padding:0px;margin:0px;border:0px;overflow:hidden",
|
||||
components: [
|
||||
{kind: "FittableRows", fit: false, components: [
|
||||
{tag: "h2", content: "General" },
|
||||
{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Two panels", classes:"rowline" },
|
||||
{kind: "onyx.ToggleButton", name: "twopanels"},
|
||||
]},
|
||||
{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Edit keybindings", classes:"rowline" },
|
||||
{kind: "onyx.Button", content: '+'},
|
||||
]}
|
||||
]},
|
||||
{kind: "FittableRows", fit: false, components: [
|
||||
{tag: "h2", content: "Target" }
|
||||
,{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Arch", classes:"rowline"},
|
||||
{kind: "onyx.PickerDecorator", components: [
|
||||
{},
|
||||
{kind: "onyx.Picker", name: "arch", components: [
|
||||
/* TODO: construct from code */
|
||||
{content: "arc"},
|
||||
{content: "arm"},
|
||||
{content: "avr"},
|
||||
{content: "ppc"},
|
||||
{content: "bf"},
|
||||
{content: "dalvik"},
|
||||
{content: "dcpu16"},
|
||||
{content: "i8080"},
|
||||
{content: "java"},
|
||||
{content: "m68k"},
|
||||
{content: "mips"},
|
||||
{content: "msil"},
|
||||
{content: "rar"},
|
||||
{content: "sh"},
|
||||
{content: "sparc"},
|
||||
{content: "x86", active: true},
|
||||
{content: "z80"},
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Bits", classes:"rowline"},
|
||||
{kind: "onyx.PickerDecorator", components: [
|
||||
{},
|
||||
{kind: "onyx.Picker", name: "bits", components: [
|
||||
{content: "8"},
|
||||
{content: "16"},
|
||||
{content: "32", active: true},
|
||||
{content: "64"}
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Endian", classes:"rowline"},
|
||||
{kind: "onyx.PickerDecorator", components: [
|
||||
{},
|
||||
{kind: "onyx.Picker", components: [
|
||||
{content: "little", active: true},
|
||||
{content: "big"},
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "OS", classes:"rowline"},
|
||||
{kind: "onyx.PickerDecorator", components: [
|
||||
{},
|
||||
{kind: "onyx.Picker", components: [
|
||||
{content: "linux", active: true},
|
||||
{content: "darwin"},
|
||||
{content: "w32"},
|
||||
{content: "dos"},
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
,{tag: "h2", content: "Disassembly" },
|
||||
{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Show new view", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "use_new_view"},
|
||||
]},
|
||||
{kind: "onyx.InputDecorator", components: [
|
||||
{tag: "p", content: "Show bytes", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_bytes"},
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Show offsets", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_offset" },
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Show flags", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_flags" },
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Show xrefs", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_xrefs" },
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Show comments on right", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_cmtright" },
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Show lines", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_lines" },
|
||||
]}
|
||||
,{kind: "onyx.InputDecorator",components: [
|
||||
{tag: "p", content: "Pseudo", classes:"rowline", ontap: "nextPanel"},
|
||||
{kind: "onyx.ToggleButton", name: "toggle_pseudo" },
|
||||
]}
|
||||
]}
|
||||
,{tag: "h2", content: "Save changes?" }
|
||||
,{tag: "div",style:"margin-left:50px", components: [
|
||||
{ontap:"reset", kind: "onyx.Button", style: "position:relative;left:0px", content: "Reset"},
|
||||
{ontap:"save", kind: "onyx.Button", style: "position:relative;left:50px", content: "Save", classes: "onyx-affirmative"}
|
||||
]}
|
||||
,{tag: "div", style: "height:64px"}
|
||||
],
|
||||
load: function() {
|
||||
var self = this;
|
||||
self.$.twopanels.setActive (document.referrer.indexOf ("/two") != -1);
|
||||
self.$.toggle_bytes.setActive(r2.settings['asm.bytes']);
|
||||
self.$.toggle_pseudo.setActive(r2.settings['asm.pseudo']);
|
||||
self.$.toggle_flags.setActive(r2.settings['asm.flags']);
|
||||
self.$.toggle_xrefs.setActive(r2.settings['asm.xrefs']);
|
||||
self.$.toggle_cmtright.setActive(r2.settings['asm.cmtright']);
|
||||
self.$.toggle_offset.setActive(r2.settings['asm.offset']);
|
||||
self.$.toggle_lines.setActive(r2.settings['asm.lines']);
|
||||
var mode = readCookie('r2_view_mode');
|
||||
if (!mode) mode = "old";
|
||||
self.$.use_new_view.setActive(mode == "new");
|
||||
},
|
||||
|
||||
create: function () {
|
||||
this.inherited (arguments);
|
||||
this.load();
|
||||
},
|
||||
save: function() {
|
||||
var use_new_view = this.$.use_new_view.active;
|
||||
var show_offset = this.$.toggle_offset.active;
|
||||
var arch = this.$.arch.selected.content;
|
||||
var bits = this.$.bits.selected.content;
|
||||
var show_bytes = this.$.toggle_bytes.active;
|
||||
var show_pseudo = this.$.toggle_pseudo.active;
|
||||
var show_flags = this.$.toggle_flags.active;
|
||||
var show_lines = this.$.toggle_lines.active;
|
||||
var show_xrefs = this.$.toggle_xrefs.active;
|
||||
var comments_on_right = this.$.toggle_cmtright.active;
|
||||
var twopanels = this.$.twopanels.active;
|
||||
r2.cmds ([
|
||||
"e asm.offset="+show_offset,
|
||||
"e asm.arch="+arch,
|
||||
"e asm.bits="+bits,
|
||||
"e asm.lines="+show_lines,
|
||||
"e asm.bytes="+show_bytes,
|
||||
"e asm.flags="+show_flags,
|
||||
"e asm.xrefs="+show_xrefs,
|
||||
"e asm.cmtright="+comments_on_right,
|
||||
"e asm.pseudo="+show_pseudo
|
||||
]);
|
||||
r2.settings = {
|
||||
"use_new_view": use_new_view,
|
||||
"asm.arch":arch,
|
||||
"asm.bits":bits,
|
||||
"asm.bytes":show_bytes,
|
||||
"asm.flags":show_flags,
|
||||
"asm.xrefs":show_xrefs,
|
||||
"asm.cmtright":comments_on_right,
|
||||
"asm.lines":show_lines,
|
||||
"asm.pseudo":show_pseudo
|
||||
}
|
||||
|
||||
if (use_new_view) createCookie('r2_view_mode', "new", 7);
|
||||
else createCookie('r2_view_mode', "old", 7);
|
||||
|
||||
if (twopanels) {
|
||||
window.parent.location ="/enyo/two";
|
||||
} else {
|
||||
window.parent.location ="/enyo/";
|
||||
}
|
||||
r2ui.seek("$$", false);
|
||||
},
|
||||
reset: function() {
|
||||
this.load ();
|
||||
}
|
||||
});
|
6
shlr/www/enyo/js/underscore-min.js
vendored
16
shlr/www/enyo/r2app.js
Normal file
2
shlr/www/enyo/r2core.css
Normal file
@ -0,0 +1,2 @@
|
||||
.bytes,.insaddr,.instructiondesc{display:inline-block}#minimap,#minimap_area,#outergbox,.basicblock,.instructionbox{position:absolute}.bbcanvas,.flatcanvas{float:left}.insaddr{min-width:7em}#outergbox{height:100%;width:100%}.instruction{font-family:monospace;white-space:nowrap}.data{text-align:right;min-width:18px;padding-top:0;padding-bottom:0}#gbox{position:relative}.bytes{width:170px}#minimap .basicblock,.hidden{display:none}input:focus{outline:0}.ec_args,.ec_btext,.ec_comment,.ec_fline,.ec_flow,.ec_help,.ec_input,.ec_label,.ec_prompt,.ec_swi{color:#007f7f}.ec_fname{color:#7f0000}.ec_flag{color:#007f7f}.ec_offset{color:#007f00}.ec_other{color:#7f7f7f}.ec_b0x00{color:#007f00}.ec_b0x7f{color:#007f7f}.ec_b0xff{color:#7f0000}.ec_bin,.ec_math{color:#7f7f00}.ec_push{color:#7f007f}.ec_pop{color:#f0f}.ec_cjmp,.ec_jmp{color:#007f00}.ec_call{color:#0f0}.ec_nop{color:#00007f}.ec_ret{color:#7f0000}.ec_invalid,.ec_trap{color:red}.ec_cmp,.ec_creg,.ec_reg{color:#007f7f}.ec_mov{color:#7f7f7f}.ec_num{color:#7f7f00}.ec_gui_cflow{color:#ff0}.ec_gui_dataoffset{color:#7f7f00}.ec_gui_background{background-color:#141414}.ec_gui_alt_background{background-color:#323232}.ec_gui_border{border-color:#323232}.autohighlight{background-color:#8AFF77!important}.autohighlighti{background-color:#8AFF77}#canvas,#canvas svg,#minimap svg{background:0 0}.lines{margin-left:100px}.basicblock{border:1px solid;padding:5px;pointer-events:none;-webkit-user-select:none;box-sizing:border-box;z-index:2}.basicblock .instruction,.basicblock input{pointer-events:auto}#canvas{position:relative;display:inline-block;width:100%;height:100%;margin:10px}#canvas svg .link,#minimap svg .link{pointer-events:none}#minimap svg .connection{stroke-width:5}#minimap{width:200px;height:200px;z-index:1000;background:#999;filter:alpha(opacity=80)}#canvas #minimap_area{display:none;z-index:0}#canvas #minimap_area svg{stroke:transparent}#minimap_area{border:1px solid #000;background:#000;opacity:.2;filter:alpha(opacity=20)}#radareApp_mp_panels_pageDisassembler{padding:0}#main_panel{overflow:auto}.right_label{float:right}
|
||||
.ui-layout-pane,.ui-layout-toggler{border:none!important}.ui-layout-center,.ui-layout-east,.ui-layout-east .ui-layout-content,.ui-layout-west{padding:0;overflow:hidden}.ui-layout-center P.ui-layout-content{line-height:1.4em;margin:0}.ui-layout-resizer{background-color:#373737!important}.ui-layout-east h4{font-size:.9em;font-weight:400}.ui-layout-toggler{background-color:#797979!important}.ui-layout-center{padding:0}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0;support:IE7}.ui-tabs .ui-tabs-nav{font-size:.8em;background:silver;border:1px solid #797979;color:#595959;border-width:0 0 1px;padding:7px 10px;height:17px;margin:0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0 25px;white-space:nowrap;text-decoration:none;background-color:silver;height:20px}.ui-tabs .ui-tabs-nav li a{float:left;padding:0;text-decoration:none;outline:0;font-weight:400}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none;outline:0}.ui-widget-header{border:1px solid #aaa;background:#ccc;font-weight:700}.ui-tabs-nav li.ui-tabs-active a{color:#fff;font-weight:400}.ui-tabs-nav li.ui-tabs-active{background-color:#7f7f7f;border-bottom:10px solid #7f7f7f;border-top:10px solid #7f7f7f;height:14px;margin-top:-10px}.ui-tabs .ui-tabs-panel{padding:1em 0}.entry{font-size:.8em;padding:0 0 0 10px}.jqtree-tree{margin-top:5px}.jqtree-tree .jqtree-element{margin:-.2em 0;font-family:monospace;cursor:auto;padding:0 5px}.jqtree-tree .jqtree-folder{margin-left:5px}.jqtree-tree .jqtree-title{color:#7f7f7f;margin-left:1em}.jqtree-tree .jqtree-toggler{color:#7f7f7f;font-size:.8em;cursor:pointer}.jqtree-tree .autohighlighti{background-color:#7f7f7f;color:#141414}.history.autohighlighti{background-color:transparent}.hex .autohighlighti{background-color:#ff0;color:#141414}.history_idx{background-color:#7f7f7f!important;border-bottom:6px solid #7f7f7f;border-top:4px solid #7f7f7f;border-right:3px solid #7f7f7f;border-left:3px solid #7f7f7f;height:14px;margin-top:-10px;color:#fff}#command,h3,h4{border:1px solid #797979;background:silver}h3,h4{font-size:.8em;color:#595959;border-width:0 0 1px;padding:7px 10px;margin:0;cursor:pointer;font-weight:400}p{margin:0!important}#center_panel,#cmd_output>p{padding:0;margin:0}#command{font-family:Geneva,Arial,Helvetica,sans-serif;padding:5px;width:99%;margin:2px}#history_bar>h3,#history_bar>span,.hex{font-family:monospace;font-size:10pt}#cmd_output{color:#7f7f7f;margin-top:0}#history{background:silver;padding:3px 5px}#information{margin-left:10px}#cmd_input{position:relative}#cmd_input>label{position:absolute;top:5px;bottom:0;right:30px;width:0}#history_bar>span{position:absolute;vertical-align:middle;background-color:silver;bottom:1px;right:0;width:12%;height:22px;text-align:right;padding-right:5px;cursor:pointer;line-height:normal}.hexdump,.hexoffset,.hextext{float:left;line-height:20px}.hex{width:650px;height:100%}.hexdump{width:340px}.hextext{width:140px;color:#fff}.hexoffset{padding-right:30px;text-align:right;width:100px}
|
3
shlr/www/enyo/r2core.js
Normal file
@ -1,261 +0,0 @@
|
||||
/* not used. must be deprecated or merged */
|
||||
|
||||
var r2ui = {}
|
||||
r2ui.consoleExec = function () {
|
||||
var xx = document.getElementById ('consoleBody');
|
||||
if (!xx) alert ("NO CONDSOEL DBODY");
|
||||
var str = document.getElementById ('consoleEntry');
|
||||
if (str) str = str.value;
|
||||
r2.cmd (str, function (res) {
|
||||
document.getElementById ('consoleBody').innerHTML = res;
|
||||
var entry = document.getElementById ('consoleEntry');
|
||||
entry.value = "";
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.logger = null;
|
||||
function init () {
|
||||
logger = r2.getTextLogger ().on ("message", function (msg) {
|
||||
var out = document.getElementById ('logsBody');
|
||||
out.innerHTML += "<br />"+msg.text; // XXX XSS
|
||||
});
|
||||
// logger.send ("hello world");
|
||||
logger.autorefresh (3);
|
||||
|
||||
}
|
||||
r2ui.sendMessage = function () {
|
||||
var msg = document.getElementById ("logsEntry").value;
|
||||
if (!logger) init();
|
||||
if (logger) logger.send (msg);
|
||||
document.getElementById ("logsEntry").value = "";
|
||||
}
|
||||
|
||||
function li (off, name) {
|
||||
return "<li><pre><b>0x"+off.toString (16)+"</b> "+name+"</pre></li>";
|
||||
}
|
||||
r2ui.initSections = function () {
|
||||
r2.bin_sections (function (sections) {
|
||||
var str = "";
|
||||
for (var i=0; i<sections.length; i++) {
|
||||
var s = sections[i];
|
||||
str += li (s.offset, s.name);
|
||||
}
|
||||
document.getElementById ("sectionsBody").innerHTML = str;
|
||||
});
|
||||
}
|
||||
r2ui.initSymbols = function () {
|
||||
r2.bin_symbols (function (symbols) {
|
||||
var str = "";
|
||||
for (var i=0; i<symbols.length; i++) {
|
||||
var s = symbols[i];
|
||||
str += li (s.offset, s.name);
|
||||
}
|
||||
document.getElementById ("symbolsBody").innerHTML = str;
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.initHexdump = function () {
|
||||
r2.cmd ("x 1024", function (x) {
|
||||
document.getElementById ("hexdumpBody").innerHTML = x;
|
||||
});
|
||||
}
|
||||
|
||||
/* block dis */
|
||||
var prev_curoff = 0;
|
||||
var prev_lastoff = 0;
|
||||
var next_curoff = 0;
|
||||
var next_lastoff = 0;
|
||||
var backward = false;
|
||||
var display = "pd";
|
||||
|
||||
function less () {
|
||||
var oldoff = document.body.scrollHeight;
|
||||
backward = true;
|
||||
r2.cmd ("b", function (block) {
|
||||
r2.cmd ("s "+prev_curoff+"-"+block+";"+display, function (x) {
|
||||
x = filter_asm (x);
|
||||
var body = document.getElementById ('disasmBody').innerHTML;
|
||||
document.getElementById ('disasmBody').innerHTML = x + body;
|
||||
var newoff = document.body.scrollHeight;
|
||||
var d= newoff-oldoff;
|
||||
document.body.scrollTop = d;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function hasmore(x) {
|
||||
var a = document.getElementById ("more");
|
||||
var b = document.getElementById ("less");
|
||||
if (!a || !b) return;
|
||||
if (x) {
|
||||
a.style.visibility=b.style.visibility="visible";
|
||||
} else {
|
||||
a.style.visibility=b.style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
|
||||
function more () {
|
||||
backward = false;
|
||||
r2.cmd ("?v $l @ "+next_lastoff, function (oplen) {
|
||||
display = "pd";
|
||||
if (display == "px") oplen = 16;
|
||||
r2.cmd (display+" @ "+next_lastoff+"+"+oplen, function (x) {
|
||||
x = filter_asm (x);
|
||||
document.getElementById('disasmBody').innerHTML += x;
|
||||
});
|
||||
});
|
||||
}
|
||||
function filter_asm(x) {
|
||||
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:grey'>$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:grey'>$1</b>");
|
||||
x = x.replace (/(push|pop)/g, "<b style='color:black'>$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;
|
||||
}
|
||||
|
||||
var seekindex = 0;
|
||||
var seekhistory = [];
|
||||
|
||||
function seek_undo() {
|
||||
seekindex--;
|
||||
seekhistory[seekhistory.length-1] = x;
|
||||
}
|
||||
|
||||
function seek_redo() {
|
||||
seekindex++;
|
||||
if (seekindex>=seekhistory.length) {
|
||||
seekindex--;
|
||||
return;
|
||||
}
|
||||
seek (seekhistory[seekindex]);
|
||||
}
|
||||
|
||||
function seek_do(x) {
|
||||
seekindex++;
|
||||
seekhistory[seekhistory.length] = x;
|
||||
}
|
||||
|
||||
function seek(x,back) {
|
||||
seek_do (x)
|
||||
next_curoff = prev_curoff = x;
|
||||
//if (display[0] != 'p') setmode ('pd');
|
||||
r2.cmd ("s "+x, function (x) {
|
||||
// if (display[0]=='f') display="pd";
|
||||
document.body.scrollTop = 0;
|
||||
r2ui.initDisasm ();
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.seek = seek;
|
||||
|
||||
r2ui.initDisasm = function () {
|
||||
r2.cmd ("pd 128", function (x) {
|
||||
x = filter_asm (x);
|
||||
document.getElementById ("disasmBody").innerHTML = x;
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.assembleOpcode = function () {
|
||||
var str = document.getElementById ("assembleOpcode").value;
|
||||
r2.cmd ("\"pa "+str+"\"", function (x) {
|
||||
document.getElementById ("assembleBytes").value = x;
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.assembleBytes = function () {
|
||||
var hex = document.getElementById ("assembleBytes").value;
|
||||
r2.cmd ("pi 1@b:"+hex, function (x) {
|
||||
document.getElementById ("assembleOpcode").value = x;
|
||||
});
|
||||
}
|
||||
|
||||
r2ui.assembleWrite = function () {
|
||||
var hex = document.getElementById ("assembleBytes").value;
|
||||
var off = document.getElementById ("assembleOffset").value;
|
||||
r2.cmd ("s "+off+";wx "+hex, function (x) {
|
||||
Lungo.Notification.error('Oops', 'Cannot write bytes', 'file is read-only', 2);
|
||||
//document.getElementById ("assembleOpcode").value = x;
|
||||
});
|
||||
}
|
1
shlr/www/enyo/stylesheet.css
Normal file
@ -0,0 +1 @@
|
||||
.colorbar,.colorbar_item{max-width:100%;border:0;spacing:0}.sourcebutton,.top{vertical-align:top}a{color:#3030a0}.r2ui-input,.r2ui-label,.rowline{color:#000}.sourcecode{width:280px;height:200px;margin-left:10px;font-size:12px;background-color:#e0e0e0;font-family:Consolas,monospace}.sourcebutton{margin:4px}h2{padding-left:14px}.app-panels>*{width:320px;background-color:#eaeaea;box-shadow:-4px -4px 4px rgba(0,0,0,.3)}.menu-button{clear:none;float:left;margin:10px!important;width:150px}.rowline{width:200px}@media all and (max-width:600px){.app-panels>*{min-width:100%;max-width:100%}}.onyx-sample-tools{padding-bottom:10px}.onyx-sample-tools>*{margin:3px}.r2ui-terminal{color:#000;editable:false}.r2ui-input{margin-top:8px;background-color:#909090;width:90%;display:inline-block}.colorbar,.topbox{margin:0;padding:0}.moreless:hover{background-color:#d0d0d0;cursor:pointer}.moreless{background-color:#a0a0a0;width:90%;height:24px;padding-left:10px;border:0}.r2panel{color:#000!important}.colorbar{border-spacing:0;height:16px;background-color:#000;width:380px}.colorbar_item{width:100%;padding:0}.topbox{position:absolute;left:70px;top:0;display:inline}.top{display:inline-block;position:relative;padding:10px;margin:0 1px 1px}pre{font-size:13px}.addr{-moz-user-select:text}
|
@ -1,13 +0,0 @@
|
||||
<html>
|
||||
<body style="border:0px;margin:0px;background-color:#303030">
|
||||
<table style="spacing:0px;border:0px;padding:0px;width:100%;height:100%">
|
||||
<tr height="100%">
|
||||
<td>
|
||||
<iframe style="border:0px;width:100%;height:100%;scroll:overflow" src="/enyo/"></iframe>
|
||||
</td><td style="margin:0px;border:0">
|
||||
<iframe style="border:0px;width:100%;height:100%;scroll:overflow" src="/enyo/#hex"></iframe>
|
||||
<td>
|
||||
<tr>
|
||||
<table>
|
||||
</body>
|
||||
</html>
|
2
shlr/www/enyo/vendors/backbone-min.js
vendored
Normal file
171
shlr/www/enyo/vendors/joint.layout.DirectedGraph.js
vendored
Normal file
@ -0,0 +1,171 @@
|
||||
if (typeof exports === 'object') {
|
||||
|
||||
var graphlib = require('graphlib');
|
||||
var dagre = require('dagre');
|
||||
}
|
||||
|
||||
// In the browser, these variables are set to undefined because of JavaScript hoisting.
|
||||
// In that case, should grab them from the window object.
|
||||
graphlib = graphlib || (typeof window !== 'undefined' && window.graphlib);
|
||||
dagre = dagre || (typeof window !== 'undefined' && window.dagre);
|
||||
|
||||
// create graphlib.Graph from existing joint.dia.Graph
|
||||
joint.dia.Graph.prototype.toGraphLib = function(opt) {
|
||||
|
||||
opt = opt || {};
|
||||
|
||||
var glGraphType = _.pick(opt, 'directed', 'compound', 'multigraph');
|
||||
var glGraph = new graphlib.Graph(glGraphType);
|
||||
|
||||
var setNodeLabel = opt.setNodeLabel || _.noop;
|
||||
var setEdgeLabel = opt.setEdgeLabel || _.noop;
|
||||
var setEdgeName = opt.setEdgeName || _.noop;
|
||||
|
||||
this.get('cells').each(function(cell) {
|
||||
|
||||
if (cell.isLink()) {
|
||||
|
||||
var source = cell.get('source');
|
||||
var target = cell.get('target');
|
||||
|
||||
// Links that end at a point are ignored.
|
||||
if (!source.id || !target.id) return;
|
||||
|
||||
// Note that if we are creating a multigraph we can name the edges. If
|
||||
// we try to name edges on a non-multigraph an exception is thrown.
|
||||
glGraph.setEdge(source.id, target.id, setEdgeLabel(cell), setEdgeName(cell));
|
||||
|
||||
} else {
|
||||
|
||||
glGraph.setNode(cell.id, setNodeLabel(cell));
|
||||
|
||||
// For the compound graphs we have to take embeds into account.
|
||||
if (glGraph.isCompound() && cell.has('parent')) {
|
||||
glGraph.setParent(cell.id, cell.get('parent'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return glGraph;
|
||||
};
|
||||
|
||||
// update existing joint.dia.Graph from given graphlib.Graph
|
||||
joint.dia.Graph.prototype.fromGraphLib = function(glGraph, opt) {
|
||||
|
||||
opt = opt || {};
|
||||
|
||||
var importNode = opt.importNode || _.noop;
|
||||
var importEdge = opt.importEdge || _.noop;
|
||||
|
||||
// import all nodes
|
||||
glGraph.nodes().forEach(function(v) {
|
||||
importNode.call(this, v, glGraph, this, opt);
|
||||
}, this);
|
||||
|
||||
// import all edges
|
||||
glGraph.edges().forEach(function(edgeObj) {
|
||||
importEdge.call(this, edgeObj, glGraph, this, opt);
|
||||
}, this);
|
||||
};
|
||||
|
||||
joint.layout.DirectedGraph = {
|
||||
|
||||
layout: function(graph, opt) {
|
||||
|
||||
opt = _.defaults(opt || {}, {
|
||||
resizeClusters: true,
|
||||
clusterPadding: 10
|
||||
});
|
||||
|
||||
// create a graphlib.Graph that represents the joint.dia.Graph
|
||||
var glGraph = graph.toGraphLib({
|
||||
directed: true,
|
||||
// We are about to use edge naming feature.
|
||||
multigraph: true,
|
||||
// We are able to layout graphs with embeds.
|
||||
compound: true,
|
||||
setNodeLabel: function(element) {
|
||||
return {
|
||||
width: element.get('size').width,
|
||||
height: element.get('size').height,
|
||||
rank: element.get('rank')
|
||||
};
|
||||
},
|
||||
setEdgeLabel: function(link) {
|
||||
return {
|
||||
minLen: link.get('minLen') || 1
|
||||
};
|
||||
},
|
||||
setEdgeName: function(link) {
|
||||
// Graphlib edges have no ids. We use edge name property
|
||||
// to store and retrieve ids instead.
|
||||
return link.id;
|
||||
}
|
||||
});
|
||||
|
||||
var glLabel = {};
|
||||
|
||||
// Dagre layout accepts options as lower case.
|
||||
if (opt.rankDir) glLabel.rankdir = opt.rankDir;
|
||||
if (opt.nodeSep) glLabel.nodesep = opt.nodeSep;
|
||||
if (opt.edgeSep) glLabel.edgesep = opt.edgeSep;
|
||||
if (opt.rankSep) glLabel.ranksep = opt.rankSep;
|
||||
if (opt.marginX) glLabel.marginx = opt.marginX;
|
||||
if (opt.marginY) glLabel.marginy = opt.marginY;
|
||||
|
||||
// Set the option object for the graph label
|
||||
glGraph.setGraph(glLabel);
|
||||
|
||||
// executes the layout
|
||||
dagre.layout(glGraph, { debugTiming: !!opt.debugTiming });
|
||||
|
||||
// Update the graph
|
||||
graph.fromGraphLib(glGraph, {
|
||||
importNode: function(v, gl) {
|
||||
|
||||
var element = this.getCell(v);
|
||||
var glNode = gl.node(v);
|
||||
|
||||
if (opt.setPosition) {
|
||||
opt.setPosition(element, glNode);
|
||||
} else {
|
||||
element.set('position', {
|
||||
x: glNode.x - glNode.width / 2,
|
||||
y: glNode.y - glNode.height / 2
|
||||
});
|
||||
}
|
||||
},
|
||||
importEdge: function(edgeObj, gl) {
|
||||
|
||||
var link = this.getCell(edgeObj.name);
|
||||
var glEdge = gl.edge(edgeObj);
|
||||
|
||||
if (opt.setLinkVertices) {
|
||||
if (opt.setVertices) {
|
||||
opt.setVertices(link, glEdge.points);
|
||||
} else {
|
||||
link.set('vertices', glEdge.points);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (opt.resizeClusters) {
|
||||
// Resize and reposition cluster elements (parents of other elements)
|
||||
// to fit their children.
|
||||
// 1. filter clusters only
|
||||
// 2. map id on cells
|
||||
// 3. sort cells by their depth (the deepest first)
|
||||
// 4. resize cell to fit their direct children only.
|
||||
_.chain(glGraph.nodes())
|
||||
.filter(function(v) { return glGraph.children(v).length > 0; })
|
||||
.map(graph.getCell, graph)
|
||||
.sortBy(function(cluster) { return -cluster.getAncestors().length; })
|
||||
.invoke('fitEmbeds', { padding: opt.clusterPadding })
|
||||
.value();
|
||||
}
|
||||
|
||||
// Return an object with height and width of the graph.
|
||||
return glGraph.graph();
|
||||
}
|
||||
};
|
8
shlr/www/enyo/vendors/joint.min.css
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*! JointJS v0.9.7 - JavaScript diagramming library 2015-12-28
|
||||
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
.viewport{-webkit-user-select:none;-moz-user-select:none;user-select:none}[magnet=true]:not(.element){cursor:crosshair}[magnet=true]:not(.element):hover{opacity:.7}.element{cursor:move}.element *{vector-effect:non-scaling-stroke;user-drag:none}.connection-wrap{fill:none;stroke:#000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;opacity:0;cursor:move}.connection-wrap:hover{opacity:.4;stroke-opacity:.4}.connection{fill:none;stroke-linejoin:round}.marker-source,.marker-target{vector-effect:non-scaling-stroke}.marker-vertices{opacity:0;cursor:move}.marker-arrowheads{opacity:0;cursor:move;cursor:-webkit-grab;cursor:-moz-grab}.link-tools{opacity:0;cursor:pointer}.link-tools .tool-options{display:none}.link-tools .tool-remove circle{fill:red}.link-tools .tool-remove path{fill:#fff}.link:hover .marker-vertices,.link:hover .marker-arrowheads,.link:hover .link-tools{opacity:1}.marker-vertex{fill:#1ABC9C}.marker-vertex:hover{fill:#34495E;stroke:none}.marker-arrowhead{fill:#1ABC9C}.marker-arrowhead:hover{fill:#F39C12;stroke:none}.marker-vertex-remove{cursor:pointer;opacity:.1;fill:#fff}.marker-vertex-group:hover .marker-vertex-remove{opacity:1}.marker-vertex-remove-area{opacity:.1;cursor:pointer}.marker-vertex-group:hover .marker-vertex-remove-area{opacity:1}.highlighted{opacity:.7}text.highlighted{fill:red}@media screen and (-webkit-min-device-pixel-ratio:0){.highlighted{outline:2px solid red;opacity:initial}}.element .fobj{overflow:hidden}.element .fobj body{background-color:transparent;margin:0}.element .fobj div{text-align:center;vertical-align:middle;display:table-cell;padding:0 5px}
|
131
shlr/www/enyo/vendors/joint.min.js
vendored
Normal file
13
shlr/www/enyo/vendors/jquery-ui.min.js
vendored
Normal file
142
shlr/www/enyo/vendors/jquery.layout-latest.min.js
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
jquery.layout 1.3.0 - Release Candidate 30.79
|
||||
$Date: 2013-01-01 08:00:00 (Tue, 1 Jan 2013) $
|
||||
$Rev: 303007 $
|
||||
|
||||
Copyright (c) 2013 Kevin Dalman (http://allpro.net)
|
||||
Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
|
||||
Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
|
||||
SEE: http://layout.jquery-dev.net/LICENSE.txt
|
||||
|
||||
Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79
|
||||
|
||||
Docs: http://layout.jquery-dev.net/documentation.html
|
||||
Tips: http://layout.jquery-dev.net/tips.html
|
||||
Help: http://groups.google.com/group/jquery-ui-layout
|
||||
*/
|
||||
(function(b){var a=Math.min,d=Math.max,c=Math.floor,f=function(a){return"string"===b.type(a)},j=function(a,d){if(b.isArray(d))for(var c=0,j=d.length;c<j;c++){var h=d[c];try{f(h)&&(h=eval(h)),b.isFunction(h)&&h(a)}catch(k){}}};b.layout={version:"1.3.rc30.79",revision:0.033007,browser:{},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},
|
||||
west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},config:{optionRootKeys:"effects panes north south west east center".split(" "),allPanes:["north","south","west","east","center"],borderPanes:["north","south","west","east"],oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},offscreenCSS:{left:"-99999px",right:"auto"},offscreenReset:"offscreenReset",hidden:{visibility:"hidden"},visible:{visibility:"visible"},
|
||||
resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",
|
||||
background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},
|
||||
center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},getParentPaneElem:function(a){a=b(a);if(a=a.data("layout")||a.data("parentLayout")){a=a.container;if(a.data("layoutPane"))return a;a=a.closest("."+b.layout.defaults.panes.paneClass);if(a.data("layoutPane"))return a}return null},getParentPaneInstance:function(a){return(a=b.layout.getParentPaneElem(a))?a.data("layoutPane"):null},getParentLayoutInstance:function(a){return(a=b.layout.getParentPaneElem(a))?
|
||||
a.data("parentLayout"):null},getEventObject:function(b){return"object"===typeof b&&b.stopPropagation?b:null},parsePaneName:function(a){var d=b.layout.getEventObject(a);d&&(d.stopPropagation(),a=b(this).data("layoutEdge"));a&&!/^(west|east|north|south|center)$/.test(a)&&(b.layout.msg('LAYOUT ERROR - Invalid pane-name: "'+a+'"'),a="error");return a},plugins:{draggable:!!b.fn.draggable,effects:{core:!!b.effects,slide:b.effects&&(b.effects.slide||b.effects.effect&&b.effects.effect.slide)}},onCreate:[],
|
||||
onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||b.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||b.layout.getScrollbarSize("height")},getScrollbarSize:function(a){var d=b('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"),c={width:d.css("width")-d[0].clientWidth,height:d.height()-d[0].clientHeight};
|
||||
d.remove();window.scrollbarWidth=c.width;window.scrollbarHeight=c.height;return a.match(/^(width|height)$/)?c[a]:c},showInvisibly:function(b,a){if(b&&b.length&&(a||"none"===b.css("display"))){var d=b[0].style,d={display:d.display||"",visibility:d.visibility||""};b.css({display:"block",visibility:"hidden"});return d}return{}},getElementDimensions:function(a,c){var f={css:{},inset:{}},j=f.css,h={bottom:0},k=b.layout.cssNum,p=a.offset(),O,R,D;f.offsetLeft=p.left;f.offsetTop=p.top;c||(c={});b.each(["Left",
|
||||
"Right","Top","Bottom"],function(d,k){O=j["border"+k]=b.layout.borderWidth(a,k);R=j["padding"+k]=b.layout.cssNum(a,"padding"+k);D=k.toLowerCase();f.inset[D]=0<=c[D]?c[D]:R;h[D]=f.inset[D]+O});j.width=a.width();j.height=a.height();j.top=k(a,"top",!0);j.bottom=k(a,"bottom",!0);j.left=k(a,"left",!0);j.right=k(a,"right",!0);f.outerWidth=a.outerWidth();f.outerHeight=a.outerHeight();f.innerWidth=d(0,f.outerWidth-h.left-h.right);f.innerHeight=d(0,f.outerHeight-h.top-h.bottom);f.layoutWidth=a.innerWidth();
|
||||
f.layoutHeight=a.innerHeight();return f},getElementStyles:function(b,a){var d={},c=b[0].style,f=a.split(","),k=["Top","Bottom","Left","Right"],j=["Color","Style","Width"],h,p,D,x,A,r;for(x=0;x<f.length;x++)if(h=f[x],h.match(/(border|padding|margin)$/))for(A=0;4>A;A++)if(p=k[A],"border"===h)for(r=0;3>r;r++)D=j[r],d[h+p+D]=c[h+p+D];else d[h+p]=c[h+p];else d[h]=c[h];return d},cssWidth:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):
|
||||
"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Left")+j(a,"Right"));"content-box"===f&&(k-=h(a,"paddingLeft")+h(a,"paddingRight"));return d(0,k)},cssHeight:function(a,c){if(0>=c)return 0;var f=!b.layout.browser.boxModel?"border-box":b.support.boxSizing?a.css("boxSizing"):"content-box",j=b.layout.borderWidth,h=b.layout.cssNum,k=c;"border-box"!==f&&(k-=j(a,"Top")+j(a,"Bottom"));"content-box"===f&&(k-=h(a,"paddingTop")+h(a,"paddingBottom"));return d(0,k)},cssNum:function(a,
|
||||
d,c){a.jquery||(a=b(a));var f=b.layout.showInvisibly(a);d=b.css(a[0],d,!0);c=c&&"auto"==d?d:Math.round(parseFloat(d)||0);a.css(f);return c},borderWidth:function(a,d){a.jquery&&(a=a[0]);var c="border"+d.substr(0,1).toUpperCase()+d.substr(1);return"none"===b.css(a,c+"Style",!0)?0:Math.round(parseFloat(b.css(a,c+"Width",!0))||0)},isMouseOverElem:function(a,d){var c=b(d||this),f=c.offset(),j=f.top,f=f.left,k=f+c.outerWidth(),c=j+c.outerHeight(),h=a.pageX,p=a.pageY;return b.layout.browser.msie&&0>h&&0>
|
||||
p||h>=f&&h<=k&&p>=j&&p<=c},msg:function(a,d,c,f){b.isPlainObject(a)&&window.debugData?("string"===typeof d?(f=c,c=d):"object"===typeof c&&(f=c,c=null),c=c||"log( <object> )",f=b.extend({sort:!1,returnHTML:!1,display:!1},f),!0===d||f.display?debugData(a,c,f):window.console&&console.log(debugData(a,c,f))):d?alert(a):window.console?console.log(a):(d=b("#layoutLogger"),d.length||(d=b('<div id="layoutLogger" style="position: '+(b.support.fixedPosition?"fixed":"absolute")+'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);"><div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;"><span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div><ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul></div>').appendTo("body"),
|
||||
d.css("left",b(window).width()-d.outerWidth()-5),b.ui.draggable&&d.draggable({handle:":first-child"})),d.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+a.replace(/\</g,"<").replace(/\>/g,">")+"</li>"))}};var h=navigator.userAgent.toLowerCase(),p=/(chrome)[ \/]([\w.]+)/.exec(h)||/(webkit)[ \/]([\w.]+)/.exec(h)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(h)||/(msie) ([\w.]+)/.exec(h)||0>h.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(h)||
|
||||
[],h=p[1]||"",p=p[2]||0,x="msie"===h;b.layout.browser={version:p,safari:"webkit"===h,webkit:"chrome"===h,msie:x,isIE6:x&&6==p,boxModel:!x||!1!==b.support.boxModel};h&&(b.layout.browser[h]=!0);x&&b(function(){b.layout.browser.boxModel=b.support.boxModel});b.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,
|
||||
onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1E3,resizer_drag:1E4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",
|
||||
noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",
|
||||
buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",
|
||||
slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:b.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},
|
||||
fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",
|
||||
size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};b.layout.optionsMap={layout:"name instanceKey stateManagement effects inset zIndexes errors zIndex scrollToBookmarkOnLoad showErrorMessages maskPanesEarly outset resizeWithWindow resizeWithWindowDelay resizeWithWindowMaxDelay onresizeall onresizeall_start onresizeall_end onload onload_start onload_end onunload onunload_start onunload_end".split(" "),
|
||||
center:"paneClass contentSelector contentIgnoreSelector findNestedContent applyDemoStyles triggerEventsOnLoad showOverflowOnHover maskContents maskObjects liveContentResizing containerSelector children initChildren resizeChildren destroyChildren onresize onresize_start onresize_end onsizecontent onsizecontent_start onsizecontent_end".split(" "),noDefault:["paneSelector","resizerCursor","customHotkey"]};b.layout.transformData=function(a,d){var c=d?{panes:{},center:{}}:{},f,j,k,h,p,x,D;if("object"!==
|
||||
typeof a)return c;for(j in a){f=c;p=a[j];k=j.split("__");D=k.length-1;for(x=0;x<=D;x++)h=k[x],x===D?f[h]=b.isPlainObject(p)?b.layout.transformData(p):p:(f[h]||(f[h]={}),f=f[h])}return c};b.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",
|
||||
triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",
|
||||
noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(a){function d(b,c){for(var f=b.split("."),k=f.length-1,j={branch:a,key:f[k]},r=0,q;r<k;r++)q=f[r],j.branch=void 0==j.branch[q]?c?j.branch[q]={}:{}:j.branch[q];return j}var c=b.layout.backwardCompatibility.map,f,j,k,h;for(h in c)f=d(h),k=f.branch[f.key],void 0!==k&&(j=d(c[h],!0),j.branch[j.key]=k,delete f.branch[f.key])},renameAllOptions:function(a){var d=
|
||||
b.layout.backwardCompatibility.renameOptions;d(a);a.defaults&&("object"!==typeof a.panes&&(a.panes={}),b.extend(!0,a.panes,a.defaults),delete a.defaults);a.panes&&d(a.panes);b.each(b.layout.config.allPanes,function(b,c){a[c]&&d(a[c])});return a}};b.fn.layout=function(h){function p(e){if(!e)return!0;var w=e.keyCode;if(33>w)return!0;var m={38:"north",40:"south",37:"west",39:"east"},a=e.shiftKey,g=e.ctrlKey,t,n,d,c;g&&(37<=w&&40>=w)&&r[m[w]].enableCursorHotkey?c=m[w]:(g||a)&&b.each(k.borderPanes,function(e,
|
||||
b){t=r[b];n=t.customHotkey;d=t.customHotkeyModifier;if(a&&"SHIFT"==d||g&&"CTRL"==d||g&&a)if(n&&w===(isNaN(n)||9>=n?n.toUpperCase().charCodeAt(0):n))return c=b,!1});if(!c||!y[c]||!r[c].closable||q[c].isHidden)return!0;na(c);e.stopPropagation();return e.returnValue=!1}function x(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){var m=w.data("layoutEdge");e=q[m];e.cssSaved&&
|
||||
X(m);if(e.isSliding||e.isResizing||e.isClosed)e.cssSaved=!1;else{var a={zIndex:r.zIndexes.resizer_normal+1},g={},t=w.css("overflow"),n=w.css("overflowX"),d=w.css("overflowY");"visible"!=t&&(g.overflow=t,a.overflow="visible");n&&!n.match(/(visible|auto)/)&&(g.overflowX=n,a.overflowX="visible");d&&!d.match(/(visible|auto)/)&&(g.overflowY=n,a.overflowY="visible");e.cssSaved=g;w.css(a);b.each(k.allPanes,function(e,b){b!=m&&X(b)})}}}}function X(e){if(H()){this&&this.tagName&&(e=this);var w;f(e)?w=y[e]:
|
||||
b(e).data("layoutRole")?w=b(e):b(e).parents().each(function(){if(b(this).data("layoutRole"))return w=b(this),!1});if(w&&w.length){e=w.data("layoutEdge");e=q[e];var m=e.cssSaved||{};!e.isSliding&&!e.isResizing&&w.css("zIndex",r.zIndexes.pane_normal);w.css(m);e.cssSaved=!1}}}var G=b.layout.browser,k=b.layout.config,Q=b.layout.cssWidth,O=b.layout.cssHeight,R=b.layout.getElementDimensions,D=b.layout.getElementStyles,Ma=b.layout.getEventObject,A=b.layout.parsePaneName,r=b.extend(!0,{},b.layout.defaults);
|
||||
r.effects=b.extend(!0,{},b.layout.effects);var q={id:"layout"+b.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},ba={north:null,south:null,east:null,west:null,center:null},M={data:{},set:function(e,b,m){M.clear(e);M.data[e]=setTimeout(b,m)},clear:function(e){var b=M.data;b[e]&&(clearTimeout(b[e]),delete b[e])}},
|
||||
ca=function(e,w,m){var a=r;(a.showErrorMessages&&!m||m&&a.showDebugMessages)&&b.layout.msg(a.name+" / "+e,!1!==w);return!1},C=function(e,w,m){var a=w&&f(w),g=a?q[w]:q,t=a?r[w]:r,n=r.name,d=e+(e.match(/_/)?"":"_end"),c=d.match(/_end$/)?d.substr(0,d.length-4):"",l=t[d]||t[c],h="NC",k=[];!a&&"boolean"===b.type(w)&&(m=w,w="");if(l)try{f(l)&&(l.match(/,/)?(k=l.split(","),l=eval(k[0])):l=eval(l)),b.isFunction(l)&&(h=k.length?l(k[1]):a?l(w,y[w],g,t,n):l(z,g,t,n))}catch(j){ca(r.errors.callbackError.replace(/EVENT/,
|
||||
b.trim((w||"")+" "+d)),!1),"string"===b.type(j)&&string.length&&ca("Exception: "+j,!1)}!m&&!1!==h&&(a?(m=y[w],t=r[w],g=q[w],m.triggerHandler("layoutpane"+d,[w,m,g,t,n]),c&&m.triggerHandler("layoutpane"+c,[w,m,g,t,n])):(u.triggerHandler("layout"+d,[z,g,t,n]),c&&u.triggerHandler("layout"+c,[z,g,t,n])));a&&"onresize_end"===e&&db(w+"",!0);return h},eb=function(e){if(!G.mozilla){var b=y[e];"IFRAME"===q[e].tagName?b.css(k.hidden).css(k.visible):b.find("IFRAME").css(k.hidden).css(k.visible)}},ya=function(e){var b=
|
||||
y[e];e=k[e].dir;b={minWidth:1001-Q(b,1E3),minHeight:1001-O(b,1E3)};"horz"===e&&(b.minSize=b.minHeight);"vert"===e&&(b.minSize=b.minWidth);return b},fa=function(e,w,m){m||(m=k[e].dir);f(w)&&w.match(/%/)&&(w="100%"===w?-1:parseInt(w,10)/100);if(0===w)return 0;if(1<=w)return parseInt(w,10);var a=r,g=0;"horz"==m?g=v.innerHeight-(y.north?a.north.spacing_open:0)-(y.south?a.south.spacing_open:0):"vert"==m&&(g=v.innerWidth-(y.west?a.west.spacing_open:0)-(y.east?a.east.spacing_open:0));if(-1===w)return g;
|
||||
if(0<w)return c(g*w);if("center"==e)return 0;m="horz"===m?"height":"width";a=y[e];e="height"===m?U[e]:!1;var g=b.layout.showInvisibly(a),t=a.css(m),n=e?e.css(m):0;a.css(m,"auto");e&&e.css(m,"auto");w="height"===m?a.outerHeight():a.outerWidth();a.css(m,t).css(g);e&&e.css(m,n);return w},ga=function(e,b){var a=y[e],E=r[e],g=q[e],t=b?E.spacing_open:0,E=b?E.spacing_closed:0;return!a||g.isHidden?0:g.isClosed||g.isSliding&&b?E:"horz"===k[e].dir?a.outerHeight()+t:a.outerWidth()+t},Y=function(e,b){if(H()){var m=
|
||||
r[e],E=q[e],g=k[e],t=g.dir;g.sizeType.toLowerCase();var g=void 0!=b?b:E.isSliding,n=m.spacing_open,c=k.oppositeEdge[e],f=q[c],l=y[c],h=!l||!1===f.isVisible||f.isSliding?0:"horz"==t?l.outerHeight():l.outerWidth(),c=(!l||f.isHidden?0:r[c][!1!==f.isClosed?"spacing_closed":"spacing_open"])||0,f="horz"==t?v.innerHeight:v.innerWidth,l=ya("center"),l="horz"==t?d(r.center.minHeight,l.minHeight):d(r.center.minWidth,l.minWidth),g=f-n-(g?0:fa("center",l,t)+h+c),t=E.minSize=d(fa(e,m.minSize),ya(e).minSize),g=
|
||||
E.maxSize=a(m.maxSize?fa(e,m.maxSize):1E5,g),E=E.resizerPosition={},n=v.inset.top,h=v.inset.left,c=v.innerWidth,f=v.innerHeight,m=m.spacing_open;switch(e){case "north":E.min=n+t;E.max=n+g;break;case "west":E.min=h+t;E.max=h+g;break;case "south":E.min=n+f-g-m;E.max=n+f-t-m;break;case "east":E.min=h+c-g-m,E.max=h+c-t-m}}},Na=function(e,a){var m=b(e),E=m.data("layoutRole"),g=m.data("layoutEdge"),t=r[g][E+"Class"],g="-"+g,n=m.hasClass(t+"-closed")?"-closed":"-open",d="-closed"===n?"-open":"-closed",n=
|
||||
t+"-hover "+(t+g+"-hover ")+(t+n+"-hover ")+(t+g+n+"-hover ");a&&(n+=t+d+"-hover "+(t+g+d+"-hover "));"resizer"==E&&m.hasClass(t+"-sliding")&&(n+=t+"-sliding-hover "+(t+g+"-sliding-hover "));return b.trim(n)},Oa=function(e,a){var m=b(a||this);e&&"toggler"===m.data("layoutRole")&&e.stopPropagation();m.addClass(Na(m))},da=function(e,a){var m=b(a||this);m.removeClass(Na(m,!0))},fb=function(){var e=b(this).data("layoutEdge"),a=q[e];!a.isClosed&&(!a.isResizing&&!q.paneResizing)&&(b.fn.disableSelection&&
|
||||
b("body").disableSelection(),r.maskPanesEarly&&va(e,{resizing:!0}))},gb=function(e,a){var m=a||this,E=b(m).data("layoutEdge"),g=E+"ResizerLeave";M.clear(E+"_openSlider");M.clear(g);a?q.paneResizing||(b.fn.enableSelection&&b("body").enableSelection(),r.maskPanesEarly&&za()):M.set(g,function(){gb(e,m)},200)},H=function(){return q.initialized||q.creatingLayout?!0:Aa()},Aa=function(e){var a=r;if(!u.is(":visible"))return!e&&(G.webkit&&"BODY"===u[0].tagName)&&setTimeout(function(){Aa(!0)},50),!1;if(!hb("center").length)return ca(a.errors.centerPaneMissing);
|
||||
q.creatingLayout=!0;b.extend(v,R(u,a.inset));A(void 0);b.each(k.allPanes,function(e,b){ib(b,!0)});Pa();b.each(k.borderPanes,function(e,b){y[b]&&q[b].isVisible&&(Y(b),ha(b))});ia("center");b.each(k.allPanes,function(e,b){jb(b)});a.scrollToBookmarkOnLoad&&(e=self.location,e.hash&&e.replace(e.hash));z.hasParentLayout?a.resizeWithWindow=!1:a.resizeWithWindow&&b(window).bind("resize."+K,Ab);delete q.creatingLayout;q.initialized=!0;j(z,b.layout.onReady);C("onload_end");return!0},Qa=function(e,a){var m=
|
||||
A.call(this,e),d=y[m];if(d){var g=U[m],t=q[m],n=r[m],c=r.stateManagement||{},n=a?n.children=a:n.children;if(b.isPlainObject(n))n=[n];else if(!n||!b.isArray(n))return;b.each(n,function(e,a){b.isPlainObject(a)&&(a.containerSelector?d.find(a.containerSelector):g||d).each(function(){var e=b(this),g=e.data("layout");if(!g){kb({container:e,options:a},t);if(c.includeChildren&&q.stateData[m]){var g=(q.stateData[m].children||{})[a.instanceKey],w=a.stateManagement||(a.stateManagement={autoLoad:!0});!0===w.autoLoad&&
|
||||
g&&(w.autoSave=!1,w.includeChildren=!0,w.autoLoad=b.extend(!0,{},g))}(g=e.layout(a))&&Ba(m,g)}})})}},kb=function(e,b){var a=e.container,d=e.options,g=d.stateManagement,t=d.instanceKey||a.data("layoutInstanceKey");t||(t=(g&&g.cookie?g.cookie.name:"")||d.name);t=t?t.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++b.childIdx;d.instanceKey=t;a.data("layoutInstanceKey",t);return t},Ba=function(e,a){var m=y[e],d=ba[e],g=q[e];b.isPlainObject(d)&&(b.each(d,function(e,b){b.destroyed&&delete d[e]}),
|
||||
b.isEmptyObject(d)&&(d=ba[e]=null));!a&&!d&&(a=m.data("layout"));a&&(a.hasParentLayout=!0,m=a.options,kb(a,g),d||(d=ba[e]={}),d[m.instanceKey]=a.container.data("layout"));z[e].children=ba[e];a||Qa(e)},Ab=function(){var e=r,b=Number(e.resizeWithWindowDelay);10>b&&(b=100);M.clear("winResize");M.set("winResize",function(){M.clear("winResize");M.clear("winResizeRepeater");var b=R(u,e.inset);(b.innerWidth!==v.innerWidth||b.innerHeight!==v.innerHeight)&&oa()},b);M.data.winResizeRepeater||lb()},lb=function(){var e=
|
||||
Number(r.resizeWithWindowMaxDelay);0<e&&M.set("winResizeRepeater",function(){lb();oa()},e)},mb=function(){C("onunload_start");j(z,b.layout.onUnload);C("onunload_end")},nb=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=r[a];if(d.enableCursorHotkey||d.customHotkey)return b(document).bind("keydown."+K,p),!1})},hb=function(e){e=r[e].paneSelector;if("#"===e.substr(0,1))return u.find(e).eq(0);var b=u.children(e).eq(0);return b.length?b:u.children("form:first").children(e).eq(0)},
|
||||
ib=function(e,b){if(b||H()){var m=r[e],c=q[e],g=k[e],t=g.dir,n="center"===e,f={},h=y[e],l,j;h?Ra(e,!1,!0,!1):U[e]=!1;h=y[e]=hb(e);if(h.length){h.data("layoutCSS")||h.data("layoutCSS",D(h,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"));z[e]={name:e,pane:y[e],content:U[e],options:r[e],state:q[e],children:ba[e]};h.data({parentLayout:z,layoutPane:z[e],layoutEdge:e,layoutRole:"pane"}).css(g.cssReq).css("zIndex",r.zIndexes.pane_normal).css(m.applyDemoStyles?
|
||||
g.cssDemo:{}).addClass(m.paneClass+" "+m.paneClass+"-"+e).bind("mouseenter."+K,Oa).bind("mouseleave."+K,da);g={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",
|
||||
resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(j in g)h.bind("layoutpane"+j.toLowerCase()+"."+K,z[g[j]||j]);Sa(e,!1);n||(l=c.size=fa(e,m.size),n=fa(e,m.minSize)||1,j=fa(e,m.maxSize)||1E5,0<l&&(l=d(a(l,j),n)),c.autoResize=m.autoResize,c.isClosed=!1,c.isSliding=!1,c.isResizing=!1,c.isHidden=!1,c.pins||(c.pins=[]));c.tagName=h[0].tagName;c.edge=e;c.noRoom=!1;c.isVisible=!0;ob(e);"horz"===t?f.height=O(h,l):"vert"===t&&(f.width=Q(h,l));h.css(f);"horz"!=t&&ia(e,!0);q.initialized&&(Pa(e),nb(e));m.initClosed&&
|
||||
m.closable&&!m.initHidden?ja(e,!0,!0):m.initHidden||m.initClosed?Ta(e):c.noRoom||h.css("display","block");h.css("visibility","visible");m.showOverflowOnHover&&h.hover(x,X);q.initialized&&jb(e)}else y[e]=!1}},jb=function(e){var b=y[e],a=q[e],d=r[e];b&&(b.data("layout")&&Ba(e,b.data("layout")),a.isVisible&&(q.initialized?oa():pa(e),d.triggerEventsOnLoad?C("onresize_end",e):db(e,!0)),d.initChildren&&d.children&&Qa(e))},ob=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,b){var a=y[b],g=
|
||||
F[b],d=q[b],c=k[b].side,f={};if(a){switch(b){case "north":f.top=v.inset.top;f.left=v.inset.left;f.right=v.inset.right;break;case "south":f.bottom=v.inset.bottom;f.left=v.inset.left;f.right=v.inset.right;break;case "west":f.left=v.inset.left;break;case "east":f.right=v.inset.right}a.css(f);g&&d.isClosed?g.css(c,v.inset[c]):g&&!d.isHidden&&g.css(c,v.inset[c]+ga(b))}})},Pa=function(e){e=e?e.split(","):k.borderPanes;b.each(e,function(e,a){var d=y[a];F[a]=!1;P[a]=!1;if(d){var g=r[a],d=q[a],c="#"===g.paneSelector.substr(0,
|
||||
1)?g.paneSelector.substr(1):"",n=g.resizerClass,f=g.togglerClass,h="-"+a,l=z[a],j=l.resizer=F[a]=b("<div></div>"),l=l.toggler=g.closable?P[a]=b("<div></div>"):!1;!d.isVisible&&g.slidable&&j.attr("title",g.tips.Slide).css("cursor",g.sliderCursor);j.attr("id",c?c+"-resizer":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"resizer"}).css(k.resizers.cssReq).css("zIndex",r.zIndexes.resizer_normal).css(g.applyDemoStyles?k.resizers.cssDemo:{}).addClass(n+" "+n+h).hover(Oa,da).hover(fb,gb).appendTo(u);
|
||||
g.resizerDblClickToggle&&j.bind("dblclick."+K,na);l&&(l.attr("id",c?c+"-toggler":"").data({parentLayout:z,layoutPane:z[a],layoutEdge:a,layoutRole:"toggler"}).css(k.togglers.cssReq).css(g.applyDemoStyles?k.togglers.cssDemo:{}).addClass(f+" "+f+h).hover(Oa,da).bind("mouseenter",fb).appendTo(j),g.togglerContent_open&&b("<span>"+g.togglerContent_open+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",a).addClass("content content-open").css("display",
|
||||
"none").appendTo(l),g.togglerContent_closed&&b("<span>"+g.togglerContent_closed+"</span>").data({layoutEdge:a,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(l),pb(a));var g=a,B=b.layout.plugins.draggable,g=g?g.split(","):k.borderPanes;b.each(g,function(e,a){var g=r[a];if(!B||!y[a]||!g.resizable)return g.resizable=!1,!0;var m=q[a],w=r.zIndexes,d=k[a],c="horz"==d.dir?"top":"left",t=F[a],n=g.resizerClass,f=0,l,h,E=n+"-drag",j=n+"-"+a+"-drag",J=n+"-dragging",
|
||||
zb=n+"-"+a+"-dragging",cb=n+"-dragging-limit",v=n+"-"+a+"-dragging-limit",x=!1;m.isClosed||t.attr("title",g.tips.Resize).css("cursor",g.resizerCursor);t.draggable({containment:u[0],axis:"horz"==d.dir?"y":"x",delay:0,distance:1,grid:g.resizingGrid,helper:"clone",opacity:g.resizerDragOpacity,addClasses:!1,zIndex:w.resizer_drag,start:function(e,w){g=r[a];m=q[a];h=g.livePaneResizing;if(!1===C("ondrag_start",a))return!1;m.isResizing=!0;q.paneResizing=a;M.clear(a+"_closeSlider");Y(a);l=m.resizerPosition;
|
||||
f=w.position[c];t.addClass(E+" "+j);x=!1;b("body").disableSelection();va(a,{resizing:!0})},drag:function(e,b){x||(b.helper.addClass(J+" "+zb).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),x=!0,m.isSliding&&y[a].css("zIndex",w.pane_sliding));var d=0;b.position[c]<l.min?(b.position[c]=l.min,d=-1):b.position[c]>l.max&&(b.position[c]=l.max,d=1);d?(b.helper.addClass(cb+" "+v),window.defaultStatus=0<d&&a.match(/(north|west)/)||0>d&&a.match(/(south|east)/)?g.tips.maxSizeWarning:
|
||||
g.tips.minSizeWarning):(b.helper.removeClass(cb+" "+v),window.defaultStatus="");h&&Math.abs(b.position[c]-f)>=g.liveResizingTolerance&&(f=b.position[c],p(e,b,a))},stop:function(e,g){b("body").enableSelection();window.defaultStatus="";t.removeClass(E+" "+j);m.isResizing=!1;q.paneResizing=!1;p(e,g,a,!0)}})});var p=function(b,e,a,g){var m=e.position,w=k[a];b=r[a];e=q[a];var d;switch(a){case "north":d=m.top;break;case "west":d=m.left;break;case "south":d=v.layoutHeight-m.top-b.spacing_open;break;case "east":d=
|
||||
v.layoutWidth-m.left-b.spacing_open}d-=v.inset[w.side];g?(!1!==C("ondrag_end",a)&&Ca(a,d,!1,!0),za(!0),e.isSliding&&va(a,{resizing:!0})):Math.abs(d-e.size)<b.liveResizingTolerance||(Ca(a,d,!1,!0),ea.each(qb))};d.isVisible?Ua(a):(Da(a),ma(a,!0))}});qa()},Sa=function(b,a){if(H()){var m=r[b],d=m.contentSelector,g=z[b],c=y[b],n;d&&(n=g.content=U[b]=m.findNestedContent?c.find(d).eq(0):c.children(d).eq(0));n&&n.length?(n.data("layoutRole","content"),n.data("layoutCSS")||n.data("layoutCSS",D(n,"height")),
|
||||
n.css(k.content.cssReq),m.applyDemoStyles&&(n.css(k.content.cssDemo),c.css(k.content.cssDemoPane)),c.css("overflowX").match(/(scroll|auto)/)&&c.css("overflow","hidden"),q[b].content={},!1!==a&&pa(b)):g.content=U[b]=!1}},qb=function(){var e=b(this),a=e.data("layoutMask"),a=q[a];"IFRAME"==a.tagName&&a.isVisible&&e.css({top:a.offsetTop,left:a.offsetLeft,width:a.outerWidth,height:a.outerHeight})},va=function(e,a){var m=k[e],d=["center"],g=r.zIndexes,c=b.extend({objectsOnly:!1,animation:!1,resizing:!0,
|
||||
sliding:q[e].isSliding},a),n,f;c.resizing&&d.push(e);c.sliding&&d.push(k.oppositeEdge[e]);"horz"===m.dir&&(d.push("west"),d.push("east"));b.each(d,function(e,a){f=q[a];n=r[a];if(f.isVisible&&(n.maskObjects||!c.objectsOnly&&n.maskContents)){for(var m=b([]),d,w=0,h=ea.length;w<h;w++)d=ea.eq(w),d.data("layoutMask")===a&&(m=m.add(d));if(!m.length){m=y[a];d=q[a];var w=r[a],h=r.zIndexes,j=b([]),E,k,v,p,x;if(w.maskContents||w.maskObjects)for(x=0;x<(w.maskObjects?2:1);x++)E=w.maskObjects&&0==x,k=document.createElement(E?
|
||||
"iframe":"div"),v=b(k).data("layoutMask",a),k.className="ui-layout-mask ui-layout-mask-"+a,p=k.style,p.display="block",p.position="absolute",p.background="#FFF",E&&(k.frameborder=0,k.src="about:blank",p.opacity=0,p.filter="Alpha(Opacity='0')",p.border=0),"IFRAME"==d.tagName?(p.zIndex=h.pane_normal+1,u.append(k)):(v.addClass("ui-layout-mask-inside-pane"),p.zIndex=w.maskZindex||h.content_mask,p.top=0,p.left=0,p.width="100%",p.height="100%",m.append(k)),j=j.add(k),ea=ea.add(k);m=j}m.each(function(){qb.call(this);
|
||||
this.style.zIndex=f.isSliding?g.pane_sliding+1:g.pane_normal+1;this.style.display="block"})}})},za=function(a){if(a||!q.paneResizing)ea.hide();else if(!a&&!b.isEmptyObject(q.panesSliding)){a=ea.length-1;for(var d,m;0<=a;a--)m=ea.eq(a),d=m.data("layoutMask"),r[d].maskObjects||m.hide()}},Ra=function(a,d,m,c){if(H()){a=A.call(this,a);var g=y[a],t=U[a],n=F[a],f=P[a];g&&b.isEmptyObject(g.data())&&(g=!1);t&&b.isEmptyObject(t.data())&&(t=!1);n&&b.isEmptyObject(n.data())&&(n=!1);f&&b.isEmptyObject(f.data())&&
|
||||
(f=!1);g&&g.stop(!0,!0);var h=r[a],l=ba[a],j=b.isPlainObject(l)&&!b.isEmptyObject(l);c=void 0!==c?c:h.destroyChildren;j&&c&&(b.each(l,function(a,b){b.destroyed||b.destroy(!0);b.destroyed&&delete l[a]}),b.isEmptyObject(l)&&(l=ba[a]=null,j=!1));g&&d&&!j?g.remove():g&&g[0]&&(d=h.paneClass,c=d+"-"+a,d=[d,d+"-open",d+"-closed",d+"-sliding",c,c+"-open",c+"-closed",c+"-sliding"],b.merge(d,Na(g,!0)),g.removeClass(d.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+
|
||||
K),j&&t?(t.width(t.width()),b.each(l,function(a,b){b.resizeAll()})):t&&t.css(t.data("layoutCSS")).removeData("layoutCSS").removeData("layoutRole"),g.data("layout")||g.css(g.data("layoutCSS")).removeData("layoutCSS"));f&&f.remove();n&&n.remove();z[a]=y[a]=U[a]=F[a]=P[a]=!1;m||oa()}},Ea=function(a){var b=y[a],d=b[0].style;r[a].useOffscreenClose?(b.data(k.offscreenReset)||b.data(k.offscreenReset,{left:d.left,right:d.right}),b.css(k.offscreenCSS)):b.hide().removeData(k.offscreenReset)},rb=function(a){var b=
|
||||
y[a];a=r[a];var d=k.offscreenCSS,c=b.data(k.offscreenReset),g=b[0].style;b.show().removeData(k.offscreenReset);a.useOffscreenClose&&c&&(g.left==d.left&&(g.left=c.left),g.right==d.right&&(g.right=c.right))},Ta=function(a,b){if(H()){var d=A.call(this,a),c=r[d],g=q[d],t=F[d];y[d]&&!g.isHidden&&!(q.initialized&&!1===C("onhide_start",d))&&(g.isSliding=!1,delete q.panesSliding[d],t&&t.hide(),!q.initialized||g.isClosed?(g.isClosed=!0,g.isHidden=!0,g.isVisible=!1,q.initialized||Ea(d),ia("horz"===k[d].dir?
|
||||
"":"center"),(q.initialized||c.triggerEventsOnLoad)&&C("onhide_end",d)):(g.isHiding=!0,ja(d,!1,b)))}},Fa=function(a,b,d,c){if(H()){a=A.call(this,a);var g=q[a];y[a]&&g.isHidden&&!1!==C("onshow_start",a)&&(g.isShowing=!0,g.isSliding=!1,delete q.panesSliding[a],!1===b?ja(a,!0):ra(a,!1,d,c))}},na=function(a,b){if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];d&&d.stopImmediatePropagation();g.isHidden?Fa(c):g.isClosed?ra(c,!!b):ja(c)}},ja=function(a,b,d,c){function g(){l.isMoving=!1;ma(t,!0);var a=k.oppositeEdge[t];
|
||||
q[a].noRoom&&(Y(a),ha(a));if(!c&&(q.initialized||h.triggerEventsOnLoad))p||C("onclose_end",t),p&&C("onshow_end",t),v&&C("onhide_end",t)}var t=A.call(this,a);if(!q.initialized&&y[t]){a=t;var n=q[a];Ea(a);n.isClosed=!0;n.isVisible=!1;Da(a)}else if(H()){var f=y[t],h=r[t],l=q[t],j,p,v;u.queue(function(a){if(!f||!h.closable&&!l.isShowing&&!l.isHiding||!b&&l.isClosed&&!l.isShowing)return a();var e=!l.isShowing&&!1===C("onclose_start",t);p=l.isShowing;v=l.isHiding;delete l.isShowing;delete l.isHiding;if(e)return a();
|
||||
j=!d&&!l.isClosed&&"none"!=h.fxName_close;l.isMoving=!0;l.isClosed=!0;l.isVisible=!1;v?l.isHidden=!0:p&&(l.isHidden=!1);l.isSliding?wa(t,!1):ia("horz"===k[t].dir?"":"center",!1);Da(t);j?(Ga(t,!0),f.hide(h.fxName_close,h.fxSettings_close,h.fxSpeed_close,function(){Ga(t,!1);l.isClosed&&g();a()})):(Ea(t),g(),a())})}},Da=function(a){if(F[a]){var d=F[a],c=P[a],f=r[a],g=k[a].side,t=f.resizerClass,n=f.togglerClass,h="-"+a;d.css(g,v.inset[g]).removeClass(t+"-open "+t+h+"-open").removeClass(t+"-sliding "+
|
||||
t+h+"-sliding").addClass(t+"-closed "+t+h+"-closed");f.resizable&&b.layout.plugins.draggable&&d.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title","");c&&(c.removeClass(n+"-open "+n+h+"-open").addClass(n+"-closed "+n+h+"-closed").attr("title",f.tips.Open),c.children(".content-open").hide(),c.children(".content-closed").css("display","block"));Va(a,!1);q.initialized&&qa()}},ra=function(a,b,d,c){function g(){j.isMoving=!1;eb(f);j.isSliding||ia("vert"==k[f].dir?
|
||||
"center":"",!1);Ua(f)}if(H()){var f=A.call(this,a),n=y[f],h=r[f],j=q[f],l,p;u.queue(function(a){if(!n||!h.resizable&&!h.closable&&!j.isShowing||j.isVisible&&!j.isSliding)return a();if(j.isHidden&&!j.isShowing)a(),Fa(f,!0);else{j.autoResize&&j.size!=h.size?ka(f,h.size,!0,!0,!0):Y(f,b);var e=C("onopen_start",f);if("abort"===e)return a();"NC"!==e&&Y(f,b);if(j.minSize>j.maxSize)return Va(f,!1),!c&&h.tips.noRoomToOpen&&alert(h.tips.noRoomToOpen),a();b?wa(f,!0):j.isSliding?wa(f,!1):h.slidable&&ma(f,!1);
|
||||
j.noRoom=!1;ha(f);p=j.isShowing;delete j.isShowing;l=!d&&j.isClosed&&"none"!=h.fxName_open;j.isMoving=!0;j.isVisible=!0;j.isClosed=!1;p&&(j.isHidden=!1);l?(Ga(f,!0),n.show(h.fxName_open,h.fxSettings_open,h.fxSpeed_open,function(){Ga(f,!1);j.isVisible&&g();a()})):(rb(f),g(),a())}})}},Ua=function(a,d){var c=y[a],f=F[a],g=P[a],h=r[a],n=q[a],j=k[a].side,p=h.resizerClass,l=h.togglerClass,u="-"+a;f.css(j,v.inset[j]+ga(a)).removeClass(p+"-closed "+p+u+"-closed").addClass(p+"-open "+p+u+"-open");n.isSliding?
|
||||
f.addClass(p+"-sliding "+p+u+"-sliding"):f.removeClass(p+"-sliding "+p+u+"-sliding");da(0,f);h.resizable&&b.layout.plugins.draggable?f.draggable("enable").css("cursor",h.resizerCursor).attr("title",h.tips.Resize):n.isSliding||f.css("cursor","default");g&&(g.removeClass(l+"-closed "+l+u+"-closed").addClass(l+"-open "+l+u+"-open").attr("title",h.tips.Close),da(0,g),g.children(".content-closed").hide(),g.children(".content-open").css("display","block"));Va(a,!n.isSliding);b.extend(n,R(c));q.initialized&&
|
||||
(qa(),pa(a,!0));if(!d&&(q.initialized||h.triggerEventsOnLoad)&&c.is(":visible"))C("onopen_end",a),n.isShowing&&C("onshow_end",a),q.initialized&&C("onresize_end",a)},sb=function(a){function b(){g.isClosed?g.isMoving||ra(c,!0):wa(c,!0)}if(H()){var d=Ma(a),c=A.call(this,a),g=q[c];a=r[c].slideDelay_open;d&&d.stopImmediatePropagation();g.isClosed&&d&&"mouseenter"===d.type&&0<a?M.set(c+"_openSlider",b,a):b()}},Wa=function(a){function c(){g.isClosed?wa(f,!1):g.isMoving||ja(f)}if(H()){var m=Ma(a),f=A.call(this,
|
||||
a);a=r[f];var g=q[f],h=g.isMoving?1E3:300;!g.isClosed&&!g.isResizing&&("click"===a.slideTrigger_close?c():a.preventQuickSlideClose&&g.isMoving||a.preventPrematureSlideClose&&m&&b.layout.isMouseOverElem(m,y[f])||(m?M.set(f+"_closeSlider",c,d(a.slideDelay_close,h)):c()))}},Ga=function(a,b){var d=y[a],c=q[a],g=r[a],f=r.zIndexes;b?(va(a,{animation:!0,objectsOnly:!0}),d.css({zIndex:f.pane_animate}),"south"==a?d.css({top:v.inset.top+v.innerHeight-d.outerHeight()}):"east"==a&&d.css({left:v.inset.left+v.innerWidth-
|
||||
d.outerWidth()})):(za(),d.css({zIndex:c.isSliding?f.pane_sliding:f.pane_normal}),"south"==a?d.css({top:"auto"}):"east"==a&&!d.css("left").match(/\-99999/)&&d.css({left:"auto"}),G.msie&&(g.fxOpacityFix&&"slide"!=g.fxName_open&&d.css("filter")&&1==d.css("opacity"))&&d[0].style.removeAttribute("filter"))},ma=function(a,b){var d=r[a],c=F[a],g=d.slideTrigger_open.toLowerCase();if(c&&(!b||d.slidable)){g.match(/mouseover/)?g=d.slideTrigger_open="mouseenter":g.match(/(click|dblclick|mouseenter)/)||(g=d.slideTrigger_open=
|
||||
"click");if(d.resizerDblClickToggle&&g.match(/click/))c[b?"unbind":"bind"]("dblclick."+K,na);c[b?"bind":"unbind"](g+"."+K,sb).css("cursor",b?d.sliderCursor:"default").attr("title",b?d.tips.Slide:"")}},wa=function(a,b){function d(b){M.clear(a+"_closeSlider");b.stopPropagation()}var c=r[a],g=q[a],f=r.zIndexes,h=c.slideTrigger_close.toLowerCase(),j=b?"bind":"unbind",k=y[a],l=F[a];M.clear(a+"_closeSlider");b?(g.isSliding=!0,q.panesSliding[a]=!0,ma(a,!1)):(g.isSliding=!1,delete q.panesSliding[a]);k.css("zIndex",
|
||||
b?f.pane_sliding:f.pane_normal);l.css("zIndex",b?f.pane_sliding+2:f.resizer_normal);h.match(/(click|mouseleave)/)||(h=c.slideTrigger_close="mouseleave");l[j](h,Wa);"mouseleave"===h&&(k[j]("mouseleave."+K,Wa),l[j]("mouseenter."+K,d),k[j]("mouseenter."+K,d));b?"click"===h&&!c.resizable&&(l.css("cursor",b?c.sliderCursor:"default"),l.attr("title",b?c.tips.Close:"")):M.clear(a+"_closeSlider")},ha=function(a,d,c,f){d=r[a];var g=q[a],h=k[a],n=y[a],j=F[a],p="vert"===h.dir,l=!1;if("center"===a||p&&g.noVerticalRoom)(l=
|
||||
0<=g.maxHeight)&&g.noRoom?(rb(a),j&&j.show(),g.isVisible=!0,g.noRoom=!1,p&&(g.noVerticalRoom=!1),eb(a)):!l&&!g.noRoom&&(Ea(a),j&&j.hide(),g.isVisible=!1,g.noRoom=!0);"center"!==a&&(g.minSize<=g.maxSize?(g.size>g.maxSize?ka(a,g.maxSize,c,!0,f):g.size<g.minSize?ka(a,g.minSize,c,!0,f):j&&(g.isVisible&&n.is(":visible"))&&(c=g.size+v.inset[h.side],b.layout.cssNum(j,h.side)!=c&&j.css(h.side,c)),g.noRoom&&(g.wasOpen&&d.closable?d.autoReopen?ra(a,!1,!0,!0):g.noRoom=!1:Fa(a,g.wasOpen,!0,!0))):g.noRoom||(g.noRoom=
|
||||
!0,g.wasOpen=!g.isClosed&&!g.isSliding,g.isClosed||(d.closable?ja(a,!0,!0):Ta(a,!0))))},Ca=function(a,b,d,c,g){if(H()){a=A.call(this,a);var f=r[a],h=q[a];g=g||f.livePaneResizing&&!h.isResizing;h.autoResize=!1;ka(a,b,d,c,g)}},ka=function(e,c,f,h,g){function j(){for(var a="width"===ua?l.outerWidth():l.outerHeight(),a=[{pane:n,count:1,target:c,actual:a,correct:c===a,attempt:c,cssSize:D}],e=a[0],h={},t="Inaccurate size after resizing the "+n+"-pane.";!e.correct;){h={pane:n,count:e.count+1,target:c};h.attempt=
|
||||
e.actual>c?d(0,e.attempt-(e.actual-c)):d(0,e.attempt+(c-e.actual));h.cssSize=("horz"==k[n].dir?O:Q)(y[n],h.attempt);l.css(ua,h.cssSize);h.actual="width"==ua?l.outerWidth():l.outerHeight();h.correct=c===h.actual;1===a.length&&(ca(t,!1,!0),ca(e,!1,!0));ca(h,!1,!0);if(3<a.length)break;a.push(h);e=a[a.length-1]}J.size=c;b.extend(J,R(l));J.isVisible&&l.is(":visible")&&(x&&x.css(B,c+v.inset[B]),pa(n));!f&&(!Z&&q.initialized&&J.isVisible)&&C("onresize_end",n);f||(J.isSliding||ia("horz"==k[n].dir?"":"center",
|
||||
Z,g),qa());e=k.oppositeEdge[n];c<G&&q[e].noRoom&&(Y(e),ha(e,!1,f));1<a.length&&ca(t+"\nSee the Error Console for details.",!0,!0)}if(H()){var n=A.call(this,e),p=r[n],J=q[n],l=y[n],x=F[n],B=k[n].side,ua=k[n].sizeType.toLowerCase(),Z=J.isResizing&&!p.triggerEventsDuringLiveResize,z=!0!==h&&p.animatePaneSizing,G,D;u.queue(function(e){Y(n);G=J.size;c=fa(n,c);c=d(c,fa(n,p.minSize));c=a(c,J.maxSize);if(c<J.minSize)e(),ha(n,!1,f);else{if(!g&&c===G)return e();J.newSize=c;!f&&(q.initialized&&J.isVisible)&&
|
||||
C("onresize_start",n);D=("horz"==k[n].dir?O:Q)(y[n],c);if(z&&l.is(":visible")){var h=b.layout.effects.size[n]||b.layout.effects.size.all,h=p.fxSettings_size.easing||h.easing,v=r.zIndexes,u={};u[ua]=D+"px";J.isMoving=!0;l.css({zIndex:v.pane_animate}).show().animate(u,p.fxSpeed_size,h,function(){l.css({zIndex:J.isSliding?v.pane_sliding:v.pane_normal});J.isMoving=!1;delete J.newSize;j();e()})}else l.css(ua,D),delete J.newSize,l.is(":visible")?j():(J.size=c,b.extend(J,R(l))),e()}})}},ia=function(a,c,
|
||||
f){a=(a?a:"east,west,center").split(",");b.each(a,function(a,e){if(y[e]){var h=r[e],j=q[e],k=y[e],p=!0,l={},u=b.layout.showInvisibly(k),B={top:ga("north",!0),bottom:ga("south",!0),left:ga("west",!0),right:ga("east",!0),width:0,height:0};B.width=v.innerWidth-B.left-B.right;B.height=v.innerHeight-B.bottom-B.top;B.top+=v.inset.top;B.bottom+=v.inset.bottom;B.left+=v.inset.left;B.right+=v.inset.right;b.extend(j,R(k));if("center"===e){if(!f&&j.isVisible&&B.width===j.outerWidth&&B.height===j.outerHeight)return k.css(u),
|
||||
!0;b.extend(j,ya(e),{maxWidth:B.width,maxHeight:B.height});l=B;j.newWidth=l.width;j.newHeight=l.height;l.width=Q(k,l.width);l.height=O(k,l.height);p=0<=l.width&&0<=l.height;if(!q.initialized&&h.minWidth>B.width){var h=h.minWidth-j.outerWidth,B=r.east.minSize||0,x=r.west.minSize||0,Z=q.east.size,z=q.west.size,A=Z,D=z;0<h&&(q.east.isVisible&&Z>B)&&(A=d(Z-B,Z-h),h-=Z-A);0<h&&(q.west.isVisible&&z>x)&&(D=d(z-x,z-h),h-=z-D);if(0===h){Z&&Z!=B&&ka("east",A,!0,!0,f);z&&z!=x&&ka("west",D,!0,!0,f);ia("center",
|
||||
c,f);k.css(u);return}}}else{j.isVisible&&!j.noVerticalRoom&&b.extend(j,R(k),ya(e));if(!f&&!j.noVerticalRoom&&B.height===j.outerHeight)return k.css(u),!0;l.top=B.top;l.bottom=B.bottom;j.newSize=B.height;l.height=O(k,B.height);j.maxHeight=l.height;p=0<=j.maxHeight;p||(j.noVerticalRoom=!0)}p?(!c&&q.initialized&&C("onresize_start",e),k.css(l),"center"!==e&&qa(e),j.noRoom&&(!j.isClosed&&!j.isHidden)&&ha(e),j.isVisible&&(b.extend(j,R(k)),q.initialized&&pa(e))):!j.noRoom&&j.isVisible&&ha(e);k.css(u);delete j.newSize;
|
||||
delete j.newWidth;delete j.newHeight;if(!j.isVisible)return!0;"center"===e&&(j=G.isIE6||!G.boxModel,y.north&&(j||"IFRAME"==q.north.tagName)&&y.north.css("width",Q(y.north,v.innerWidth)),y.south&&(j||"IFRAME"==q.south.tagName)&&y.south.css("width",Q(y.south,v.innerWidth)));!c&&q.initialized&&C("onresize_end",e)}})},oa=function(a){A(a);if(u.is(":visible"))if(q.initialized){if(!0===a&&b.isPlainObject(r.outset)&&u.css(r.outset),b.extend(v,R(u,r.inset)),v.outerHeight){!0===a&&ob();if(!1===C("onresizeall_start"))return!1;
|
||||
var d,c,f;b.each(["south","north","east","west"],function(a,b){y[b]&&(c=r[b],f=q[b],f.autoResize&&f.size!=c.size?ka(b,c.size,!0,!0,!0):(Y(b),ha(b,!1,!0,!0)))});ia("",!0,!0);qa();b.each(k.allPanes,function(a,b){(d=y[b])&&q[b].isVisible&&C("onresize_end",b)});C("onresizeall_end")}}else Aa()},db=function(a,d){var c=A.call(this,a);r[c].resizeChildren&&(d||Ba(c),c=ba[c],b.isPlainObject(c)&&b.each(c,function(a,b){b.destroyed||b.resizeAll()}))},pa=function(a,c){if(H()){var h=A.call(this,a),h=h?h.split(","):
|
||||
k.allPanes;b.each(h,function(a,e){function h(a){return d(u.css.paddingBottom,parseInt(a.css("marginBottom"),10)||0)}function j(){var a=r[e].contentIgnoreSelector,a=p.nextAll().not(".ui-layout-mask").not(a||":lt(0)"),b=a.filter(":visible"),d=b.filter(":last");v={top:p[0].offsetTop,height:p.outerHeight(),numFooters:a.length,hiddenFooters:a.length-b.length,spaceBelow:0};v.spaceAbove=v.top;v.bottom=v.top+v.height;v.spaceBelow=d.length?d[0].offsetTop+d.outerHeight()-v.bottom+h(d):h(p)}var m=y[e],p=U[e],
|
||||
l=r[e],u=q[e],v=u.content;if(!m||!p||!m.is(":visible"))return!0;if(!p.length&&(Sa(e,!1),!p))return;if(!1!==C("onsizecontent_start",e)){if(!u.isMoving&&!u.isResizing||l.liveContentResizing||c||void 0==v.top)j(),0<v.hiddenFooters&&"hidden"===m.css("overflow")&&(m.css("overflow","visible"),j(),m.css("overflow","hidden"));m=u.innerHeight-(v.spaceAbove-u.css.paddingTop)-(v.spaceBelow-u.css.paddingBottom);if(!p.is(":visible")||v.height!=m){var x=p,l=x;f(x)?l=y[x]:x.jquery||(l=b(x));x=O(l,m);l.css({height:x,
|
||||
visibility:"visible"});0<x&&0<l.innerWidth()?l.data("autoHidden")&&(l.show().data("autoHidden",!1),G.mozilla||l.css(k.hidden).css(k.visible)):l.data("autoHidden")||l.hide().data("autoHidden",!0);v.height=m}q.initialized&&C("onsizecontent_end",e)}})}},qa=function(a){a=(a=A.call(this,a))?a.split(","):k.borderPanes;b.each(a,function(a,d){var e=r[d],g=q[d],h=y[d],j=F[d],p=P[d],u;if(h&&j){var l=k[d].dir,x=g.isClosed?"_closed":"_open",B=e["spacing"+x],z=e["togglerAlign"+x],x=e["togglerLength"+x],A;if(0===
|
||||
B)j.hide();else{!g.noRoom&&!g.isHidden&&j.show();"horz"===l?(A=v.innerWidth,g.resizerLength=A,h=b.layout.cssNum(h,"left"),j.css({width:Q(j,A),height:O(j,B),left:-9999<h?h:v.inset.left})):(A=h.outerHeight(),g.resizerLength=A,j.css({height:O(j,A),width:Q(j,B),top:v.inset.top+ga("north",!0)}));da(e,j);if(p){if(0===x||g.isSliding&&e.hideTogglerOnSlide){p.hide();return}p.show();if(!(0<x)||"100%"===x||x>A)x=A,z=0;else if(f(z))switch(z){case "top":case "left":z=0;break;case "bottom":case "right":z=A-x;break;
|
||||
default:z=c((A-x)/2)}else h=parseInt(z,10),z=0<=z?h:A-x+h;if("horz"===l){var D=Q(p,x);p.css({width:D,height:O(p,B),left:z,top:0});p.children(".content").each(function(){u=b(this);u.css("marginLeft",c((D-u.outerWidth())/2))})}else{var C=O(p,x);p.css({height:C,width:Q(p,B),top:z,left:0});p.children(".content").each(function(){u=b(this);u.css("marginTop",c((C-u.outerHeight())/2))})}da(0,p)}if(!q.initialized&&(e.initHidden||g.isHidden))j.hide(),p&&p.hide()}}})},pb=function(a){if(H()){var b=A.call(this,
|
||||
a);a=P[b];var d=r[b];a&&(d.closable=!0,a.bind("click."+K,function(a){a.stopPropagation();na(b)}).css("visibility","visible").css("cursor","pointer").attr("title",q[b].isClosed?d.tips.Open:d.tips.Close).show())}},Va=function(a,d){b.layout.plugins.buttons&&b.each(q[a].pins,function(c,f){b.layout.buttons.setPinState(z,b(f),a,d)})},u=b(this).eq(0);if(!u.length)return ca(r.errors.containerMissing);if(u.data("layoutContainer")&&u.data("layout"))return u.data("layout");var y={},U={},F={},P={},ea=b([]),v=
|
||||
q.container,K=q.id,z={options:r,state:q,container:u,panes:y,contents:U,resizers:F,togglers:P,hide:Ta,show:Fa,toggle:na,open:ra,close:ja,slideOpen:sb,slideClose:Wa,slideToggle:function(a){a=A.call(this,a);na(a,!0)},setSizeLimits:Y,_sizePane:ka,sizePane:Ca,sizeContent:pa,swapPanes:function(a,c){function f(a){var d=y[a],c=U[a];return!d?!1:{pane:a,P:d?d[0]:!1,C:c?c[0]:!1,state:b.extend(!0,{},q[a]),options:b.extend(!0,{},r[a])}}function h(a,c){if(a){var e=a.P,f=a.C,g=a.pane,j=k[c],m=b.extend(!0,{},q[c]),
|
||||
n=r[c],w={resizerCursor:n.resizerCursor};b.each(["fxName","fxSpeed","fxSettings"],function(a,b){w[b+"_open"]=n[b+"_open"];w[b+"_close"]=n[b+"_close"];w[b+"_size"]=n[b+"_size"]});y[c]=b(e).data({layoutPane:z[c],layoutEdge:c}).css(k.hidden).css(j.cssReq);U[c]=f?b(f):!1;r[c]=b.extend(!0,{},a.options,w);q[c]=b.extend(!0,{},a.state);e.className=e.className.replace(RegExp(n.paneClass+"-"+g,"g"),n.paneClass+"-"+c);Pa(c);j.dir!=k[g].dir?(e=p[c]||0,Y(c),e=d(e,q[c].minSize),Ca(c,e,!0,!0)):F[c].css(j.side,v.inset[j.side]+
|
||||
(q[c].isVisible?ga(c):0));a.state.isVisible&&!m.isVisible?Ua(c,!0):(Da(c),ma(c,!0));a=null}}if(H()){var g=A.call(this,a);q[g].edge=c;q[c].edge=g;if(!1===C("onswap_start",g)||!1===C("onswap_start",c))q[g].edge=g,q[c].edge=c;else{var j=f(g),n=f(c),p={};p[g]=j?j.state.size:0;p[c]=n?n.state.size:0;y[g]=!1;y[c]=!1;q[g]={};q[c]={};P[g]&&P[g].remove();P[c]&&P[c].remove();F[g]&&F[g].remove();F[c]&&F[c].remove();F[g]=F[c]=P[g]=P[c]=!1;h(j,c);h(n,g);j=n=p=null;y[g]&&y[g].css(k.visible);y[c]&&y[c].css(k.visible);
|
||||
oa();C("onswap_end",g);C("onswap_end",c)}}},showMasks:va,hideMasks:za,initContent:Sa,addPane:ib,removePane:Ra,createChildren:Qa,refreshChildren:Ba,enableClosable:pb,disableClosable:function(a,b){if(H()){var c=A.call(this,a),d=P[c];d&&(r[c].closable=!1,q[c].isClosed&&ra(c,!1,!0),d.unbind("."+K).css("visibility",b?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].slidable=!0,q[a].isClosed&&ma(a,
|
||||
!0))}},disableSlidable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&(r[a].slidable=!1,q[a].isSliding?ja(a,!1,!0):(ma(a,!1),b.css("cursor","default").attr("title",""),da(null,b[0])))}},enableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a],c=r[a];b&&b.data("draggable")&&(c.resizable=!0,b.draggable("enable"),q[a].isClosed||b.css("cursor",c.resizerCursor).attr("title",c.tips.Resize))}},disableResizable:function(a){if(H()){a=A.call(this,a);var b=F[a];b&&b.data("draggable")&&(r[a].resizable=
|
||||
!1,b.draggable("disable").css("cursor","default").attr("title",""),da(null,b[0]))}},allowOverflow:x,resetOverflow:X,destroy:function(a,c){b(window).unbind("."+K);b(document).unbind("."+K);"object"===typeof a?A(a):c=a;u.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(r.containerClass).unbind("."+K);ea.remove();b.each(k.allPanes,function(a,b){Ra(b,!1,!0,c)});u.data("layoutCSS")&&!u.data("layoutRole")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");"BODY"===v.tagName&&
|
||||
(u=b("html")).data("layoutCSS")&&u.css(u.data("layoutCSS")).removeData("layoutCSS");j(z,b.layout.onDestroy);mb();for(var d in z)d.match(/^(container|options)$/)||delete z[d];z.destroyed=!0;return z},initPanes:H,resizeAll:oa,runCallbacks:C,hasParentLayout:!1,children:ba,north:!1,south:!1,west:!1,east:!1,center:!1},Xa;var V,Ya,N,Ha,la,sa,W;h=b.layout.transformData(h,!0);h=b.layout.backwardCompatibility.renameAllOptions(h);if(!b.isEmptyObject(h.panes)){V=b.layout.optionsMap.noDefault;la=0;for(sa=V.length;la<
|
||||
sa;la++)N=V[la],delete h.panes[N];V=b.layout.optionsMap.layout;la=0;for(sa=V.length;la<sa;la++)N=V[la],delete h.panes[N]}V=b.layout.optionsMap.layout;var Bb=b.layout.config.optionRootKeys;for(N in h)Ha=h[N],0>b.inArray(N,Bb)&&0>b.inArray(N,V)&&(h.panes[N]||(h.panes[N]=b.isPlainObject(Ha)?b.extend(!0,{},Ha):Ha),delete h[N]);b.extend(!0,r,h);b.each(k.allPanes,function(a,c){k[c]=b.extend(!0,{},k.panes,k[c]);Ya=r.panes;W=r[c];if("center"===c){V=b.layout.optionsMap.center;a=0;for(sa=V.length;a<sa;a++)if(N=
|
||||
V[a],!h.center[N]&&(h.panes[N]||!W[N]))W[N]=Ya[N]}else{W=r[c]=b.extend(!0,{},Ya,W);var d=r[c],f=r.panes;d.fxSettings||(d.fxSettings={});f.fxSettings||(f.fxSettings={});b.each(["_open","_close","_size"],function(a,e){var h="fxName"+e,j="fxSpeed"+e,k="fxSettings"+e,l=d[h]=d[h]||f[h]||d.fxName||f.fxName||"none",p=b.effects&&(b.effects[l]||b.effects.effect&&b.effects.effect[l]);if("none"===l||!r.effects[l]||!p)l=d[h]="none";l=r.effects[l]||{};h=l.all||null;l=l[c]||null;d[j]=d[j]||f[j]||d.fxSpeed||f.fxSpeed||
|
||||
null;d[k]=b.extend(!0,{},h,l,f.fxSettings,d.fxSettings,f[k],d[k])});delete d.fxName;delete d.fxSpeed;delete d.fxSettings;W.resizerClass||(W.resizerClass="ui-layout-resizer");W.togglerClass||(W.togglerClass="ui-layout-toggler")}W.paneClass||(W.paneClass="ui-layout-pane")});var Ia=h.zIndex,xa=r.zIndexes;0<Ia&&(xa.pane_normal=Ia,xa.content_mask=d(Ia+1,xa.content_mask),xa.resizer_normal=d(Ia+2,xa.resizer_normal));delete r.panes;var Cb=r,tb=q;tb.creatingLayout=!0;j(z,b.layout.onCreate);if(!1===C("onload_start"))Xa=
|
||||
"cancel";else{var Za=u[0],$=b("html"),ub=v.tagName=Za.tagName,vb=v.id=Za.id,wb=v.className=Za.className,L=r,Ja=L.name,$a={},Ka=u.data("parentLayout"),La=u.data("layoutEdge"),ab=Ka&&La,ta=b.layout.cssNum,bb,aa;v.selector=u.selector.split(".slice")[0];v.ref=(L.name?L.name+" layout / ":"")+ub+(vb?"#"+vb:wb?".["+wb+"]":"");v.isBody="BODY"===ub;!ab&&!v.isBody&&(bb=u.closest("."+b.layout.defaults.panes.paneClass),Ka=bb.data("parentLayout"),La=bb.data("layoutEdge"),ab=Ka&&La);u.data({layout:z,layoutContainer:K}).addClass(L.containerClass);
|
||||
var xb={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(Ja in xb)u.bind("layout"+Ja.toLowerCase()+"."+K,z[xb[Ja]||Ja]);ab&&(z.hasParentLayout=!0,Ka.refreshChildren(La,z));u.data("layoutCSS")||(v.isBody?(u.data("layoutCSS",b.extend(D(u,"position,margin,padding,border"),{height:u.css("height"),overflow:u.css("overflow"),overflowX:u.css("overflowX"),overflowY:u.css("overflowY")})),$.data("layoutCSS",b.extend(D($,"padding"),{height:"auto",overflow:$.css("overflow"),overflowX:$.css("overflowX"),
|
||||
overflowY:$.css("overflowY")}))):u.data("layoutCSS",D(u,"position,margin,padding,border,top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{$a={overflow:"hidden",overflowX:"hidden",overflowY:"hidden"};u.css($a);L.inset&&!b.isPlainObject(L.inset)&&(aa=parseInt(L.inset,10)||0,L.inset={top:aa,bottom:aa,left:aa,right:aa});if(v.isBody)L.outset?b.isPlainObject(L.outset)||(aa=parseInt(L.outset,10)||0,L.outset={top:aa,bottom:aa,left:aa,right:aa}):L.outset={top:ta($,"paddingTop"),bottom:ta($,
|
||||
"paddingBottom"),left:ta($,"paddingLeft"),right:ta($,"paddingRight")},$.css($a).css({height:"100%",border:"none",padding:0,margin:0}),G.isIE6?(u.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),L.inset||(L.inset=R(u).inset)):(u.css({width:"auto",height:"auto",margin:0,position:"absolute"}),u.css(L.outset)),b.extend(v,R(u,L.inset));else{var yb=u.css("position");(!yb||!yb.match(/(fixed|absolute|relative)/))&&u.css("position","relative");u.is(":visible")&&(b.extend(v,
|
||||
R(u,L.inset)),1>v.innerHeight&&ca(L.errors.noContainerHeight.replace(/CONTAINER/,v.ref)))}ta(u,"minWidth")&&u.parent().css("overflowX","auto");ta(u,"minHeight")&&u.parent().css("overflowY","auto")}catch(Db){}nb();b(window).bind("unload."+K,mb);j(z,b.layout.onLoad);Cb.initPanes&&Aa();delete tb.creatingLayout;Xa=q.initialized}return"cancel"===Xa?null:z}})(jQuery);
|
||||
(function(b){b.ui||(b.ui={});b.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(a){for(var d=document.cookie,d=d?d.split(";"):[],c,f=0,j=d.length;f<j;f++)if(c=b.trim(d[f]).split("="),c[0]==a)return decodeURIComponent(c[1]);return null},write:function(a,d,c){var f="",j="",h=!1;c=c||{};var p=c.expires||null,x=b.type(p);"date"===x?j=p:"string"===x&&0<p&&(p=parseInt(p,10),x="number");"number"===x&&(j=new Date,0<p?j.setDate(j.getDate()+p):(j.setFullYear(1970),h=!0));j&&(f+=";expires="+
|
||||
j.toUTCString());c.path&&(f+=";path="+c.path);c.domain&&(f+=";domain="+c.domain);c.secure&&(f+=";secure");document.cookie=a+"="+(h?"":encodeURIComponent(d))+f},clear:function(a){b.ui.cookie.write(a,"",{expires:-1})}};b.cookie||(b.cookie=function(a,d,c){var f=b.ui.cookie;if(null===d)f.clear(a);else{if(void 0===d)return f.read(a);f.write(a,d,c)}});b.layout.plugins.stateManagement=!0;b.layout.config.optionRootKeys.push("stateManagement");b.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,
|
||||
animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}};b.layout.optionsMap.layout.push("stateManagement");b.layout.state={saveCookie:function(a,d,c){var f=a.options,j=f.stateManagement;c=b.extend(!0,{},j.cookie,c||null);a=a.state.stateData=a.readState(d||j.stateKeys);b.ui.cookie.write(c.name||f.name||
|
||||
"Layout",b.layout.state.encodeJSON(a),c);return b.extend(!0,{},a)},deleteCookie:function(a){a=a.options;b.ui.cookie.clear(a.stateManagement.cookie.name||a.name||"Layout")},readCookie:function(a){a=a.options;return(a=b.ui.cookie.read(a.stateManagement.cookie.name||a.name||"Layout"))?b.layout.state.decodeJSON(a):{}},loadCookie:function(a){var d=b.layout.state.readCookie(a);d&&(a.state.stateData=b.extend(!0,{},d),a.loadState(d));return d},loadState:function(a,d,c){if(b.isPlainObject(d)&&!b.isEmptyObject(d))if(d=
|
||||
a.state.stateData=b.layout.transformData(d),c=b.extend({animateLoad:!1,includeChildren:a.options.stateManagement.includeChildren},c),a.state.initialized){var f=!c.animateLoad,j,h,p,x;b.each(b.layout.config.borderPanes,function(c,G){S=d[G];b.isPlainObject(S)&&(s=S.size,j=S.initClosed,h=S.initHidden,ar=S.autoResize,p=a.state[G],x=p.isVisible,ar&&(p.autoResize=ar),x||a._sizePane(G,s,!1,!1,!1),!0===h?a.hide(G,f):!0===j?a.close(G,!1,f):!1===j?a.open(G,!1,f):!1===h&&a.show(G,!1,f),x&&a._sizePane(G,s,!1,
|
||||
!1,f))});if(c.includeChildren){var I,T;b.each(a.children,function(a,c){(I=d[a]?d[a].children:0)&&c&&b.each(c,function(a,b){T=I[a];b&&T&&b.loadState(T)})})}}else{var S=b.extend(!0,{},d);b.each(b.layout.config.allPanes,function(a,b){S[b]&&delete S[b].children});b.extend(!0,a.options,S)}},readState:function(a,d){"string"===b.type(d)&&(d={keys:d});d||(d={});var c=a.options.stateManagement,f=d.includeChildren,f=void 0!==f?f:c.includeChildren,c=d.stateKeys||c.stateKeys,j={isClosed:"initClosed",isHidden:"initHidden"},
|
||||
h=a.state,p=b.layout.config.allPanes,x={},I,T,S,X,G,k;b.isArray(c)&&(c=c.join(","));for(var c=c.replace(/__/g,".").split(","),Q=0,O=c.length;Q<O;Q++)I=c[Q].split("."),T=I[0],I=I[1],0>b.inArray(T,p)||(S=h[T][I],void 0!=S&&("isClosed"==I&&h[T].isSliding&&(S=!0),(x[T]||(x[T]={}))[j[I]?j[I]:I]=S));f&&b.each(p,function(c,d){G=a.children[d];X=h.stateData[d];b.isPlainObject(G)&&!b.isEmptyObject(G)&&(k=x[d]||(x[d]={}),k.children||(k.children={}),b.each(G,function(a,c){c.state.initialized?k.children[a]=b.layout.state.readState(c):
|
||||
X&&(X.children&&X.children[a])&&(k.children[a]=b.extend(!0,{},X.children[a]))}))});return x},encodeJSON:function(a){function d(a){var f=[],j=0,h,p,x,I=b.isArray(a);for(h in a)p=a[h],x=typeof p,"string"==x?p='"'+p+'"':"object"==x&&(p=d(p)),f[j++]=(!I?'"'+h+'":':"")+p;return(I?"[":"{")+f.join(",")+(I?"]":"}")}return d(a)},decodeJSON:function(a){try{return b.parseJSON?b.parseJSON(a):window.eval("("+a+")")||{}}catch(d){return{}}},_create:function(a){var d=b.layout.state,c=a.options.stateManagement;b.extend(a,
|
||||
{readCookie:function(){return d.readCookie(a)},deleteCookie:function(){d.deleteCookie(a)},saveCookie:function(b,c){return d.saveCookie(a,b,c)},loadCookie:function(){return d.loadCookie(a)},loadState:function(b,c){d.loadState(a,b,c)},readState:function(b){return d.readState(a,b)},encodeJSON:d.encodeJSON,decodeJSON:d.decodeJSON});a.state.stateData={};if(c.autoLoad)if(b.isPlainObject(c.autoLoad))b.isEmptyObject(c.autoLoad)||a.loadState(c.autoLoad);else if(c.enabled)if(b.isFunction(c.autoLoad)){var f=
|
||||
{};try{f=c.autoLoad(a,a.state,a.options,a.options.name||"")}catch(j){}f&&(b.isPlainObject(f)&&!b.isEmptyObject(f))&&a.loadState(f)}else a.loadCookie()},_unload:function(a){var d=a.options.stateManagement;if(d.enabled&&d.autoSave)if(b.isFunction(d.autoSave))try{d.autoSave(a,a.state,a.options,a.options.name||"")}catch(c){}else a.saveCookie()}};b.layout.onCreate.push(b.layout.state._create);b.layout.onUnload.push(b.layout.state._unload);b.layout.plugins.buttons=!0;b.layout.defaults.autoBindCustomButtons=
|
||||
!1;b.layout.optionsMap.layout.push("autoBindCustomButtons");b.layout.buttons={init:function(a){var d=a.options.name||"",c;b.each("toggle open close pin toggle-slide open-slide".split(" "),function(f,j){b.each(b.layout.config.borderPanes,function(f,p){b(".ui-layout-button-"+j+"-"+p).each(function(){c=b(this).data("layoutName")||b(this).attr("layoutName");(void 0==c||c===d)&&a.bindButton(this,j,p)})})})},get:function(a,d,c,f){var j=b(d);a=a.options;var h=a.errors.addButtonError;j.length?0>b.inArray(c,
|
||||
b.layout.config.borderPanes)?(b.layout.msg(h+" "+a.errors.pane+": "+c,!0),j=b("")):(d=a[c].buttonClass+"-"+f,j.addClass(d+" "+d+"-"+c).data("layoutName",a.name)):b.layout.msg(h+" "+a.errors.selector+": "+d,!0);return j},bind:function(a,d,c,f){var j=b.layout.buttons;switch(c.toLowerCase()){case "toggle":j.addToggle(a,d,f);break;case "open":j.addOpen(a,d,f);break;case "close":j.addClose(a,d,f);break;case "pin":j.addPin(a,d,f);break;case "toggle-slide":j.addToggle(a,d,f,!0);break;case "open-slide":j.addOpen(a,
|
||||
d,f,!0)}return a},addToggle:function(a,d,c,f){b.layout.buttons.get(a,d,c,"toggle").click(function(b){a.toggle(c,!!f);b.stopPropagation()});return a},addOpen:function(a,d,c,f){b.layout.buttons.get(a,d,c,"open").attr("title",a.options[c].tips.Open).click(function(b){a.open(c,!!f);b.stopPropagation()});return a},addClose:function(a,d,c){b.layout.buttons.get(a,d,c,"close").attr("title",a.options[c].tips.Close).click(function(b){a.close(c);b.stopPropagation()});return a},addPin:function(a,d,c){var f=b.layout.buttons,
|
||||
j=f.get(a,d,c,"pin");if(j.length){var h=a.state[c];j.click(function(d){f.setPinState(a,b(this),c,h.isSliding||h.isClosed);h.isSliding||h.isClosed?a.open(c):a.close(c);d.stopPropagation()});f.setPinState(a,j,c,!h.isClosed&&!h.isSliding);h.pins.push(d)}return a},setPinState:function(a,b,c,f){var j=b.attr("pin");if(!(j&&f===("down"==j))){a=a.options[c];var j=a.buttonClass+"-pin",h=j+"-"+c;c=j+"-up "+h+"-up";j=j+"-down "+h+"-down";b.attr("pin",f?"down":"up").attr("title",f?a.tips.Unpin:a.tips.Pin).removeClass(f?
|
||||
c:j).addClass(f?j:c)}},syncPinBtns:function(a,d,c){b.each(a.state[d].pins,function(f,j){b.layout.buttons.setPinState(a,b(j),d,c)})},_load:function(a){var d=b.layout.buttons;b.extend(a,{bindButton:function(b,c,h){return d.bind(a,b,c,h)},addToggleBtn:function(b,c,h){return d.addToggle(a,b,c,h)},addOpenBtn:function(b,c,h){return d.addOpen(a,b,c,h)},addCloseBtn:function(b,c){return d.addClose(a,b,c)},addPinBtn:function(b,c){return d.addPin(a,b,c)}});for(var c=0;4>c;c++)a.state[b.layout.config.borderPanes[c]].pins=
|
||||
[];a.options.autoBindCustomButtons&&d.init(a)},_unload:function(){}};b.layout.onLoad.push(b.layout.buttons._load);b.layout.plugins.browserZoom=!0;b.layout.defaults.browserZoomCheckInterval=1E3;b.layout.optionsMap.layout.push("browserZoomCheckInterval");b.layout.browserZoom={_init:function(a){!1!==b.layout.browserZoom.ratio()&&b.layout.browserZoom._setTimer(a)},_setTimer:function(a){if(!a.destroyed){var d=a.options,c=a.state,f=a.hasParentLayout?5E3:Math.max(d.browserZoomCheckInterval,100);setTimeout(function(){if(!a.destroyed&&
|
||||
d.resizeWithWindow){var f=b.layout.browserZoom.ratio();f!==c.browserZoom&&(c.browserZoom=f,a.resizeAll());b.layout.browserZoom._setTimer(a)}},f)}},ratio:function(){function a(a,b){return(100*(parseInt(a,10)/parseInt(b,10))).toFixed()}var d=window,c=screen,f=document,j=f.documentElement||f.body,h=b.layout.browser,p=h.version,x,I,T;return h.msie&&8<p||!h.msie?!1:c.deviceXDPI&&c.systemXDPI?a(c.deviceXDPI,c.systemXDPI):h.webkit&&(x=f.body.getBoundingClientRect)?a(x.left-x.right,f.body.offsetWidth):h.webkit&&
|
||||
(I=d.outerWidth)?a(I,d.innerWidth):(I=c.width)&&(T=j.clientWidth)?a(I,T):!1}};b.layout.onReady.push(b.layout.browserZoom._init)})(jQuery);
|
6
shlr/www/enyo/vendors/jquery.min.js
vendored
Executable file
7
shlr/www/enyo/vendors/jquery.scrollTo.min.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* @author Ariel Flesler
|
||||
* @version 2.1.2
|
||||
*/
|
||||
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});
|
98
shlr/www/enyo/vendors/lodash.min.js
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 3.10.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
* Build: `lodash modern -o ./lodash.js`
|
||||
*/
|
||||
;(function(){function n(n,t){if(n!==t){var r=null===n,e=n===w,u=n===n,o=null===t,i=t===w,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(n<t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return null==n?"":n+""}function o(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););
|
||||
return r}function i(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function f(t,r){return n(t.a,r.a)||t.b-r.b}function a(n){return Nn[n]}function c(n){return Tn[n]}function l(n,t,r){return t?n=Bn[n]:r&&(n=Dn[n]),"\\"+n}function s(n){return"\\"+Dn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);
|
||||
}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=z,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Ln[n]}function m(_){function Nn(n){if(h(n)&&!(Oo(n)||n instanceof zn)){if(n instanceof Ln)return n;if(nu.call(n,"__chain__")&&nu.call(n,"__wrapped__"))return Mr(n)}return new Ln(n)}function Tn(){}function Ln(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
|
||||
this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=Ru,this.__views__=[]}function Bn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:gu(null),set:new lu};t--;)this.push(n[t])}function Mn(n,t){var r=n.data;return(typeof t=="string"||ge(t)?r.set.has(t):r.hash[t])?0:-1}function qn(n,t){var r=-1,e=n.length;for(t||(t=Be(e));++r<e;)t[r]=n[r];return t}function Pn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
|
||||
return n}function Kn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Vn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Gn(n,t){for(var r=-1,e=n.length,u=Be(e);++r<e;)u[r]=t(n[r],r,n);return u}function Jn(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Xn(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function Hn(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;
|
||||
return false}function Qn(n,t,r,e){return n!==w&&nu.call(e,r)?n:t}function nt(n,t,r){for(var e=-1,u=zo(t),o=u.length;++e<o;){var i=u[e],f=n[i],a=r(f,t[i],i,n,t);(a===a?a===f:f!==f)&&(f!==w||i in n)||(n[i]=a)}return n}function tt(n,t){return null==t?n:et(t,zo(t),n)}function rt(n,t){for(var r=-1,e=null==n,u=!e&&Er(n),o=u?n.length:0,i=t.length,f=Be(i);++r<i;){var a=t[r];f[r]=u?Cr(a,o)?n[a]:w:e?w:n[a]}return f}function et(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function ut(n,t,r){
|
||||
var e=typeof n;return"function"==e?t===w?n:Bt(n,t,r):null==n?Fe:"object"==e?bt(n):t===w?ze(n):xt(n,t)}function ot(n,t,r,e,u,o,i){var f;if(r&&(f=u?r(n,e,u):r(n)),f!==w)return f;if(!ge(n))return n;if(e=Oo(n)){if(f=kr(n),!t)return qn(n,f)}else{var a=ru.call(n),c=a==K;if(a!=Z&&a!=B&&(!c||u))return Fn[a]?Rr(n,a,t):u?n:{};if(f=Ir(c?{}:n),!t)return tt(f,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?Pn:_t)(n,function(e,u){f[u]=ot(e,t,r,u,n,o,i)}),f}function it(n,t,r){
|
||||
if(typeof n!="function")throw new Ge(L);return su(function(){n.apply(w,r)},t)}function ft(n,t){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=xr(),f=i===r,a=f&&t.length>=F&&gu&&lu?new Dn(t):null,c=t.length;a&&(i=Mn,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function at(n,t){var r=true;return Su(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ct(n,t,r,e){var u=e,o=u;return Su(n,function(n,i,f){i=+t(n,i,f),(r(i,u)||i===e&&i===o)&&(u=i,
|
||||
o=n)}),o}function lt(n,t){var r=[];return Su(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function st(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function pt(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];h(i)&&Er(i)&&(r||Oo(i)||pe(i))?t?pt(i,t,r,e):Jn(e,i):r||(e[e.length]=i)}return e}function ht(n,t){Nu(n,t,Re)}function _t(n,t){return Nu(n,t,zo)}function vt(n,t){return Tu(n,t,zo)}function gt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];
|
||||
ve(n[i])&&(o[++u]=i)}return o}function yt(n,t,r){if(null!=n){r!==w&&r in Br(n)&&(t=[r]),r=0;for(var e=t.length;null!=n&&r<e;)n=n[t[r++]];return r&&r==e?n:w}}function dt(n,t,r,e,u,o){if(n===t)n=true;else if(null==n||null==t||!ge(n)&&!h(t))n=n!==n&&t!==t;else n:{var i=dt,f=Oo(n),a=Oo(t),c=D,l=D;f||(c=ru.call(n),c==B?c=Z:c!=Z&&(f=xe(n))),a||(l=ru.call(t),l==B?l=Z:l!=Z&&xe(t));var s=c==Z,a=l==Z,l=c==l;if(!l||f||s){if(!e&&(c=s&&nu.call(n,"__wrapped__"),a=a&&nu.call(t,"__wrapped__"),c||a)){n=i(c?n.value():n,a?t.value():t,r,e,u,o);
|
||||
break n}if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(f?yr:mr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=dr(n,t,c)}return n}function mt(n,t,r){var e=t.length,u=e,o=!r;if(null==n)return!u;for(n=Br(n);e--;){var i=t[e];if(o&&i[2]?i[1]!==n[i[0]]:!(i[0]in n))return false}for(;++e<u;){var i=t[e],f=i[0],a=n[f],c=i[1];if(o&&i[2]){if(a===w&&!(f in n))return false}else if(i=r?r(a,c,f):w,i===w?!dt(c,a,r,true):!i)return false}return true}function wt(n,t){var r=-1,e=Er(n)?Be(n.length):[];
|
||||
return Su(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function bt(n){var t=Ar(n);if(1==t.length&&t[0][2]){var r=t[0][0],e=t[0][1];return function(n){return null==n?false:n[r]===e&&(e!==w||r in Br(n))}}return function(n){return mt(n,t)}}function xt(n,t){var r=Oo(n),e=Wr(n)&&t===t&&!ge(t),u=n+"";return n=Dr(n),function(o){if(null==o)return false;var i=u;if(o=Br(o),!(!r&&e||i in o)){if(o=1==n.length?o:yt(o,Et(n,0,-1)),null==o)return false;i=Zr(n),o=Br(o)}return o[i]===t?t!==w||i in o:dt(t,o[i],w,true)}}function At(n,t,r,e,u){
|
||||
if(!ge(n))return n;var o=Er(t)&&(Oo(t)||xe(t)),i=o?w:zo(t);return Pn(i||t,function(f,a){if(i&&(a=f,f=t[a]),h(f)){e||(e=[]),u||(u=[]);n:{for(var c=a,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Er(_)&&(Oo(_)||xe(_))?v=Oo(p)?p:Er(p)?qn(p):[]:me(_)||pe(_)?v=pe(p)?ke(p):me(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=At(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[a],l=r?r(c,f,a,n,t):w,(s=l===w)&&(l=f),l===w&&(!o||a in n)||!s&&(l===l?l===c:c!==c)||(n[a]=l);
|
||||
}),n}function jt(n){return function(t){return null==t?w:t[n]}}function kt(n){var t=n+"";return n=Dr(n),function(r){return yt(r,n,t)}}function It(n,t){for(var r=n?t.length:0;r--;){var e=t[r];if(e!=u&&Cr(e)){var u=e;pu.call(n,e,1)}}}function Rt(n,t){return n+yu(ku()*(t-n+1))}function Ot(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function Et(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=r===w||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Be(u);++e<u;)r[e]=n[e+t];
|
||||
return r}function Ct(n,t){var r;return Su(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Ut(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function Wt(t,r,e){var u=wr(),o=-1;return r=Gn(r,function(n){return u(n)}),t=wt(t,function(n){return{a:Gn(r,function(t){return t(n)}),b:++o,c:n}}),Ut(t,function(t,r){var u;n:{for(var o=-1,i=t.a,f=r.a,a=i.length,c=e.length;++o<a;)if(u=n(i[o],f[o])){if(o>=c)break n;o=e[o],u*="asc"===o||true===o?1:-1;break n}u=t.b-r.b}return u})}function $t(n,t){
|
||||
var r=0;return Su(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function St(n,t){var e=-1,u=xr(),o=n.length,i=u===r,f=i&&o>=F,a=f&&gu&&lu?new Dn(void 0):null,c=[];a?(u=Mn,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Ft(n,t){for(var r=-1,e=t.length,u=Be(e);++r<e;)u[r]=n[t[r]];return u}function Nt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););
|
||||
return r?Et(n,e?0:o,e?o+1:u):Et(n,e?o+1:0,e?u:o)}function Tt(n,t){var r=n;r instanceof zn&&(r=r.value());for(var e=-1,u=t.length;++e<u;)var o=t[e],r=o.func.apply(o.thisArg,Jn([r],o.args));return r}function Lt(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=Eu){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)&&null!==i?e=o+1:u=o}return u}return zt(n,t,Fe,r)}function zt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,a=t===w;u<o;){var c=yu((u+o)/2),l=r(n[c]),s=l!==w,p=l===l;
|
||||
(i?p||e:f?p&&s&&(e||null!=l):a?p&&(e||s):null==l?0:e?l<=t:l<t)?u=c+1:o=c}return xu(o,Ou)}function Bt(n,t,r){if(typeof n!="function")return Fe;if(t===w)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Dt(n){var t=new ou(n.byteLength);return new hu(t).set(new hu(n)),
|
||||
t}function Mt(n,t,r){for(var e=r.length,u=-1,o=bu(n.length-e,0),i=-1,f=t.length,a=Be(f+o);++i<f;)a[i]=t[i];for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];return a}function qt(n,t,r){for(var e=-1,u=r.length,o=-1,i=bu(n.length-u,0),f=-1,a=t.length,c=Be(i+a);++o<i;)c[o]=n[o];for(i=o;++f<a;)c[i+f]=t[f];for(;++e<u;)c[i+r[e]]=n[o++];return c}function Pt(n,t){return function(r,e,u){var o=t?t():{};if(e=wr(e,u,3),Oo(r)){u=-1;for(var i=r.length;++u<i;){var f=r[u];n(o,f,e(f,u,r),r)}}else Su(r,function(t,r,u){
|
||||
n(o,t,e(t,r,u),u)});return o}}function Kt(n){return le(function(t,r){var e=-1,u=null==t?0:r.length,o=2<u?r[u-2]:w,i=2<u?r[2]:w,f=1<u?r[u-1]:w;for(typeof o=="function"?(o=Bt(o,f,5),u-=2):(o=typeof f=="function"?f:w,u-=o?1:0),i&&Ur(r[0],r[1],i)&&(o=3>u?w:o,u=1);++e<u;)(i=r[e])&&n(t,i,o);return t})}function Vt(n,t){return function(r,e){var u=r?Bu(r):0;if(!Sr(u))return n(r,e);for(var o=t?u:-1,i=Br(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}function Zt(n){return function(t,r,e){var u=Br(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){
|
||||
var f=e[i];if(false===r(u[f],f,u))break}return t}}function Yt(n,t){function r(){return(this&&this!==Zn&&this instanceof r?e:n).apply(t,arguments)}var e=Jt(n);return r}function Gt(n){return function(t){var r=-1;t=$e(Ce(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function Jt(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:
|
||||
return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=$u(n.prototype),t=n.apply(r,t);return ge(t)?t:r}}function Xt(n){function t(r,e,u){return u&&Ur(r,e,u)&&(e=w),r=gr(r,n,w,w,w,w,w,e),r.placeholder=t.placeholder,r}return t}function Ht(n,t){return le(function(r){var e=r[0];return null==e?e:(r.push(t),n.apply(w,r))})}function Qt(n,t){return function(r,e,u){if(u&&Ur(r,e,u)&&(e=w),e=wr(e,u,3),1==e.length){
|
||||
u=r=Oo(r)?r:zr(r);for(var o=e,i=-1,f=u.length,a=t,c=a;++i<f;){var l=u[i],s=+o(l);n(s,a)&&(a=s,c=l)}if(u=c,!r.length||u!==t)return u}return ct(r,e,n,t)}}function nr(n,r){return function(e,u,o){return u=wr(u,o,3),Oo(e)?(u=t(e,u,r),-1<u?e[u]:w):st(e,u,n)}}function tr(n){return function(r,e,u){return r&&r.length?(e=wr(e,u,3),t(r,e,n)):-1}}function rr(n){return function(t,r,e){return r=wr(r,e,3),st(t,r,n,true)}}function er(n){return function(){for(var t,r=arguments.length,e=n?r:-1,u=0,o=Be(r);n?e--:++e<r;){
|
||||
var i=o[u++]=arguments[e];if(typeof i!="function")throw new Ge(L);!t&&Ln.prototype.thru&&"wrapper"==br(i)&&(t=new Ln([],true))}for(e=t?-1:r;++e<r;){var i=o[e],u=br(i),f="wrapper"==u?zu(i):w;t=f&&$r(f[0])&&f[1]==(E|k|R|C)&&!f[4].length&&1==f[9]?t[br(f[0])].apply(t,f[3]):1==i.length&&$r(i)?t[u]():t.thru(i)}return function(){var n=arguments,e=n[0];if(t&&1==n.length&&Oo(e)&&e.length>=F)return t.plant(e).value();for(var u=0,n=r?o[u].apply(this,n):e;++u<r;)n=o[u].call(this,n);return n}}}function ur(n,t){
|
||||
return function(r,e,u){return typeof e=="function"&&u===w&&Oo(r)?n(r,e):t(r,Bt(e,u,3))}}function or(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r,Re)}}function ir(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r)}}function fr(n){return function(t,r,e){var u={};return r=wr(r,e,3),_t(t,function(t,e,o){o=r(t,e,o),e=n?o:e,t=n?t:o,u[e]=t}),u}}function ar(n){return function(t,r,e){return t=u(t),(n?t:"")+pr(t,r,e)+(n?"":t)}}function cr(n){
|
||||
var t=le(function(r,e){var u=v(e,t.placeholder);return gr(r,n,w,e,u)});return t}function lr(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&o===w&&Oo(r)?n(r,e,u,i):Ot(r,wr(e,o,4),u,i,t)}}function sr(n,t,r,e,u,o,i,f,a,c){function l(){for(var m=arguments.length,b=m,j=Be(m);b--;)j[b]=arguments[b];if(e&&(j=Mt(j,e,u)),o&&(j=qt(j,o,i)),_||y){var b=l.placeholder,k=v(j,b),m=m-k.length;if(m<c){var I=f?qn(f):w,m=bu(c-m,0),E=_?k:w,k=_?w:k,C=_?j:w,j=_?w:j;return t|=_?R:O,t&=~(_?O:R),
|
||||
g||(t&=~(x|A)),j=[n,t,r,C,E,j,k,I,a,m],I=sr.apply(w,j),$r(n)&&Du(I,j),I.placeholder=b,I}}if(b=p?r:this,I=h?b[n]:n,f)for(m=j.length,E=xu(f.length,m),k=qn(j);E--;)C=f[E],j[E]=Cr(C,m)?k[C]:w;return s&&a<j.length&&(j.length=a),this&&this!==Zn&&this instanceof l&&(I=d||Jt(n)),I.apply(b,j)}var s=t&E,p=t&x,h=t&A,_=t&k,g=t&j,y=t&I,d=h?w:Jt(n);return l}function pr(n,t,r){return n=n.length,t=+t,n<t&&mu(t)?(t-=n,r=null==r?" ":r+"",Ue(r,vu(t/r.length)).slice(0,t)):""}function hr(n,t,r,e){function u(){for(var t=-1,f=arguments.length,a=-1,c=e.length,l=Be(c+f);++a<c;)l[a]=e[a];
|
||||
for(;f--;)l[a++]=arguments[++t];return(this&&this!==Zn&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=Jt(n);return u}function _r(n){var t=Pe[n];return function(n,r){return(r=r===w?0:+r||0)?(r=au(10,r),t(n*r)/r):t(n)}}function vr(n){return function(t,r,e,u){var o=wr(e);return null==e&&o===ut?Lt(t,r,n):zt(t,r,o(e,u,1),n)}}function gr(n,t,r,e,u,o,i,f){var a=t&A;if(!a&&typeof n!="function")throw new Ge(L);var c=e?e.length:0;if(c||(t&=~(R|O),e=u=w),c-=u?u.length:0,t&O){var l=e,s=u;e=u=w}var p=a?w:zu(n);
|
||||
return r=[n,t,r,e,u,l,s,o,i,f],p&&(e=r[1],t=p[1],f=e|t,u=t==E&&e==k||t==E&&e==C&&r[7].length<=p[8]||t==(E|C)&&e==k,(f<E||u)&&(t&x&&(r[2]=p[2],f|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Mt(u,e,p[4]):qn(e),r[4]=u?v(r[3],z):qn(p[4])),(e=p[5])&&(u=r[5],r[5]=u?qt(u,e,p[6]):qn(e),r[6]=u?v(r[5],z):qn(p[6])),(e=p[7])&&(r[7]=qn(e)),t&E&&(r[8]=null==r[8]?p[8]:xu(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9]),r[9]=null==f?a?0:n.length:bu(f-c,0)||0,(p?Lu:Du)(t==x?Yt(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?sr.apply(w,r):hr.apply(w,r),r);
|
||||
}function yr(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length;if(a!=c&&(!u||c<=a))return false;for(;++f<a;){var l=n[f],c=t[f],s=e?e(u?c:l,u?l:c,f):w;if(s!==w){if(s)continue;return false}if(u){if(!Hn(t,function(n){return l===n||r(l,n,e,u,o,i)}))return false}else if(l!==c&&!r(l,c,e,u,o,i))return false}return true}function dr(n,t,r){switch(r){case M:case q:return+n==+t;case P:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:n==+t;case Y:case G:return n==t+""}return false}function mr(n,t,r,e,u,o,i){var f=zo(n),a=f.length,c=zo(t).length;
|
||||
if(a!=c&&!u)return false;for(c=a;c--;){var l=f[c];if(!(u?l in t:nu.call(t,l)))return false}for(var s=u;++c<a;){var l=f[c],p=n[l],h=t[l],_=e?e(u?h:p,u?p:h,l):w;if(_===w?!r(p,h,e,u,o,i):!_)return false;s||(s="constructor"==l)}return s||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function wr(n,t,r){var e=Nn.callback||Se,e=e===Se?ut:e;return r?e(n,t,r):e}function br(n){for(var t=n.name+"",r=Wu[t],e=r?r.length:0;e--;){
|
||||
var u=r[e],o=u.func;if(null==o||o==n)return u.name}return t}function xr(n,t,e){var u=Nn.indexOf||Vr,u=u===Vr?r:u;return n?u(n,t,e):u}function Ar(n){n=Oe(n);for(var t=n.length;t--;){var r=n[t][1];n[t][2]=r===r&&!ge(r)}return n}function jr(n,t){var r=null==n?w:n[t];return ye(r)?r:w}function kr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ir(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Ve),
|
||||
new n}function Rr(n,t,r){var e=n.constructor;switch(t){case J:return Dt(n);case M:case q:return new e(+n);case X:case H:case Q:case nn:case tn:case rn:case en:case un:case on:return t=n.buffer,new e(r?Dt(t):t,n.byteOffset,n.length);case V:case G:return new e(n);case Y:var u=new e(n.source,kn.exec(n));u.lastIndex=n.lastIndex}return u}function Or(n,t,r){return null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),t=Zr(t)),t=null==n?n:n[t],null==t?w:t.apply(n,r)}function Er(n){return null!=n&&Sr(Bu(n));
|
||||
}function Cr(n,t){return n=typeof n=="number"||On.test(n)?+n:-1,t=null==t?Cu:t,-1<n&&0==n%1&&n<t}function Ur(n,t,r){if(!ge(r))return false;var e=typeof t;return("number"==e?Er(r)&&Cr(t,r.length):"string"==e&&t in r)?(t=r[t],n===n?n===t:t!==t):false}function Wr(n,t){var r=typeof n;return"string"==r&&dn.test(n)||"number"==r?true:Oo(n)?false:!yn.test(n)||null!=t&&n in Br(t)}function $r(n){var t=br(n),r=Nn[t];return typeof r=="function"&&t in zn.prototype?n===r?true:(t=zu(r),!!t&&n===t[0]):false}function Sr(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=Cu;
|
||||
}function Fr(n,t){return n===w?t:Eo(n,t,Fr)}function Nr(n,t){n=Br(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Tr(n,t){var r={};return ht(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function Lr(n){for(var t=Re(n),r=t.length,e=r&&n.length,u=!!e&&Sr(e)&&(Oo(n)||pe(n)),o=-1,i=[];++o<r;){var f=t[o];(u&&Cr(f,e)||nu.call(n,f))&&i.push(f)}return i}function zr(n){return null==n?[]:Er(n)?ge(n)?n:Ve(n):Ee(n)}function Br(n){return ge(n)?n:Ve(n)}function Dr(n){if(Oo(n))return n;
|
||||
var t=[];return u(n).replace(mn,function(n,r,e,u){t.push(e?u.replace(An,"$1"):r||n)}),t}function Mr(n){return n instanceof zn?n.clone():new Ln(n.__wrapped__,n.__chain__,qn(n.__actions__))}function qr(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0>t?0:t)):[]}function Pr(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0,0>t?0:t)):[]}function Kr(n){return n?n[0]:w}function Vr(n,t,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?bu(u+e,0):e;else if(e)return e=Lt(n,t),
|
||||
e<u&&(t===t?t===n[e]:n[e]!==n[e])?e:-1;return r(n,t,e||0)}function Zr(n){var t=n?n.length:0;return t?n[t-1]:w}function Yr(n){return qr(n,1)}function Gr(n,t,e,u){if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=Ur(n,t,u)?w:t,t=false);var o=wr();if((null!=e||o!==ut)&&(e=o(e,u,3)),t&&xr()===r){t=e;var i;e=-1,u=n.length;for(var o=-1,f=[];++e<u;){var a=n[e],c=t?t(a,e,n):a;e&&i===c||(i=c,f[++o]=a)}n=f}else n=St(n,e);return n}function Jr(n){if(!n||!n.length)return[];var t=-1,r=0;n=Vn(n,function(n){
|
||||
return Er(n)?(r=bu(n.length,r),true):void 0});for(var e=Be(r);++t<r;)e[t]=Gn(n,jt(t));return e}function Xr(n,t,r){return n&&n.length?(n=Jr(n),null==t?n:(t=Bt(t,r,4),Gn(n,function(n){return Xn(n,t,w,true)}))):[]}function Hr(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||Oo(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Qr(n){return n=Nn(n),n.__chain__=true,n}function ne(n,t,r){return t.call(r,n)}function te(n,t,r){var e=Oo(n)?Kn:at;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),
|
||||
e(n,t)}function re(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,t)}function ee(n,t,r,e){var u=n?Bu(n):0;return Sr(u)||(n=Ee(n),u=n.length),r=typeof r!="number"||e&&Ur(t,r,e)?0:0>r?bu(u+r,0):r||0,typeof n=="string"||!Oo(n)&&be(n)?r<=u&&-1<n.indexOf(t,r):!!u&&-1<xr(n,t,r)}function ue(n,t,r){var e=Oo(n)?Gn:wt;return t=wr(t,r,3),e(n,t)}function oe(n,t,r){if(r?Ur(n,t,r):null==t){n=zr(n);var e=n.length;return 0<e?n[Rt(0,e-1)]:w}r=-1,n=je(n);var e=n.length,u=e-1;for(t=xu(0>t?0:+t||0,e);++r<t;){var e=Rt(r,u),o=n[e];
|
||||
n[e]=n[r],n[r]=o}return n.length=t,n}function ie(n,t,r){var e=Oo(n)?Hn:Ct;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),e(n,t)}function fe(n,t){var r;if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var e=n;n=t,t=e}return function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=w),r}}function ae(n,t,r){function e(t,r){r&&iu(r),a=p=h=w,t&&(_=ho(),c=n.apply(s,f),p||a||(f=s=w))}function u(){var n=t-(ho()-l);0>=n||n>t?e(h,a):p=su(u,n)}function o(){e(g,p);
|
||||
}function i(){if(f=arguments,l=ho(),s=this,h=g&&(p||!y),false===v)var r=y&&!p;else{a||y||(_=l);var e=v-(l-_),i=0>=e||e>v;i?(a&&(a=iu(a)),_=l,c=n.apply(s,f)):a||(a=su(o,e))}return i&&p?p=iu(p):p||t===v||(p=su(u,t)),r&&(i=true,c=n.apply(s,f)),!i||p||a||(f=s=w),c}var f,a,c,l,s,p,h,_=0,v=false,g=true;if(typeof n!="function")throw new Ge(L);if(t=0>t?0:+t||0,true===r)var y=true,g=false;else ge(r)&&(y=!!r.leading,v="maxWait"in r&&bu(+r.maxWait||0,t),g="trailing"in r?!!r.trailing:g);return i.cancel=function(){p&&iu(p),a&&iu(a),
|
||||
_=0,a=p=h=w},i}function ce(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new Ge(L);return r.cache=new ce.Cache,r}function le(n,t){if(typeof n!="function")throw new Ge(L);return t=bu(t===w?n.length-1:+t||0,0),function(){for(var r=arguments,e=-1,u=bu(r.length-t,0),o=Be(u);++e<u;)o[e]=r[t+e];switch(t){case 0:return n.call(this,o);case 1:return n.call(this,r[0],o);
|
||||
case 2:return n.call(this,r[0],r[1],o)}for(u=Be(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function se(n,t){return n>t}function pe(n){return h(n)&&Er(n)&&nu.call(n,"callee")&&!cu.call(n,"callee")}function he(n,t,r,e){return e=(r=typeof r=="function"?Bt(r,e,3):w)?r(n,t):w,e===w?dt(n,t,r):!!e}function _e(n){return h(n)&&typeof n.message=="string"&&ru.call(n)==P}function ve(n){return ge(n)&&ru.call(n)==K}function ge(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function ye(n){
|
||||
return null==n?false:ve(n)?uu.test(Qe.call(n)):h(n)&&Rn.test(n)}function de(n){return typeof n=="number"||h(n)&&ru.call(n)==V}function me(n){var t;if(!h(n)||ru.call(n)!=Z||pe(n)||!(nu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t)))return false;var r;return ht(n,function(n,t){r=t}),r===w||nu.call(n,r)}function we(n){return ge(n)&&ru.call(n)==Y}function be(n){return typeof n=="string"||h(n)&&ru.call(n)==G}function xe(n){return h(n)&&Sr(n.length)&&!!Sn[ru.call(n)]}function Ae(n,t){
|
||||
return n<t}function je(n){var t=n?Bu(n):0;return Sr(t)?t?qn(n):[]:Ee(n)}function ke(n){return et(n,Re(n))}function Ie(n){return gt(n,Re(n))}function Re(n){if(null==n)return[];ge(n)||(n=Ve(n));for(var t=n.length,t=t&&Sr(t)&&(Oo(n)||pe(n))&&t||0,r=n.constructor,e=-1,r=typeof r=="function"&&r.prototype===n,u=Be(t),o=0<t;++e<t;)u[e]=e+"";for(var i in n)o&&Cr(i,t)||"constructor"==i&&(r||!nu.call(n,i))||u.push(i);return u}function Oe(n){n=Br(n);for(var t=-1,r=zo(n),e=r.length,u=Be(e);++t<e;){var o=r[t];
|
||||
u[t]=[o,n[o]]}return u}function Ee(n){return Ft(n,zo(n))}function Ce(n){return(n=u(n))&&n.replace(En,a).replace(xn,"")}function Ue(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!mu(t))return r;do t%2&&(r+=n),t=yu(t/2),n+=n;while(t);return r}function We(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(g(n),y(n)+1):(t+="",n.slice(o(n,t),i(n,t)+1)):n}function $e(n,t,r){return r&&Ur(n,t,r)&&(t=w),n=u(n),n.match(t||Wn)||[]}function Se(n,t,r){return r&&Ur(n,t,r)&&(t=w),h(n)?Ne(n):ut(n,t)}function Fe(n){
|
||||
return n}function Ne(n){return bt(ot(n,true))}function Te(n,t,r){if(null==r){var e=ge(t),u=e?zo(t):w;((u=u&&u.length?gt(t,u):w)?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=gt(t,zo(t)));var o=true,e=-1,i=ve(n),f=u.length;false===r?o=false:ge(r)&&"chain"in r&&(o=r.chain);for(;++e<f;){r=u[e];var a=t[r];n[r]=a,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__;if(o||r){var e=n(this.__wrapped__);return(e.__actions__=qn(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return t.apply(n,Jn([this.value()],arguments));
|
||||
}}(a))}return n}function Le(){}function ze(n){return Wr(n)?jt(n):kt(n)}_=_?Yn.defaults(Zn.Object(),_,Yn.pick(Zn,$n)):Zn;var Be=_.Array,De=_.Date,Me=_.Error,qe=_.Function,Pe=_.Math,Ke=_.Number,Ve=_.Object,Ze=_.RegExp,Ye=_.String,Ge=_.TypeError,Je=Be.prototype,Xe=Ve.prototype,He=Ye.prototype,Qe=qe.prototype.toString,nu=Xe.hasOwnProperty,tu=0,ru=Xe.toString,eu=Zn._,uu=Ze("^"+Qe.call(nu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ou=_.ArrayBuffer,iu=_.clearTimeout,fu=_.parseFloat,au=Pe.pow,cu=Xe.propertyIsEnumerable,lu=jr(_,"Set"),su=_.setTimeout,pu=Je.splice,hu=_.Uint8Array,_u=jr(_,"WeakMap"),vu=Pe.ceil,gu=jr(Ve,"create"),yu=Pe.floor,du=jr(Be,"isArray"),mu=_.isFinite,wu=jr(Ve,"keys"),bu=Pe.max,xu=Pe.min,Au=jr(De,"now"),ju=_.parseInt,ku=Pe.random,Iu=Ke.NEGATIVE_INFINITY,Ru=Ke.POSITIVE_INFINITY,Ou=4294967294,Eu=2147483647,Cu=9007199254740991,Uu=_u&&new _u,Wu={};
|
||||
Nn.support={},Nn.templateSettings={escape:_n,evaluate:vn,interpolate:gn,variable:"",imports:{_:Nn}};var $u=function(){function n(){}return function(t){if(ge(t)){n.prototype=t;var r=new n;n.prototype=w}return r||{}}}(),Su=Vt(_t),Fu=Vt(vt,true),Nu=Zt(),Tu=Zt(true),Lu=Uu?function(n,t){return Uu.set(n,t),n}:Fe,zu=Uu?function(n){return Uu.get(n)}:Le,Bu=jt("length"),Du=function(){var n=0,t=0;return function(r,e){var u=ho(),o=S-(u-t);if(t=u,0<o){if(++n>=$)return r}else n=0;return Lu(r,e)}}(),Mu=le(function(n,t){
|
||||
return h(n)&&Er(n)?ft(n,pt(t,false,true)):[]}),qu=tr(),Pu=tr(true),Ku=le(function(n){for(var t=n.length,e=t,u=Be(l),o=xr(),i=o===r,f=[];e--;){var a=n[e]=Er(a=n[e])?a:[];u[e]=i&&120<=a.length&&gu&&lu?new Dn(e&&a):null}var i=n[0],c=-1,l=i?i.length:0,s=u[0];n:for(;++c<l;)if(a=i[c],0>(s?Mn(s,a):o(f,a,0))){for(e=t;--e;){var p=u[e];if(0>(p?Mn(p,a):o(n[e],a,0)))continue n}s&&s.push(a),f.push(a)}return f}),Vu=le(function(t,r){r=pt(r);var e=rt(t,r);return It(t,r.sort(n)),e}),Zu=vr(),Yu=vr(true),Gu=le(function(n){return St(pt(n,false,true));
|
||||
}),Ju=le(function(n,t){return Er(n)?ft(n,t):[]}),Xu=le(Jr),Hu=le(function(n){var t=n.length,r=2<t?n[t-2]:w,e=1<t?n[t-1]:w;return 2<t&&typeof r=="function"?t-=2:(r=1<t&&typeof e=="function"?(--t,e):w,e=w),n.length=t,Xr(n,r,e)}),Qu=le(function(n){return n=pt(n),this.thru(function(t){t=Oo(t)?t:[Br(t)];for(var r=n,e=-1,u=t.length,o=-1,i=r.length,f=Be(u+i);++e<u;)f[e]=t[e];for(;++o<i;)f[e++]=r[o];return f})}),no=le(function(n,t){return rt(n,pt(t))}),to=Pt(function(n,t,r){nu.call(n,r)?++n[r]:n[r]=1}),ro=nr(Su),eo=nr(Fu,true),uo=ur(Pn,Su),oo=ur(function(n,t){
|
||||
for(var r=n.length;r--&&false!==t(n[r],r,n););return n},Fu),io=Pt(function(n,t,r){nu.call(n,r)?n[r].push(t):n[r]=[t]}),fo=Pt(function(n,t,r){n[r]=t}),ao=le(function(n,t,r){var e=-1,u=typeof t=="function",o=Wr(t),i=Er(n)?Be(n.length):[];return Su(n,function(n){var f=u?t:o&&null!=n?n[t]:w;i[++e]=f?f.apply(n,r):Or(n,t,r)}),i}),co=Pt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),lo=lr(Xn,Su),so=lr(function(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r},Fu),po=le(function(n,t){
|
||||
if(null==n)return[];var r=t[2];return r&&Ur(t[0],t[1],r)&&(t.length=1),Wt(n,pt(t),[])}),ho=Au||function(){return(new De).getTime()},_o=le(function(n,t,r){var e=x;if(r.length)var u=v(r,_o.placeholder),e=e|R;return gr(n,e,t,r,u)}),vo=le(function(n,t){t=t.length?pt(t):Ie(n);for(var r=-1,e=t.length;++r<e;){var u=t[r];n[u]=gr(n[u],x,n)}return n}),go=le(function(n,t,r){var e=x|A;if(r.length)var u=v(r,go.placeholder),e=e|R;return gr(t,e,n,r,u)}),yo=Xt(k),mo=Xt(I),wo=le(function(n,t){return it(n,1,t)}),bo=le(function(n,t,r){
|
||||
return it(n,t,r)}),xo=er(),Ao=er(true),jo=le(function(n,t){if(t=pt(t),typeof n!="function"||!Kn(t,e))throw new Ge(L);var r=t.length;return le(function(e){for(var u=xu(e.length,r);u--;)e[u]=t[u](e[u]);return n.apply(this,e)})}),ko=cr(R),Io=cr(O),Ro=le(function(n,t){return gr(n,C,w,w,w,pt(t))}),Oo=du||function(n){return h(n)&&Sr(n.length)&&ru.call(n)==D},Eo=Kt(At),Co=Kt(function(n,t,r){return r?nt(n,t,r):tt(n,t)}),Uo=Ht(Co,function(n,t){return n===w?t:n}),Wo=Ht(Eo,Fr),$o=rr(_t),So=rr(vt),Fo=or(Nu),No=or(Tu),To=ir(_t),Lo=ir(vt),zo=wu?function(n){
|
||||
var t=null==n?w:n.constructor;return typeof t=="function"&&t.prototype===n||typeof n!="function"&&Er(n)?Lr(n):ge(n)?wu(n):[]}:Lr,Bo=fr(true),Do=fr(),Mo=le(function(n,t){if(null==n)return{};if("function"!=typeof t[0])return t=Gn(pt(t),Ye),Nr(n,ft(Re(n),t));var r=Bt(t[0],t[1],3);return Tr(n,function(n,t,e){return!r(n,t,e)})}),qo=le(function(n,t){return null==n?{}:"function"==typeof t[0]?Tr(n,Bt(t[0],t[1],3)):Nr(n,pt(t))}),Po=Gt(function(n,t,r){return t=t.toLowerCase(),n+(r?t.charAt(0).toUpperCase()+t.slice(1):t);
|
||||
}),Ko=Gt(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vo=ar(),Zo=ar(true),Yo=Gt(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Go=Gt(function(n,t,r){return n+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),Jo=le(function(n,t){try{return n.apply(w,t)}catch(r){return _e(r)?r:new Me(r)}}),Xo=le(function(n,t){return function(r){return Or(r,n,t)}}),Ho=le(function(n,t){return function(r){return Or(n,r,t)}}),Qo=_r("ceil"),ni=_r("floor"),ti=Qt(se,Iu),ri=Qt(Ae,Ru),ei=_r("round");return Nn.prototype=Tn.prototype,
|
||||
Ln.prototype=$u(Tn.prototype),Ln.prototype.constructor=Ln,zn.prototype=$u(Tn.prototype),zn.prototype.constructor=zn,Bn.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n]},Bn.prototype.get=function(n){return"__proto__"==n?w:this.__data__[n]},Bn.prototype.has=function(n){return"__proto__"!=n&&nu.call(this.__data__,n)},Bn.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},Dn.prototype.push=function(n){var t=this.data;typeof n=="string"||ge(n)?t.set.add(n):t.hash[n]=true;
|
||||
},ce.Cache=Bn,Nn.after=function(n,t){if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var r=n;n=t,t=r}return n=mu(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0}},Nn.ary=function(n,t,r){return r&&Ur(n,t,r)&&(t=w),t=n&&null==t?n.length:bu(+t||0,0),gr(n,E,w,w,w,w,t)},Nn.assign=Co,Nn.at=no,Nn.before=fe,Nn.bind=_o,Nn.bindAll=vo,Nn.bindKey=go,Nn.callback=Se,Nn.chain=Qr,Nn.chunk=function(n,t,r){t=(r?Ur(n,t,r):null==t)?1:bu(yu(t)||1,1),r=0;for(var e=n?n.length:0,u=-1,o=Be(vu(e/t));r<e;)o[++u]=Et(n,r,r+=t);
|
||||
return o},Nn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},Nn.constant=function(n){return function(){return n}},Nn.countBy=to,Nn.create=function(n,t,r){var e=$u(n);return r&&Ur(n,t,r)&&(t=w),t?tt(e,t):e},Nn.curry=yo,Nn.curryRight=mo,Nn.debounce=ae,Nn.defaults=Uo,Nn.defaultsDeep=Wo,Nn.defer=wo,Nn.delay=bo,Nn.difference=Mu,Nn.drop=qr,Nn.dropRight=Pr,Nn.dropRightWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3),true,true):[]},Nn.dropWhile=function(n,t,r){
|
||||
return n&&n.length?Nt(n,wr(t,r,3),true):[]},Nn.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&Ur(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=e===w||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;return n},Nn.filter=re,Nn.flatten=function(n,t,r){var e=n?n.length:0;return r&&Ur(n,t,r)&&(t=false),e?pt(n,t):[]},Nn.flattenDeep=function(n){return n&&n.length?pt(n,true):[]},Nn.flow=xo,Nn.flowRight=Ao,Nn.forEach=uo,Nn.forEachRight=oo,Nn.forIn=Fo,
|
||||
Nn.forInRight=No,Nn.forOwn=To,Nn.forOwnRight=Lo,Nn.functions=Ie,Nn.groupBy=io,Nn.indexBy=fo,Nn.initial=function(n){return Pr(n,1)},Nn.intersection=Ku,Nn.invert=function(n,t,r){r&&Ur(n,t,r)&&(t=w),r=-1;for(var e=zo(n),u=e.length,o={};++r<u;){var i=e[r],f=n[i];t?nu.call(o,f)?o[f].push(i):o[f]=[i]:o[f]=i}return o},Nn.invoke=ao,Nn.keys=zo,Nn.keysIn=Re,Nn.map=ue,Nn.mapKeys=Bo,Nn.mapValues=Do,Nn.matches=Ne,Nn.matchesProperty=function(n,t){return xt(n,ot(t,true))},Nn.memoize=ce,Nn.merge=Eo,Nn.method=Xo,Nn.methodOf=Ho,
|
||||
Nn.mixin=Te,Nn.modArgs=jo,Nn.negate=function(n){if(typeof n!="function")throw new Ge(L);return function(){return!n.apply(this,arguments)}},Nn.omit=Mo,Nn.once=function(n){return fe(2,n)},Nn.pairs=Oe,Nn.partial=ko,Nn.partialRight=Io,Nn.partition=co,Nn.pick=qo,Nn.pluck=function(n,t){return ue(n,ze(t))},Nn.property=ze,Nn.propertyOf=function(n){return function(t){return yt(n,Dr(t),t+"")}},Nn.pull=function(){var n=arguments,t=n[0];if(!t||!t.length)return t;for(var r=0,e=xr(),u=n.length;++r<u;)for(var o=0,i=n[r];-1<(o=e(t,i,o));)pu.call(t,o,1);
|
||||
return t},Nn.pullAt=Vu,Nn.range=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=bu(vu((t-n)/(r||1)),0);for(var u=Be(t);++e<t;)u[e]=n,n+=r;return u},Nn.rearg=Ro,Nn.reject=function(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,function(n,r,e){return!t(n,r,e)})},Nn.remove=function(n,t,r){var e=[];if(!n||!n.length)return e;var u=-1,o=[],i=n.length;for(t=wr(t,r,3);++u<i;)r=n[u],t(r,u,n)&&(e.push(r),o.push(u));return It(n,o),e},Nn.rest=Yr,Nn.restParam=le,
|
||||
Nn.set=function(n,t,r){if(null==n)return n;var e=t+"";t=null!=n[e]||Wr(t,n)?[e]:Dr(t);for(var e=-1,u=t.length,o=u-1,i=n;null!=i&&++e<u;){var f=t[e];ge(i)&&(e==o?i[f]=r:null==i[f]&&(i[f]=Cr(t[e+1])?[]:{})),i=i[f]}return n},Nn.shuffle=function(n){return oe(n,Ru)},Nn.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&Ur(n,t,r)&&(t=0,r=e),Et(n,t,r)):[]},Nn.sortBy=function(n,t,r){if(null==n)return[];r&&Ur(n,t,r)&&(t=w);var e=-1;return t=wr(t,r,3),n=wt(n,function(n,r,u){return{a:t(n,r,u),
|
||||
b:++e,c:n}}),Ut(n,f)},Nn.sortByAll=po,Nn.sortByOrder=function(n,t,r,e){return null==n?[]:(e&&Ur(t,r,e)&&(r=w),Oo(t)||(t=null==t?[]:[t]),Oo(r)||(r=null==r?[]:[r]),Wt(n,t,r))},Nn.spread=function(n){if(typeof n!="function")throw new Ge(L);return function(t){return n.apply(this,t)}},Nn.take=function(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0,0>t?0:t)):[]},Nn.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0>t?0:t)):[]},Nn.takeRightWhile=function(n,t,r){
|
||||
return n&&n.length?Nt(n,wr(t,r,3),false,true):[]},Nn.takeWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3)):[]},Nn.tap=function(n,t,r){return t.call(r,n),n},Nn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new Ge(L);return false===r?e=false:ge(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ae(n,t,{leading:e,maxWait:+t,trailing:u})},Nn.thru=ne,Nn.times=function(n,t,r){if(n=yu(n),1>n||!mu(n))return[];var e=-1,u=Be(xu(n,4294967295));for(t=Bt(t,r,1);++e<n;)4294967295>e?u[e]=t(e):t(e);
|
||||
return u},Nn.toArray=je,Nn.toPlainObject=ke,Nn.transform=function(n,t,r,e){var u=Oo(n)||xe(n);return t=wr(t,e,4),null==r&&(u||ge(n)?(e=n.constructor,r=u?Oo(n)?new e:[]:$u(ve(e)?e.prototype:w)):r={}),(u?Pn:_t)(n,function(n,e,u){return t(r,n,e,u)}),r},Nn.union=Gu,Nn.uniq=Gr,Nn.unzip=Jr,Nn.unzipWith=Xr,Nn.values=Ee,Nn.valuesIn=function(n){return Ft(n,Re(n))},Nn.where=function(n,t){return re(n,bt(t))},Nn.without=Ju,Nn.wrap=function(n,t){return t=null==t?Fe:t,gr(t,R,w,[n],[])},Nn.xor=function(){for(var n=-1,t=arguments.length;++n<t;){
|
||||
var r=arguments[n];if(Er(r))var e=e?Jn(ft(e,r),ft(r,e)):r}return e?St(e):[]},Nn.zip=Xu,Nn.zipObject=Hr,Nn.zipWith=Hu,Nn.backflow=Ao,Nn.collect=ue,Nn.compose=Ao,Nn.each=uo,Nn.eachRight=oo,Nn.extend=Co,Nn.iteratee=Se,Nn.methods=Ie,Nn.object=Hr,Nn.select=re,Nn.tail=Yr,Nn.unique=Gr,Te(Nn,Nn),Nn.add=function(n,t){return(+n||0)+(+t||0)},Nn.attempt=Jo,Nn.camelCase=Po,Nn.capitalize=function(n){return(n=u(n))&&n.charAt(0).toUpperCase()+n.slice(1)},Nn.ceil=Qo,Nn.clone=function(n,t,r,e){return t&&typeof t!="boolean"&&Ur(n,t,r)?t=false:typeof t=="function"&&(e=r,
|
||||
r=t,t=false),typeof r=="function"?ot(n,t,Bt(r,e,3)):ot(n,t)},Nn.cloneDeep=function(n,t,r){return typeof t=="function"?ot(n,true,Bt(t,r,3)):ot(n,true)},Nn.deburr=Ce,Nn.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=r===w?e:xu(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Nn.escape=function(n){return(n=u(n))&&hn.test(n)?n.replace(sn,c):n},Nn.escapeRegExp=function(n){return(n=u(n))&&bn.test(n)?n.replace(wn,l):n||"(?:)"},Nn.every=te,Nn.find=ro,Nn.findIndex=qu,Nn.findKey=$o,Nn.findLast=eo,
|
||||
Nn.findLastIndex=Pu,Nn.findLastKey=So,Nn.findWhere=function(n,t){return ro(n,bt(t))},Nn.first=Kr,Nn.floor=ni,Nn.get=function(n,t,r){return n=null==n?w:yt(n,Dr(t),t+""),n===w?r:n},Nn.gt=se,Nn.gte=function(n,t){return n>=t},Nn.has=function(n,t){if(null==n)return false;var r=nu.call(n,t);if(!r&&!Wr(t)){if(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),null==n)return false;t=Zr(t),r=nu.call(n,t)}return r||Sr(n.length)&&Cr(t,n.length)&&(Oo(n)||pe(n))},Nn.identity=Fe,Nn.includes=ee,Nn.indexOf=Vr,Nn.inRange=function(n,t,r){
|
||||
return t=+t||0,r===w?(r=t,t=0):r=+r||0,n>=xu(t,r)&&n<bu(t,r)},Nn.isArguments=pe,Nn.isArray=Oo,Nn.isBoolean=function(n){return true===n||false===n||h(n)&&ru.call(n)==M},Nn.isDate=function(n){return h(n)&&ru.call(n)==q},Nn.isElement=function(n){return!!n&&1===n.nodeType&&h(n)&&!me(n)},Nn.isEmpty=function(n){return null==n?true:Er(n)&&(Oo(n)||be(n)||pe(n)||h(n)&&ve(n.splice))?!n.length:!zo(n).length},Nn.isEqual=he,Nn.isError=_e,Nn.isFinite=function(n){return typeof n=="number"&&mu(n)},Nn.isFunction=ve,Nn.isMatch=function(n,t,r,e){
|
||||
return r=typeof r=="function"?Bt(r,e,3):w,mt(n,Ar(t),r)},Nn.isNaN=function(n){return de(n)&&n!=+n},Nn.isNative=ye,Nn.isNull=function(n){return null===n},Nn.isNumber=de,Nn.isObject=ge,Nn.isPlainObject=me,Nn.isRegExp=we,Nn.isString=be,Nn.isTypedArray=xe,Nn.isUndefined=function(n){return n===w},Nn.kebabCase=Ko,Nn.last=Zr,Nn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?bu(e+r,0):xu(r||0,e-1))+1;else if(r)return u=Lt(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;
|
||||
if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nn.lt=Ae,Nn.lte=function(n,t){return n<=t},Nn.max=ti,Nn.min=ri,Nn.noConflict=function(){return Zn._=eu,this},Nn.noop=Le,Nn.now=ho,Nn.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&mu(t)?(e=(t-e)/2,t=yu(e),e=vu(e),r=pr("",e,r),r.slice(0,t)+n+r):n},Nn.padLeft=Vo,Nn.padRight=Zo,Nn.parseInt=function(n,t,r){return(r?Ur(n,t,r):null==t)?t=0:t&&(t=+t),n=We(n),ju(n,t||(In.test(n)?16:10))},Nn.random=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w);
|
||||
var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ku(),xu(n+r*(t-n+fu("1e-"+((r+"").length-1))),t)):Rt(n,t)},Nn.reduce=lo,Nn.reduceRight=so,Nn.repeat=Ue,Nn.result=function(n,t,r){var e=null==n?w:n[t];return e===w&&(null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),e=null==n?w:n[Zr(t)]),e=e===w?r:e),ve(e)?e.call(n):e},Nn.round=ei,Nn.runInContext=m,Nn.size=function(n){var t=n?Bu(n):0;
|
||||
return Sr(t)?t:zo(n).length},Nn.snakeCase=Yo,Nn.some=ie,Nn.sortedIndex=Zu,Nn.sortedLastIndex=Yu,Nn.startCase=Go,Nn.startsWith=function(n,t,r){return n=u(n),r=null==r?0:xu(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nn.sum=function(n,t,r){if(r&&Ur(n,t,r)&&(t=w),t=wr(t,r,3),1==t.length){n=Oo(n)?n:zr(n),r=n.length;for(var e=0;r--;)e+=+t(n[r])||0;n=e}else n=$t(n,t);return n},Nn.template=function(n,t,r){var e=Nn.templateSettings;r&&Ur(n,t,r)&&(t=r=w),n=u(n),t=nt(tt({},r||t),e,Qn),r=nt(tt({},t.imports),e.imports,Qn);
|
||||
var o,i,f=zo(r),a=Ft(r,f),c=0;r=t.interpolate||Cn;var l="__p+='";r=Ze((t.escape||Cn).source+"|"+r.source+"|"+(r===gn?jn:Cn).source+"|"+(t.evaluate||Cn).source+"|$","g");var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,f,a){return e||(e=u),l+=n.slice(c,a).replace(Un,s),r&&(o=true,l+="'+__e("+r+")+'"),f&&(i=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=a+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(fn,""):l).replace(an,"$1").replace(cn,"$1;"),
|
||||
l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Jo(function(){return qe(f,p+"return "+l).apply(w,a)}),t.source=l,_e(t))throw t;return t},Nn.trim=We,Nn.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?Ur(e,t,r):null==t)?g(n):o(n,t+"")):n},Nn.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,t+"")+1):n;
|
||||
},Nn.trunc=function(n,t,r){r&&Ur(n,t,r)&&(t=w);var e=U;if(r=W,null!=t)if(ge(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;if(n=u(n),e>=n.length)return n;if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==o)return t+r;if(we(o)){if(n.slice(e).search(o)){var i,f=n.slice(0,e);for(o.global||(o=Ze(o.source,(kn.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(f);)i=n.index;t=t.slice(0,null==i?e:i)}}else n.indexOf(o,e)!=e&&(o=t.lastIndexOf(o),
|
||||
-1<o&&(t=t.slice(0,o)));return t+r},Nn.unescape=function(n){return(n=u(n))&&pn.test(n)?n.replace(ln,d):n},Nn.uniqueId=function(n){var t=++tu;return u(n)+t},Nn.words=$e,Nn.all=te,Nn.any=ie,Nn.contains=ee,Nn.eq=he,Nn.detect=ro,Nn.foldl=lo,Nn.foldr=so,Nn.head=Kr,Nn.include=ee,Nn.inject=lo,Te(Nn,function(){var n={};return _t(Nn,function(t,r){Nn.prototype[r]||(n[r]=t)}),n}(),false),Nn.sample=oe,Nn.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return oe(t,n)}):oe(this.value());
|
||||
},Nn.VERSION=b,Pn("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nn[n].placeholder=Nn}),Pn(["drop","take"],function(n,t){zn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new zn(this);r=null==r?1:bu(yu(r)||0,0);var u=this.clone();return e?u.__takeCount__=xu(u.__takeCount__,r):u.__views__.push({size:r,type:n+(0>u.__dir__?"Right":"")}),u},zn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Pn(["filter","map","takeWhile"],function(n,t){
|
||||
var r=t+1,e=r!=T;zn.prototype[n]=function(n,t){var u=this.clone();return u.__iteratees__.push({iteratee:wr(n,t,1),type:r}),u.__filtered__=u.__filtered__||e,u}}),Pn(["first","last"],function(n,t){var r="take"+(t?"Right":"");zn.prototype[n]=function(){return this[r](1).value()[0]}}),Pn(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");zn.prototype[n]=function(){return this.__filtered__?new zn(this):this[r](1)}}),Pn(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?bt:ze;zn.prototype[n]=function(n){
|
||||
return this[r](e(n))}}),zn.prototype.compact=function(){return this.filter(Fe)},zn.prototype.reject=function(n,t){return n=wr(n,t,1),this.filter(function(t){return!n(t)})},zn.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=this;return r.__filtered__&&(0<n||0>t)?new zn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==w&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r)},zn.prototype.takeRightWhile=function(n,t){return this.reverse().takeWhile(n,t).reverse()},zn.prototype.toArray=function(){return this.take(Ru);
|
||||
},_t(zn.prototype,function(n,t){var r=/^(?:filter|map|reject)|While$/.test(t),e=/^(?:first|last)$/.test(t),u=Nn[e?"take"+("last"==t?"Right":""):t];u&&(Nn.prototype[t]=function(){function t(n){return e&&i?u(n,1)[0]:u.apply(w,Jn([n],o))}var o=e?[1]:arguments,i=this.__chain__,f=this.__wrapped__,a=!!this.__actions__.length,c=f instanceof zn,l=o[0],s=c||Oo(f);return s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false),l={func:ne,args:[t],thisArg:w},a=c&&!a,e&&!i?a?(f=f.clone(),f.__actions__.push(l),n.call(f)):u.call(w,this.value())[0]:!e&&s?(f=a?f:new zn(this),
|
||||
f=n.apply(f,o),f.__actions__.push(l),new Ln(f,i)):this.thru(t)})}),Pn("join pop push replace shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?He:Je)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);Nn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),_t(zn.prototype,function(n,t){var r=Nn[t];if(r){var e=r.name+"";(Wu[e]||(Wu[e]=[])).push({
|
||||
name:t,func:r})}}),Wu[sr(w,A).name]=[{name:"wrapper",func:w}],zn.prototype.clone=function(){var n=new zn(this.__wrapped__);return n.__actions__=qn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=qn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=qn(this.__views__),n},zn.prototype.reverse=function(){if(this.__filtered__){var n=new zn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},zn.prototype.value=function(){
|
||||
var n,t=this.__wrapped__.value(),r=this.__dir__,e=Oo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,a=-1,c=i.length;++a<c;){var l=i[a],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=xu(n,f+s);break;case"takeRight":f=bu(f,n-s)}}if(n={start:f,end:n},i=n.start,f=n.end,n=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,a=0,c=xu(n,this.__takeCount__),!e||o<F||o==n&&c==n)return Tt(t,this.__actions__);e=[];n:for(;n--&&a<c;){for(u+=r,o=-1,l=t[u];++o<f;){var p=i[o],s=p.type,p=p.iteratee(l);
|
||||
if(s==T)l=p;else if(!p){if(s==N)continue n;break n}}e[a++]=l}return e},Nn.prototype.chain=function(){return Qr(this)},Nn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Nn.prototype.concat=Qu,Nn.prototype.plant=function(n){for(var t,r=this;r instanceof Tn;){var e=Mr(r);t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},Nn.prototype.reverse=function(){function n(n){return n.reverse()}var t=this.__wrapped__;return t instanceof zn?(this.__actions__.length&&(t=new zn(this)),
|
||||
t=t.reverse(),t.__actions__.push({func:ne,args:[n],thisArg:w}),new Ln(t,this.__chain__)):this.thru(n)},Nn.prototype.toString=function(){return this.value()+""},Nn.prototype.run=Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return Tt(this.__wrapped__,this.__actions__)},Nn.prototype.collect=Nn.prototype.map,Nn.prototype.head=Nn.prototype.first,Nn.prototype.select=Nn.prototype.filter,Nn.prototype.tail=Nn.prototype.rest,Nn}var w,b="3.10.1",x=1,A=2,j=4,k=8,I=16,R=32,O=64,E=128,C=256,U=30,W="...",$=150,S=16,F=200,N=1,T=2,L="Expected a function",z="__lodash_placeholder__",B="[object Arguments]",D="[object Array]",M="[object Boolean]",q="[object Date]",P="[object Error]",K="[object Function]",V="[object Number]",Z="[object Object]",Y="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nn="[object Int16Array]",tn="[object Int32Array]",rn="[object Uint8Array]",en="[object Uint8ClampedArray]",un="[object Uint16Array]",on="[object Uint32Array]",fn=/\b__p\+='';/g,an=/\b(__p\+=)''\+/g,cn=/(__e\(.*?\)|\b__t\))\+'';/g,ln=/&(?:amp|lt|gt|quot|#39|#96);/g,sn=/[&<>"'`]/g,pn=RegExp(ln.source),hn=RegExp(sn.source),_n=/<%-([\s\S]+?)%>/g,vn=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,dn=/^\w*$/,mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,wn=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,bn=RegExp(wn.source),xn=/[\u0300-\u036f\ufe20-\ufe23]/g,An=/\\(\\)?/g,jn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kn=/\w*$/,In=/^0[xX]/,Rn=/^\[object .+?Constructor\]$/,On=/^\d+$/,En=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Cn=/($^)/,Un=/['\n\r\u2028\u2029\\]/g,Wn=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),$n="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout isFinite parseFloat parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap".split(" "),Sn={};
|
||||
Sn[X]=Sn[H]=Sn[Q]=Sn[nn]=Sn[tn]=Sn[rn]=Sn[en]=Sn[un]=Sn[on]=true,Sn[B]=Sn[D]=Sn[J]=Sn[M]=Sn[q]=Sn[P]=Sn[K]=Sn["[object Map]"]=Sn[V]=Sn[Z]=Sn[Y]=Sn["[object Set]"]=Sn[G]=Sn["[object WeakMap]"]=false;var Fn={};Fn[B]=Fn[D]=Fn[J]=Fn[M]=Fn[q]=Fn[X]=Fn[H]=Fn[Q]=Fn[nn]=Fn[tn]=Fn[V]=Fn[Z]=Fn[Y]=Fn[G]=Fn[rn]=Fn[en]=Fn[un]=Fn[on]=true,Fn[P]=Fn[K]=Fn["[object Map]"]=Fn["[object Set]"]=Fn["[object WeakMap]"]=false;var Nn={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a",
|
||||
"\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y",
|
||||
"\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Tn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ln={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},zn={"function":true,object:true},Bn={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Dn={"\\":"\\",
|
||||
"'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mn=zn[typeof exports]&&exports&&!exports.nodeType&&exports,qn=zn[typeof module]&&module&&!module.nodeType&&module,Pn=zn[typeof self]&&self&&self.Object&&self,Kn=zn[typeof window]&&window&&window.Object&&window,Vn=qn&&qn.exports===Mn&&Mn,Zn=Mn&&qn&&typeof global=="object"&&global&&global.Object&&global||Kn!==(this&&this.window)&&Kn||Pn||this,Yn=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Zn._=Yn, define(function(){
|
||||
return Yn})):Mn&&qn?Vn?(qn.exports=Yn)._=Yn:Mn._=Yn:Zn._=Yn}).call(this);
|
@ -1,22 +0,0 @@
|
||||
UGLY=../enyo/node_modules/.bin/uglifyjs
|
||||
# order matters
|
||||
J=lib/js/jquery-1.9.0.js
|
||||
J+=lib/js/jquery-ui-latest.js
|
||||
J+=lib/js/jquery.onoff.js
|
||||
J+=lib/js/jquery.ui-contextmenu.js
|
||||
J+=lib/js/jquery.layout-latest.js
|
||||
J+=lib/js/tree.jquery.js
|
||||
J+=lib/js/jquery.layout.resizePaneAccordions-latest.js
|
||||
J+=lib/js/jquery.scrollTo-latest.js
|
||||
J+=lib/js/disasm_panel.js
|
||||
J+=lib/js/entropy_panel.js
|
||||
J+=lib/js/strings_panel.js
|
||||
J+=lib/js/hex_panel.js
|
||||
J+=lib/js/settings_panel.js
|
||||
J+=lib/js/main.js
|
||||
|
||||
all:
|
||||
cat $(J) | $(UGLY) > index.js || cat $(J) > index.js
|
||||
|
||||
indent:
|
||||
jsfmt -w lib/js/*.js
|
@ -1,159 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
h3 {
|
||||
color: white;
|
||||
font-family: Verdana;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
spacing:0px;
|
||||
}
|
||||
|
||||
.color_label {
|
||||
color: rgb(127,127,127);
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../enyo/js/r2.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/r2ui.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/disasm.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery-1.9.0.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/spectrum.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../enyo/disasm.css" />
|
||||
<script type="text/javascript" src="./lib/js/spectrum.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class='tmp_gui_background'>
|
||||
<table style=width:100%>
|
||||
<tr>
|
||||
<td width="85%" valign=top>
|
||||
<div style='overflow:hidden'>
|
||||
<pre>
|
||||
<font class='tmp_prompt'>[0x000027ba]> </font> <font style='color:#f0f0f0'>pd 42</font>
|
||||
<font class='tmp_fline'>/</font> <font class='tmp_fname'>(fcn) entry0 1495</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027ba</font> <font class='tmp_cjmp'>41<font class='tmp_cjmp'>54</font> </font><font class='tmp_push'>push<font class='tmp_reg'> r12</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027bb</font> <font class='tmp_cjmp'>58</font> </font><font class='tmp_pop'>pop<font class='tmp_reg'> rax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027bc</font> <font class='tmp_cjmp'>53</font> </font><font class='tmp_push'>push<font class='tmp_reg'> rbx</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027bd</font> <font class='tmp_cjmp'>48<font class='tmp_other'>81<font class='tmp_other'>ec<font class='tmp_cjmp'>48<font class='tmp_other'>06<font class='tmp_other'>0.</font> </font><font class='tmp_other'>sub<font class='tmp_reg'> rsp</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x648</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027c4</font> <font class='tmp_cjmp'>49<font class='tmp_other'>89<font class='tmp_other'>f5</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> r13</font>,<font class='tmp_b0xff'><font class='tmp_reg'> rsi</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027c7</font> <font class='tmp_other'>89<font class='tmp_other'>bd<font class='tmp_other'>b0<font class='tmp_other'>f9<font class='tmp_b0xff'>ff<font class='tmp_b0xff'>ff</font> </font><font class='tmp_mov'>mov<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rbp</font>-<font class='tmp_b0xff'><font class='tmp_push'>0x650</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_reg'> edi</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_comment'> ; jaja</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027cd</font> <font class='tmp_cjmp'>48<font class='tmp_other'>8d<font class='tmp_other'>85<font class='tmp_other'>c0<font class='tmp_other'>f9<font class='tmp_other'>f.</font> </font><font class='tmp_push'>lea<font class='tmp_reg'> rax</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rbp</font>-<font class='tmp_b0xff'><font class='tmp_push'>0x640</font>]<font class='tmp_b0xff'></font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027d4</font> <font class='tmp_cjmp'>48<font class='tmp_other'>89<font class='tmp_other'>85<font class='tmp_other'>b8<font class='tmp_other'>f9<font class='tmp_other'>f.</font> </font><font class='tmp_mov'>mov<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rbp</font>-<font class='tmp_b0xff'><font class='tmp_push'>0x648</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_reg'> rax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027db</font> <font class='tmp_other'>85<font class='tmp_b0xff'>ff</font> </font><font class='tmp_cmp'>test<font class='tmp_reg'> edi</font>,<font class='tmp_b0xff'><font class='tmp_reg'> edi</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,=< </font><font class='tmp_offset'>0x000027dd</font> <font class='tmp_b0x7f'>7f<font class='tmp_other'>05</font> </font><font class='tmp_cjmp'>jg 0x27e4</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x000027df</font> <font class='tmp_other'>e8<font class='tmp_other'>b1<font class='tmp_cjmp'>30<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call 0x5895</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> | </font> 0x00005895(unk, unk) ; entry0</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> `-> </font><font class='tmp_offset'>0x000027e4</font> <font class='tmp_cjmp'>48<font class='tmp_other'>8d<font class='tmp_cjmp'>35<font class='tmp_other'>1d<font class='tmp_cjmp'>37<font class='tmp_other'>0.</font> </font><font class='tmp_push'>lea<font class='tmp_reg'> rsi</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rip</font>+<font class='tmp_b0xff'><font class='tmp_push'>0x371d</font>]<font class='tmp_b0xff'></font></font> <font class='tmp_comment'>; 0x00005f08 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027eb</font> <font class='tmp_cjmp'>31<font class='tmp_b0xff'>ff</font> </font><font class='tmp_math'>xor<font class='tmp_reg'> edi</font>,<font class='tmp_b0xff'><font class='tmp_reg'> edi</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027ed</font> <font class='tmp_other'>e8<font class='tmp_cjmp'>2e<font class='tmp_cjmp'>32<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call sym.imp.setlocale</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> </font> 0x00005a20() ; sym.imp.setlocale</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027f2</font> <font class='tmp_other'>bb<font class='tmp_other'>01<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> ebx</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x1</font></font> <font class='tmp_comment'>; 0x00000001 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027f7</font> <font class='tmp_other'>bf<font class='tmp_other'>01<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> edi</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x1</font></font> <font class='tmp_comment'>; 0x00000001 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x000027fc</font> <font class='tmp_other'>e8<font class='tmp_other'>cb<font class='tmp_cjmp'>31<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call sym.imp.isatty</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> </font> 0x000059cc() ; sym.imp.isatty</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> </font><font class='tmp_offset'>0x00002801</font> <font class='tmp_other'>85<font class='tmp_other'>c0</font> </font><font class='tmp_cmp'>test<font class='tmp_reg'> eax</font>,<font class='tmp_b0xff'><font class='tmp_reg'> eax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,==< </font><font class='tmp_offset'>0x00002803</font> <font class='tmp_cjmp'>74<font class='tmp_cjmp'>60</font> </font><font class='tmp_cjmp'>je 0x2865</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x00002805</font> <font class='tmp_other'>c7<font class='tmp_other'>05<font class='tmp_cjmp'>59<font class='tmp_cjmp'>3e<font class='tmp_b0x00'>00<font class='tmp_other'>0.</font> </font><font class='tmp_mov'>mov dword<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rip</font>+<font class='tmp_b0xff'><font class='tmp_push'>0x3e59</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x50</font></font> <font class='tmp_comment'>; "P" ; 0x00000050 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x0000280f</font> <font class='tmp_cjmp'>48<font class='tmp_other'>8d<font class='tmp_cjmp'>3d<font class='tmp_other'>f3<font class='tmp_cjmp'>36<font class='tmp_other'>0.</font> </font><font class='tmp_push'>lea<font class='tmp_reg'> rdi</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rip</font>+<font class='tmp_b0xff'><font class='tmp_push'>0x36f3</font>]<font class='tmp_b0xff'></font></font> <font class='tmp_comment'>; 0x00005f09 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x00002816</font> <font class='tmp_other'>e8<font class='tmp_cjmp'>7b<font class='tmp_cjmp'>31<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call sym.imp.getenv</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> | </font> 0x00005996() ; sym.imp.getenv</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x0000281b</font> <font class='tmp_cjmp'>48<font class='tmp_other'>85<font class='tmp_other'>c0</font> </font><font class='tmp_cmp'>test<font class='tmp_reg'> rax</font>,<font class='tmp_b0xff'><font class='tmp_reg'> rax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,===< </font><font class='tmp_offset'>0x0000281e</font> <font class='tmp_cjmp'>74<font class='tmp_other'>0f</font> </font><font class='tmp_cjmp'>je 0x282f</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> || </font><font class='tmp_offset'>0x00002820</font> <font class='tmp_other'>80<font class='tmp_cjmp'>38<font class='tmp_b0x00'>00</font> </font><font class='tmp_cmp'>cmp byte<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rax</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x0</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,====< </font><font class='tmp_offset'>0x00002823</font> <font class='tmp_cjmp'>74<font class='tmp_other'>0a</font> </font><font class='tmp_cjmp'>je 0x282f</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ||| </font><font class='tmp_offset'>0x00002825</font> <font class='tmp_cjmp'>48<font class='tmp_other'>89<font class='tmp_other'>c7</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> rdi</font>,<font class='tmp_b0xff'><font class='tmp_reg'> rax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ||| </font><font class='tmp_offset'>0x00002828</font> <font class='tmp_other'>e8<font class='tmp_other'>0f<font class='tmp_cjmp'>31<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call sym.imp.atoi</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> ||| </font> 0x0000593c() ; sym.imp.atoi</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,=====< </font><font class='tmp_offset'>0x0000282d</font> <font class='tmp_other'>eb<font class='tmp_cjmp'>22</font> </font><font class='tmp_jmp'>jmp 0x2851</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> |``---> </font><font class='tmp_offset'>0x0000282f</font> <font class='tmp_cjmp'>48<font class='tmp_other'>8d<font class='tmp_cjmp'>55<font class='tmp_other'>d0</font> </font><font class='tmp_push'>lea<font class='tmp_reg'> rdx</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rbp</font>-<font class='tmp_b0xff'><font class='tmp_push'>0x30</font>]<font class='tmp_b0xff'></font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | | </font><font class='tmp_offset'>0x00002833</font> <font class='tmp_other'>bf<font class='tmp_other'>01<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> edi</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x1</font></font> <font class='tmp_comment'>; 0x00000001 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | | </font><font class='tmp_offset'>0x00002838</font> <font class='tmp_other'>be<font class='tmp_cjmp'>68<font class='tmp_cjmp'>74<font class='tmp_other'>08<font class='tmp_cjmp'>40</font> </font><font class='tmp_mov'>mov<font class='tmp_reg'> esi</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x40087468</font></font> <font class='tmp_comment'>; 0x40087468 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | | </font><font class='tmp_offset'>0x0000283d</font> <font class='tmp_cjmp'>30<font class='tmp_other'>c0</font> </font><font class='tmp_math'>xor<font class='tmp_reg'> al</font>,<font class='tmp_b0xff'><font class='tmp_reg'> al</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | | </font><font class='tmp_offset'>0x0000283f</font> <font class='tmp_other'>e8<font class='tmp_other'>82<font class='tmp_cjmp'>31<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_call'>call sym.imp.ioctl</font>
|
||||
<font class='tmp_fline'>|</font><font class='tmp_b0xff'> </font><font class='tmp_flow'> | | </font> 0x000059c6() ; sym.imp.ioctl</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | | </font><font class='tmp_offset'>0x00002844</font> <font class='tmp_other'>83<font class='tmp_other'>f8<font class='tmp_b0xff'>ff</font> </font><font class='tmp_cmp'>cmp<font class='tmp_reg'> eax</font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0xffffffff</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> ,======< </font><font class='tmp_offset'>0x00002847</font> <font class='tmp_cjmp'>74<font class='tmp_other'>0e</font> </font><font class='tmp_cjmp'>je 0x2857</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> || | </font><font class='tmp_offset'>0x00002849</font> <font class='tmp_other'>0f<font class='tmp_other'>b7<font class='tmp_cjmp'>45<font class='tmp_other'>d2</font> </font><font class='tmp_other'>movzx<font class='tmp_reg'> eax</font>,<font class='tmp_b0xff'> word<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rbp</font>-<font class='tmp_b0xff'><font class='tmp_push'>0x2e</font>]<font class='tmp_b0xff'></font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> || | </font><font class='tmp_offset'>0x0000284d</font> <font class='tmp_other'>85<font class='tmp_other'>c0</font> </font><font class='tmp_cmp'>test<font class='tmp_reg'> eax</font>,<font class='tmp_b0xff'><font class='tmp_reg'> eax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'>,=======< </font><font class='tmp_offset'>0x0000284f</font> <font class='tmp_cjmp'>74<font class='tmp_other'>06</font> </font><font class='tmp_cjmp'>je 0x2857</font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'>||`-----> </font><font class='tmp_offset'>0x00002851</font> <font class='tmp_other'>89<font class='tmp_other'>05<font class='tmp_other'>11<font class='tmp_cjmp'>3e<font class='tmp_b0x00'>00<font class='tmp_b0x00'>00</font> </font><font class='tmp_mov'>mov<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rip</font>+<font class='tmp_b0xff'><font class='tmp_push'>0x3e11</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_reg'> eax</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'>``------> </font><font class='tmp_offset'>0x00002857</font> <font class='tmp_other'>c7<font class='tmp_other'>05<font class='tmp_cjmp'>7b<font class='tmp_cjmp'>41<font class='tmp_b0x00'>00<font class='tmp_other'>0.</font> </font><font class='tmp_mov'>mov dword<font class='tmp_b0xff'> </font>[<font class='tmp_b0xff'>rip</font>+<font class='tmp_b0xff'><font class='tmp_push'>0x417b</font>]<font class='tmp_b0xff'></font>,<font class='tmp_b0xff'><font class='tmp_b0xff'> <font class='tmp_push'>0x1</font></font> <font class='tmp_comment'>; 0x00000001 </font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x00002861</font> <font class='tmp_cjmp'>31<font class='tmp_other'>db</font> </font><font class='tmp_math'>xor<font class='tmp_reg'> ebx</font>,<font class='tmp_b0xff'><font class='tmp_reg'> ebx</font></font>
|
||||
<font class='tmp_fline'>|</font> <font class='tmp_flow'> | </font><font class='tmp_offset'>0x00002863</font> <font class='tmp_other'>eb<font class='tmp_other'>1f</font> </font><font class='tmp_jmp'>jmp 0x2884</font>
|
||||
</pre>
|
||||
</div>
|
||||
</td>
|
||||
<td valign=top style='width="15%" height:100%'>
|
||||
<table id="pickers">
|
||||
<table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
|
||||
var pr2ui = parent.r2ui;
|
||||
if (pr2ui !== undefined && pr2ui !== null) r2ui = pr2ui;
|
||||
|
||||
r2ui.load_colors();
|
||||
|
||||
var props = Object.keys(r2ui.colors);
|
||||
for (var j in props) {
|
||||
var prop = props[j].replace('.ec_','');
|
||||
if (prop == "gui_background") $('.tmp_' + prop).css('background-color', r2ui.colors[props[j]]);
|
||||
else if (prop == "gui_alt_background") $('.tmp_' + prop).css('background-color', r2ui.colors[props[j]]);
|
||||
else if (prop == "gui_border") $('.tmp_' + prop).css('border-color', r2ui.colors[props[j]]);
|
||||
else $('.tmp_' + prop).css('color', r2ui.colors[props[j]]);
|
||||
}
|
||||
|
||||
var defaults = {
|
||||
showPaletteOnly: true,
|
||||
hideAfterPaletteSelect:true,
|
||||
preferredFormat: "hex3",
|
||||
change: function(color) {
|
||||
var prop = this.id.replace('_picker','');
|
||||
if (prop == "gui_background") $('.tmp_' + prop).css('background-color', color);
|
||||
else if (prop == "gui_alt_background") $('.tmp_' + prop).css('background-color', color);
|
||||
else if (prop == "gui_border") $('.tmp_' + prop).css('border-color', color);
|
||||
else $('.tmp_' + prop).css('color', color);
|
||||
r2.cmd("ec " + prop.replace("gui_", "gui.") + " rgb:" + String(color).replace('#',''));
|
||||
r2ui.load_colors();
|
||||
},
|
||||
palette: [["#000","#030","#060","#090","#0c0","#0f0"],["#003","#033","#063","#093","#0c3","#0f3"],["#006","#036","#066","#096","#0c6","#0f6"],["#009","#039","#069","#099","#0c9","#0f9"],
|
||||
["#00c","#03c","#06c","#09c","#0cc","#0fc"],["#00f","#03f","#06f","#09f","#0cf","#0ff"],["#300","#330","#360","#390","#3c0","#3f0"],["#303","#333","#363","#393","#3c3","#3f3"],
|
||||
["#306","#336","#366","#396","#3c6","#3f6"],["#309","#339","#369","#399","#3c9","#3f9"],["#30c","#33c","#36c","#39c","#3cc","#3fc"],["#30f","#33f","#36f","#39f","#3cf","#3ff"],
|
||||
["#600","#630","#660","#690","#6c0","#6f0"],["#603","#633","#663","#693","#6c3","#6f3"],["#606","#636","#666","#696","#6c6","#6f6"],["#609","#639","#669","#699","#6c9","#6f9"],
|
||||
["#60c","#63c","#66c","#69c","#6cc","#6fc"],["#60f","#63f","#66f","#69f","#6cf","#6ff"],["#900","#930","#960","#990","#9c0","#9f0"],["#903","#933","#963","#993","#9c3","#9f3"],
|
||||
["#906","#936","#966","#996","#9c6","#9f6"],["#909","#939","#969","#999","#9c9","#9f9"],["#90c","#93c","#96c","#99c","#9cc","#9fc"],["#90f","#93f","#96f","#99f","#9cf","#9ff"],
|
||||
["#c00","#c30","#c60","#c90","#cc0","#cf0"],["#c03","#c33","#c63","#c93","#cc3","#cf3"],["#c06","#c36","#c66","#c96","#cc6","#cf6"],["#c09","#c39","#c69","#c99","#cc9","#cf9"],
|
||||
["#c0c","#c3c","#c6c","#c9c","#ccc","#cfc"],["#c0f","#c3f","#c6f","#c9f","#ccf","#cff"],["#f00","#f30","#f60","#f90","#fc0","#ff0"],["#f03","#f33","#f63","#f93","#fc3","#ff3"],
|
||||
["#f06","#f36","#f66","#f96","#fc6","#ff6"],["#f09","#f39","#f69","#f99","#fc9","#ff9"],["#f0c","#f3c","#f6c","#f9c","#fcc","#ffc"],["#f0f","#f3f","#f6f","#f9f","#fcf","#fff"]]
|
||||
};
|
||||
|
||||
var props = ['comment', 'fname', 'fline', 'help', 'args', 'flag', 'label', 'flow', 'prompt' , 'offset', 'input' , 'other', 'b0x00' , 'b0x7f' , 'b0xff', 'math', 'bin', 'btext', 'push', 'pop', 'jmp', 'cjmp', 'call', 'nop', 'ret', 'trap', 'swi', 'cmp', 'reg', 'creg', 'num', 'mov', 'gui_background', 'gui_alt_background', 'gui_cflow', 'gui_dataoffset', 'gui_border'];
|
||||
|
||||
var rows = "";
|
||||
for (var i in props) rows += '<tr><td><div class="color_label">' + props[i] + ': </div></td><td><input class="picker" type="text" id="' + props[i] + '_picker"></input></td></tr>';
|
||||
$('#pickers').html(rows);
|
||||
|
||||
for (var i in props) init_picker(props[i]);
|
||||
|
||||
|
||||
function init_picker(prop) {
|
||||
color = r2ui.colors['.ec_' + prop]
|
||||
selector = '#' + prop + '_picker';
|
||||
defaults['color'] = rgb2hex(color);
|
||||
$(selector).spectrum(defaults);
|
||||
}
|
||||
|
||||
function rgb2hex(rgb){
|
||||
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
||||
return (rgb && rgb.length === 4) ? "#" +
|
||||
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[3],10).toString(16)).slice(-2) : '';
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,126 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="language" content="en" />
|
||||
|
||||
<title>radare2</title>
|
||||
<!--polyfill for joint.js-->
|
||||
<script>
|
||||
SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) {
|
||||
return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());
|
||||
};
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/layout-default-latest.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/jquery.ui.tabs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/jquery-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../enyo/disasm.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../enyo/joint.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/tree.jquery.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/main.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./lib/css/jquery.onoff.css" />
|
||||
|
||||
<script type="text/javascript" src="../enyo/js/joint.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/joint.layout.DirectedGraph.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/r2.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/r2ui.js"></script>
|
||||
<script type="text/javascript" src="../enyo/js/disasm.js"></script>
|
||||
<!--
|
||||
<script type="text/javascript" src="index.js"></script>
|
||||
-->
|
||||
<script type="text/javascript" src="./lib/js/jquery-1.9.0.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery-ui-latest.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.onoff.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/taphold.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.ui-contextmenu.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.layout-latest.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.donetyping.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/tree.jquery.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.layout.resizePaneAccordions-latest.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/jquery.scrollTo-latest.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/disasm_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/entropy_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/strings_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/hex_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/settings_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/projects_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/types_panel.js"></script>
|
||||
<script type="text/javascript" src="./lib/js/main.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- SOUTH -->
|
||||
<div id="console_panel" class="ui-layout-south ui-widget-content ui-state-error" style="display: none;background-color:rgb(20,20,20);">
|
||||
<pre id="cmd_output" class="ui-layout-content cmdconsole">
|
||||
</pre>
|
||||
<div id="cmd_input">
|
||||
<input id="command" class="cmdconsole" type="text" value=""/>
|
||||
<label for="command">r2</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CENTER -->
|
||||
<div id="main_panel" class="ui-layout-center ec_gui_background">
|
||||
<ul style="-moz-border-radius-bottomleft: 0; -moz-border-radius-bottomright: 0;overflow-x:hidden;overflow-y:scroll">
|
||||
<li><a id="disasm_tab_link" href="#disasm_tab"><span>Disassembler</span></a></li>
|
||||
<li><a href="#hex_tab"><span>Hex Dump</span></a></li>
|
||||
<li><a href="#strings_tab"><span>Strings</span></a></li>
|
||||
<li><a href="#entropy_tab"><span>Entropy</span></a></li>
|
||||
<li><a href="#types_tab"><span>Types</span></a></li>
|
||||
<li><a href="#settings_tab"><span>Settings</span></a></li>
|
||||
<li><a href="#projects_tab"><span>Projects</span></a></li>
|
||||
</ul>
|
||||
<div id="center_panel" class="ui-layout-content ui-widget-content ui-corner-bottom" style="border-top: 0; padding-bottom: 1em;">
|
||||
<div id="disasm_tab"></div>
|
||||
<div id="hex_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
<div id="strings_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
<div id="entropy_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
<div id="settings_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
<div id="projects_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
<div id="types_tab" style="background-color:rgb(20,20,20);"></div>
|
||||
</div>
|
||||
<div id="history_bar">
|
||||
<h3 class="header-footer ui-state-default ui-corner-all" style="padding: 3px 5px 5px; margin-top: 1ex;" id="history">_</h3>
|
||||
<span id="switch_button">switch view</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- WEST -->
|
||||
<div class="ui-layout-west" style="color:rgb(127,127,127);background-color:rgb(20,20,20);display: none;">
|
||||
<div class="ui-widget-header" style="border:0px solid; color: white; background:black;text-align:center">
|
||||
<a href=".."><img id="button" src="rlogo-inv.png" border=0/></a>
|
||||
</div>
|
||||
<div id="accordion1" class="basic">
|
||||
<h3 id="functions_label">Functions</h3>
|
||||
<div id="functions"></div>
|
||||
<h3 id="symbols_label">Symbols</h3>
|
||||
<div id="symbols"></div>
|
||||
<h3 id="relocs_label">Relocs</h3>
|
||||
<div id="relocs"></div>
|
||||
<h3 id="imports_label">Imports</h3>
|
||||
<div id="imports"></div>
|
||||
<h3 id="flags_label">Flags</h3>
|
||||
<div id="flags"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EAST -->
|
||||
<div class="ui-layout-east" style="color:rgb(127,127,127);background-color:rgb(20,20,20);display: none;">
|
||||
<div class="ui-layout-content">
|
||||
<div id="accordion2" class="basic">
|
||||
<h3>Information</h3>
|
||||
<div id="information"></div>
|
||||
<h3 id="sections_label">Sections</h3>
|
||||
<div id="sections"></div>
|
||||
<h3 id="notes_label">Project Notes</h3>
|
||||
<div id="notes">
|
||||
<textarea id="pnotes" style="width:100%;height:100%;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,420 +0,0 @@
|
||||
/*
|
||||
colpick Color Picker / colpick.com
|
||||
*/
|
||||
|
||||
/*Main container*/
|
||||
.colpick {
|
||||
position: absolute;
|
||||
width: 346px;
|
||||
height: 170px;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
background:#ebebeb;
|
||||
border: 1px solid #bbb;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
/*Prevents selecting text when dragging the selectors*/
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
/*Color selection box with gradients*/
|
||||
.colpick_color {
|
||||
position: absolute;
|
||||
left: 7px;
|
||||
top: 7px;
|
||||
width: 156px;
|
||||
height: 156px;
|
||||
overflow: hidden;
|
||||
outline: 1px solid #aaa;
|
||||
cursor: crosshair;
|
||||
}
|
||||
.colpick_color_overlay1 {
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
width: 156px;
|
||||
height: 156px;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; /* IE8 */
|
||||
background: -moz-linear-gradient(left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(left, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
|
||||
background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */
|
||||
}
|
||||
.colpick_color_overlay2 {
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
width: 156px;
|
||||
height: 156px;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; /* IE8 */
|
||||
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
/*Circular color selector*/
|
||||
.colpick_selector_outer {
|
||||
background:none;
|
||||
position: absolute;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
margin: -6px 0 0 -6px;
|
||||
border: 1px solid black;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.colpick_selector_inner{
|
||||
position: absolute;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border: 1px solid white;
|
||||
border-radius: 50%;
|
||||
}
|
||||
/*Vertical hue bar*/
|
||||
.colpick_hue {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 175px;
|
||||
width: 19px;
|
||||
height: 156px;
|
||||
border: 1px solid #aaa;
|
||||
cursor: n-resize;
|
||||
}
|
||||
/*Hue bar sliding indicator*/
|
||||
.colpick_hue_arrs {
|
||||
position: absolute;
|
||||
left: -8px;
|
||||
width: 35px;
|
||||
height: 7px;
|
||||
margin: -7px 0 0 0;
|
||||
}
|
||||
.colpick_hue_larr {
|
||||
position:absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-left: 7px solid #858585;
|
||||
}
|
||||
.colpick_hue_rarr {
|
||||
position:absolute;
|
||||
right:0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-right: 7px solid #858585;
|
||||
}
|
||||
/*New color box*/
|
||||
.colpick_new_color {
|
||||
position: absolute;
|
||||
left: 207px;
|
||||
top: 6px;
|
||||
width: 60px;
|
||||
height: 27px;
|
||||
background: #f00;
|
||||
border: 1px solid #8f8f8f;
|
||||
}
|
||||
/*Current color box*/
|
||||
.colpick_current_color {
|
||||
position: absolute;
|
||||
left: 277px;
|
||||
top: 6px;
|
||||
width: 60px;
|
||||
height: 27px;
|
||||
background: #f00;
|
||||
border: 1px solid #8f8f8f;
|
||||
}
|
||||
/*Input field containers*/
|
||||
.colpick_field, .colpick_hex_field {
|
||||
position: absolute;
|
||||
height: 20px;
|
||||
width: 60px;
|
||||
overflow:hidden;
|
||||
background:#f3f3f3;
|
||||
color:#b8b8b8;
|
||||
font-size:12px;
|
||||
border:1px solid #bdbdbd;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.colpick_rgb_r {
|
||||
top: 40px;
|
||||
left: 207px;
|
||||
}
|
||||
.colpick_rgb_g {
|
||||
top: 67px;
|
||||
left: 207px;
|
||||
}
|
||||
.colpick_rgb_b {
|
||||
top: 94px;
|
||||
left: 207px;
|
||||
}
|
||||
.colpick_hsb_h {
|
||||
top: 40px;
|
||||
left: 277px;
|
||||
}
|
||||
.colpick_hsb_s {
|
||||
top: 67px;
|
||||
left: 277px;
|
||||
}
|
||||
.colpick_hsb_b {
|
||||
top: 94px;
|
||||
left: 277px;
|
||||
}
|
||||
.colpick_hex_field {
|
||||
width: 68px;
|
||||
left: 207px;
|
||||
top: 121px;
|
||||
}
|
||||
/*Text field container on focus*/
|
||||
.colpick_focus {
|
||||
border-color: #999;
|
||||
}
|
||||
/*Field label container*/
|
||||
.colpick_field_letter {
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
padding-left: 4px;
|
||||
background: #efefef;
|
||||
border-right: 1px solid #bdbdbd;
|
||||
font-weight: bold;
|
||||
color:#777;
|
||||
}
|
||||
/*Text inputs*/
|
||||
.colpick_field input, .colpick_hex_field input {
|
||||
position: absolute;
|
||||
right: 11px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #555;
|
||||
text-align: right;
|
||||
outline: none;
|
||||
}
|
||||
.colpick_hex_field input {
|
||||
right: 4px;
|
||||
}
|
||||
/*Field up/down arrows*/
|
||||
.colpick_field_arrs {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 9px;
|
||||
height: 21px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colpick_field_uarr {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-bottom: 4px solid #959595;
|
||||
}
|
||||
.colpick_field_darr {
|
||||
position: absolute;
|
||||
bottom:5px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 4px solid #959595;
|
||||
}
|
||||
/*Submit/Select button*/
|
||||
.colpick_submit {
|
||||
position: absolute;
|
||||
left: 207px;
|
||||
top: 149px;
|
||||
width: 130px;
|
||||
height: 22px;
|
||||
line-height:22px;
|
||||
background: #efefef;
|
||||
text-align: center;
|
||||
color: #555;
|
||||
font-size: 12px;
|
||||
font-weight:bold;
|
||||
border: 1px solid #bdbdbd;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.colpick_submit:hover {
|
||||
background:#f3f3f3;
|
||||
border-color:#999;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*full layout with no submit button*/
|
||||
.colpick_full_ns .colpick_submit, .colpick_full_ns .colpick_current_color{
|
||||
display:none;
|
||||
}
|
||||
.colpick_full_ns .colpick_new_color {
|
||||
width: 130px;
|
||||
height: 25px;
|
||||
}
|
||||
.colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsb_h {
|
||||
top: 42px;
|
||||
}
|
||||
.colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsb_s {
|
||||
top: 73px;
|
||||
}
|
||||
.colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsb_b {
|
||||
top: 104px;
|
||||
}
|
||||
.colpick_full_ns .colpick_hex_field {
|
||||
top: 135px;
|
||||
}
|
||||
|
||||
/*rgbhex layout*/
|
||||
.colpick_rgbhex .colpick_hsb_h, .colpick_rgbhex .colpick_hsb_s, .colpick_rgbhex .colpick_hsb_b {
|
||||
display:none;
|
||||
}
|
||||
.colpick_rgbhex {
|
||||
width:282px;
|
||||
}
|
||||
.colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit {
|
||||
width:68px;
|
||||
}
|
||||
.colpick_rgbhex .colpick_new_color {
|
||||
width:34px;
|
||||
border-right:none;
|
||||
}
|
||||
.colpick_rgbhex .colpick_current_color {
|
||||
width:34px;
|
||||
left:240px;
|
||||
border-left:none;
|
||||
}
|
||||
|
||||
/*rgbhex layout, no submit button*/
|
||||
.colpick_rgbhex_ns .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{
|
||||
display:none;
|
||||
}
|
||||
.colpick_rgbhex_ns .colpick_new_color{
|
||||
width:68px;
|
||||
border: 1px solid #8f8f8f;
|
||||
}
|
||||
.colpick_rgbhex_ns .colpick_rgb_r {
|
||||
top: 42px;
|
||||
}
|
||||
.colpick_rgbhex_ns .colpick_rgb_g {
|
||||
top: 73px;
|
||||
}
|
||||
.colpick_rgbhex_ns .colpick_rgb_b {
|
||||
top: 104px;
|
||||
}
|
||||
.colpick_rgbhex_ns .colpick_hex_field {
|
||||
top: 135px;
|
||||
}
|
||||
|
||||
/*hex layout*/
|
||||
.colpick_hex .colpick_hsb_h, .colpick_hex .colpick_hsb_s, .colpick_hex .colpick_hsb_b, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b {
|
||||
display:none;
|
||||
}
|
||||
.colpick_hex {
|
||||
width:206px;
|
||||
height:201px;
|
||||
}
|
||||
.colpick_hex .colpick_hex_field {
|
||||
width:72px;
|
||||
height:25px;
|
||||
top:168px;
|
||||
left:80px;
|
||||
}
|
||||
.colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
}
|
||||
.colpick_hex .colpick_new_color {
|
||||
left:9px;
|
||||
top:168px;
|
||||
width:30px;
|
||||
border-right:none;
|
||||
}
|
||||
.colpick_hex .colpick_current_color {
|
||||
left:39px;
|
||||
top:168px;
|
||||
width:30px;
|
||||
border-left:none;
|
||||
}
|
||||
.colpick_hex .colpick_submit {
|
||||
left:164px;
|
||||
top: 168px;
|
||||
width:30px;
|
||||
height:25px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
/*hex layout, no submit button*/
|
||||
.colpick_hex_ns .colpick_submit, .colpick_hex_ns .colpick_current_color {
|
||||
display:none;
|
||||
}
|
||||
.colpick_hex_ns .colpick_hex_field {
|
||||
width:80px;
|
||||
}
|
||||
.colpick_hex_ns .colpick_new_color{
|
||||
width:60px;
|
||||
border: 1px solid #8f8f8f;
|
||||
}
|
||||
|
||||
/*Dark color scheme*/
|
||||
.colpick_dark {
|
||||
background: #161616;
|
||||
border-color: #2a2a2a;
|
||||
}
|
||||
.colpick_dark .colpick_color {
|
||||
outline-color: #333;
|
||||
}
|
||||
.colpick_dark .colpick_hue {
|
||||
border-color: #555;
|
||||
}
|
||||
.colpick_dark .colpick_field, .colpick_dark .colpick_hex_field {
|
||||
background: #101010;
|
||||
border-color: #2d2d2d;
|
||||
}
|
||||
.colpick_dark .colpick_field_letter {
|
||||
background: #131313;
|
||||
border-color: #2d2d2d;
|
||||
color: #696969;
|
||||
}
|
||||
.colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input {
|
||||
color: #7a7a7a;
|
||||
}
|
||||
.colpick_dark .colpick_field_uarr {
|
||||
border-bottom-color:#696969;
|
||||
}
|
||||
.colpick_dark .colpick_field_darr {
|
||||
border-top-color:#696969;
|
||||
}
|
||||
.colpick_dark .colpick_focus {
|
||||
border-color:#444;
|
||||
}
|
||||
.colpick_dark .colpick_submit {
|
||||
background: #131313;
|
||||
border-color:#2d2d2d;
|
||||
color:#7a7a7a;
|
||||
}
|
||||
.colpick_dark .colpick_submit:hover {
|
||||
background-color:#101010;
|
||||
border-color:#444;
|
||||
}
|
66
shlr/www/p/lib/css/jquery-ui.css
vendored
@ -1,66 +0,0 @@
|
||||
|
||||
.ui-menu {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/*margin: 50px 50px;*/
|
||||
display: block;
|
||||
outline: none;
|
||||
background: #c0c0c0;
|
||||
width: 200px;
|
||||
border: 1px solid #AAA;
|
||||
color: #222;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
|
||||
.ui-menu .ui-menu {
|
||||
position: absolute;
|
||||
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
font-family: monospace;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 3px 1em 3px .4em;
|
||||
cursor: pointer;
|
||||
min-height: 0; /* support: IE7 */
|
||||
}
|
||||
.ui-menu .ui-menu-item:hover {
|
||||
font-family: monospace;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
background: yellow;
|
||||
padding: 3px 1em 3px .4em;
|
||||
cursor: pointer;
|
||||
min-height: 0; /* support: IE7 */
|
||||
}
|
||||
|
||||
.ui-menu .ui-menu-item a {
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ui-menu .ui-menu-item a:visited {
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ui-menu .ui-menu-divider {
|
||||
margin: 5px 0;
|
||||
height: 0;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
border-width: 1px 0 0 0;
|
||||
}
|
||||
.ui-menu .ui-state-focus,
|
||||
.ui-menu .ui-state-active {
|
||||
margin: -1px;
|
||||
}
|
||||
|
||||
.ui-menu kbd {
|
||||
padding-left: 1em;
|
||||
float: right;
|
||||
}
|
||||
|
@ -1,83 +0,0 @@
|
||||
/**
|
||||
* onoff.css
|
||||
* Author: http://proto.io/freebies/onoff/
|
||||
* Author: Timmy Willison
|
||||
*/
|
||||
.onoffswitch {
|
||||
position: relative;
|
||||
width: 70px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.onoffswitch-checkbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.onoffswitch-label {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border: 2px solid #999999;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.onoffswitch-inner {
|
||||
display: block;
|
||||
width: 200%;
|
||||
margin-left: -100%;
|
||||
-webkit-transition: margin 0.2s ease-in;
|
||||
transition: margin 0.2s ease-in;
|
||||
}
|
||||
|
||||
.onoffswitch-inner:before, .onoffswitch-inner:after {
|
||||
float: left;
|
||||
padding: 0;
|
||||
width: 50%;
|
||||
height: 26px;
|
||||
color: white;
|
||||
font: bold 14px/26px Trebuchet, Arial, sans-serif;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.onoffswitch-inner:before {
|
||||
content: "YES";
|
||||
padding-left: 10px;
|
||||
color: #FFFFFF;
|
||||
background-color: #464746;
|
||||
}
|
||||
|
||||
.onoffswitch-inner:after {
|
||||
content: "NO";
|
||||
padding-right: 10px;
|
||||
color: #999999;
|
||||
background-color: #EEEEEE;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.onoffswitch-switch {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 40px;
|
||||
width: 18px;
|
||||
margin: 4px;
|
||||
background: white;
|
||||
border: 2px solid #999999;
|
||||
border-radius: 20px;
|
||||
-webkit-transition: right 0.2s ease-in, -webkit-box-shadow 0.2s ease-in;
|
||||
transition: right 0.2s ease-in, box-shadow 0.2s ease-in;
|
||||
}
|
||||
|
||||
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
|
||||
right: 0;
|
||||
}
|
52
shlr/www/p/lib/css/jquery.ui.tabs.css
vendored
@ -1,52 +0,0 @@
|
||||
/*!
|
||||
* jQuery UI Tabs 1.10.0
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs#theming
|
||||
*/
|
||||
.ui-tabs {
|
||||
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
padding: .2em;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav {
|
||||
margin: 0;
|
||||
padding: .2em .2em 0;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
position: relative;
|
||||
top: 0;
|
||||
margin: 1px .2em 0 0;
|
||||
border-bottom: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li a {
|
||||
float: left;
|
||||
padding: .5em 1em;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
|
||||
margin-bottom: -1px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
|
||||
.ui-tabs .ui-tabs-nav li.ui-state-disabled a,
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
|
||||
cursor: text;
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
display: block;
|
||||
border-width: 0;
|
||||
padding: 1em 1.4em;
|
||||
background: none;
|
||||
}
|
@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Default Layout Theme
|
||||
*
|
||||
* Created for jquery.layout
|
||||
*
|
||||
* Copyright (c) 2010
|
||||
* Fabrizio Balliano (http://www.fabrizioballiano.net)
|
||||
* Kevin Dalman (http://allpro.net)
|
||||
*
|
||||
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
|
||||
*
|
||||
* Last Updated: 2010-02-10
|
||||
* NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars
|
||||
*/
|
||||
|
||||
/*
|
||||
* DEFAULT FONT
|
||||
* Just to make demo-pages look better - not actually relevant to Layout!
|
||||
*/
|
||||
body {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 100%;
|
||||
*font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
* PANES & CONTENT-DIVs
|
||||
*/
|
||||
.ui-layout-pane { /* all 'panes' */
|
||||
border: 1px solid #BBB;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
/* DO NOT add scrolling (or padding) to 'panes' that have a content-div,
|
||||
otherwise you may get double-scrollbars - on the pane AND on the content-div
|
||||
- use ui-layout-wrapper class if pane has a content-div
|
||||
- use ui-layout-container if pane has an inner-layout
|
||||
*/
|
||||
}
|
||||
/* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */
|
||||
.ui-layout-content {
|
||||
padding: 10px;
|
||||
position: relative; /* contain floated or positioned elements */
|
||||
overflow: auto; /* add scrolling to content-div */
|
||||
}
|
||||
|
||||
/*
|
||||
* UTILITY CLASSES
|
||||
* Must come AFTER pane-class above so will override
|
||||
* These classes are NOT auto-generated and are NOT used by Layout
|
||||
*/
|
||||
.layout-child-container,
|
||||
.layout-content-container {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.layout-child-container {
|
||||
border: 0; /* remove border because inner-layout-panes probably have borders */
|
||||
}
|
||||
.layout-scroll {
|
||||
overflow: auto;
|
||||
}
|
||||
.layout-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*
|
||||
* RESIZER-BARS
|
||||
*/
|
||||
.ui-layout-resizer { /* all 'resizer-bars' */
|
||||
background: #DDD;
|
||||
border: 1px solid #BBB;
|
||||
border-width: 0;
|
||||
}
|
||||
.ui-layout-resizer-drag { /* REAL resizer while resize in progress */
|
||||
}
|
||||
.ui-layout-resizer-hover { /* affects both open and closed states */
|
||||
}
|
||||
/* NOTE: It looks best when 'hover' and 'dragging' are set to the same color,
|
||||
otherwise color shifts while dragging when bar can't keep up with mouse */
|
||||
.ui-layout-resizer-open-hover , /* hover-color to 'resize' */
|
||||
.ui-layout-resizer-dragging { /* resizer beging 'dragging' */
|
||||
background: #C4E1A4;
|
||||
}
|
||||
.ui-layout-resizer-dragging { /* CLONED resizer being dragged */
|
||||
border: 1px solid #BBB;
|
||||
}
|
||||
.ui-layout-resizer-north-dragging,
|
||||
.ui-layout-resizer-south-dragging {
|
||||
border-width: 1px 0;
|
||||
}
|
||||
.ui-layout-resizer-west-dragging,
|
||||
.ui-layout-resizer-east-dragging {
|
||||
border-width: 0 1px;
|
||||
}
|
||||
/* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */
|
||||
.ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */
|
||||
background: #E1A4A4; /* red */
|
||||
}
|
||||
|
||||
.ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */
|
||||
background: #EBD5AA;
|
||||
}
|
||||
.ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */
|
||||
opacity: .10; /* show only a slight shadow */
|
||||
filter: alpha(opacity=10);
|
||||
}
|
||||
.ui-layout-resizer-sliding-hover { /* sliding resizer - hover */
|
||||
opacity: 1.00; /* on-hover, show the resizer-bar normally */
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
/* sliding resizer - add 'outside-border' to resizer on-hover
|
||||
* this sample illustrates how to target specific panes and states */
|
||||
.ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; }
|
||||
.ui-layout-resizer-south-sliding-hover { border-top-width: 1px; }
|
||||
.ui-layout-resizer-west-sliding-hover { border-right-width: 1px; }
|
||||
.ui-layout-resizer-east-sliding-hover { border-left-width: 1px; }
|
||||
|
||||
/*
|
||||
* TOGGLER-BUTTONS
|
||||
*/
|
||||
.ui-layout-toggler {
|
||||
border: 1px solid #BBB; /* match pane-border */
|
||||
background-color: #BBB;
|
||||
}
|
||||
.ui-layout-resizer-hover .ui-layout-toggler {
|
||||
opacity: .60;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
.ui-layout-toggler-hover , /* need when NOT resizable */
|
||||
.ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */
|
||||
background-color: #FC6;
|
||||
opacity: 1.00;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.ui-layout-toggler-north ,
|
||||
.ui-layout-toggler-south {
|
||||
border-width: 0 1px; /* left/right borders */
|
||||
}
|
||||
.ui-layout-toggler-west ,
|
||||
.ui-layout-toggler-east {
|
||||
border-width: 1px 0; /* top/bottom borders */
|
||||
}
|
||||
/* hide the toggler-button when the pane is 'slid open' */
|
||||
.ui-layout-resizer-sliding .ui-layout-toggler {
|
||||
display: none;
|
||||
}
|
||||
/*
|
||||
* style the text we put INSIDE the togglers
|
||||
*/
|
||||
.ui-layout-toggler .content {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */
|
||||
}
|
||||
|
||||
/*
|
||||
* PANE-MASKS
|
||||
* these styles are hard-coded on mask elems, but are also
|
||||
* included here as !important to ensure will overrides any generic styles
|
||||
*/
|
||||
.ui-layout-mask {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
overflow: hidden !important;
|
||||
position: absolute !important;
|
||||
opacity: 0 !important;
|
||||
filter: Alpha(Opacity="0") !important;
|
||||
}
|
||||
.ui-layout-mask-inside-pane { /* masks always inside pane EXCEPT when pane is an iframe */
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
div.ui-layout-mask {} /* standard mask for iframes */
|
||||
iframe.ui-layout-mask {} /* extra mask for objects/applets */
|
||||
|
||||
/*
|
||||
* Default printing styles
|
||||
*/
|
||||
@media print {
|
||||
/*
|
||||
* Unless you want to print the layout as it appears onscreen,
|
||||
* these html/body styles are needed to allow the content to 'flow'
|
||||
*/
|
||||
html {
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
body.ui-layout-container {
|
||||
position: static !important;
|
||||
top: auto !important;
|
||||
bottom: auto !important;
|
||||
left: auto !important;
|
||||
right: auto !important;
|
||||
/* only IE6 has container width & height set by Layout */
|
||||
_width: auto !important;
|
||||
_height: auto !important;
|
||||
}
|
||||
.ui-layout-resizer, .ui-layout-toggler {
|
||||
display: none !important;
|
||||
}
|
||||
/*
|
||||
* Default pane print styles disables positioning, borders and backgrounds.
|
||||
* You can modify these styles however it suit your needs.
|
||||
*/
|
||||
.ui-layout-pane {
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
bottom: auto !important;
|
||||
left: auto !important;
|
||||
right: auto !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
}
|
||||
|
@ -1,296 +0,0 @@
|
||||
|
||||
/* CUSTOMIZE/OVERRIDE THE DEFAULT CSS */
|
||||
/* remove padding and scrolling from elements that contain an Accordion OR a content-div */
|
||||
.ui-layout-center , /* has content-div */
|
||||
.ui-layout-west , /* has Accordion */
|
||||
.ui-layout-east , /* has content-div ... */
|
||||
.ui-layout-east .ui-layout-content { /* content-div has Accordion */
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ui-layout-center P.ui-layout-content {
|
||||
line-height: 1.4em;
|
||||
margin: 0; /* remove top/bottom margins from <P> used as content-div */
|
||||
}
|
||||
|
||||
.ui-layout-resizer {
|
||||
background-color: #373737 !important;
|
||||
|
||||
}
|
||||
|
||||
.ui-layout-east h4 { /* Footer in East-pane */
|
||||
font-size: 0.9em;
|
||||
font-weight: normal;
|
||||
/*border-width: 1px 0 0;*/
|
||||
}
|
||||
|
||||
.ui-layout-pane {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.ui-layout-toggler {
|
||||
background-color: #797979 !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.ui-layout-center {
|
||||
/* remove default padding on center-pane so tabs widget fills it */
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ui-helper-clearfix:before,
|
||||
.ui-helper-clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
}
|
||||
.ui-helper-clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
.ui-helper-clearfix {
|
||||
min-height: 0;
|
||||
support: IE7
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-nav {
|
||||
font-size: 0.8em;
|
||||
background: #c0c0c0;
|
||||
border: 1px solid #797979;
|
||||
color: rgb(89, 89, 89);
|
||||
border-width: 0 0 1px;
|
||||
padding: 7px 10px;
|
||||
height: 17px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-nav li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
position: relative;
|
||||
top: 0;
|
||||
margin: 1px .2em 0 0;
|
||||
border-bottom: 0;
|
||||
padding: 0px 25px;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
background-color: #c0c0c0;
|
||||
height: 20px;
|
||||
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-nav li a {
|
||||
float: left;
|
||||
padding: 0px;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ui-widget-header {
|
||||
border: 1px solid #aaaaaa;
|
||||
background: #cccccc;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li.ui-tabs-active a {
|
||||
/*color: rgb(107, 105, 9);*/
|
||||
color:white;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.ui-tabs-nav li.ui-tabs-active {
|
||||
background-color: rgb(127,127,127);
|
||||
border-bottom: 10px solid rgb(127,127,127);
|
||||
border-top: 10px solid rgb(127,127,127);
|
||||
height: 14px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
padding: 1em 0em;
|
||||
}
|
||||
|
||||
.entry {
|
||||
font-size: 0.8em;
|
||||
padding: 0px 0px 0px 10px;
|
||||
|
||||
}
|
||||
|
||||
.jqtree-tree {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.jqtree-tree .jqtree-element {
|
||||
margin: -0.2em 0;
|
||||
font-family: monospace;
|
||||
cursor: auto;
|
||||
padding: 0px 5px;
|
||||
}
|
||||
|
||||
.jqtree-tree .jqtree-folder {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.jqtree-tree .jqtree-title {
|
||||
color: rgb(127,127,127);
|
||||
margin-left: 1em;
|
||||
}
|
||||
.jqtree-tree .jqtree-toggler {
|
||||
color: rgb(127,127,127);
|
||||
font-size: 0.8em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.jqtree-tree .autohighlighti {
|
||||
background-color: rgb(127, 127, 127);
|
||||
color: rgb(20,20,20);
|
||||
}
|
||||
|
||||
.history.autohighlighti {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.hex .autohighlighti {
|
||||
background-color: yellow;
|
||||
color: rgb(20,20,20);
|
||||
}
|
||||
|
||||
.history_idx {
|
||||
background-color: rgb(127,127,127) !important;
|
||||
border-bottom: 6px solid rgb(127,127,127);
|
||||
border-top: 4px solid rgb(127,127,127);
|
||||
border-right: 3px solid rgb(127,127,127);
|
||||
border-left: 3px solid rgb(127,127,127);
|
||||
height: 14px;
|
||||
margin-top: -10px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
h3, h4 { /* Headers & Footer in Center & East panes */
|
||||
font-size: 0.8em;
|
||||
background: #c0c0c0;
|
||||
border: 1px solid #797979;
|
||||
color: rgb(89, 89, 89);
|
||||
border-width: 0 0 1px;
|
||||
padding: 7px 10px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
#center_panel {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
#command {
|
||||
background: #c0c0c0;
|
||||
border: 1px solid #797979;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
/*font-size: 0.4em;*/
|
||||
padding: 5px;
|
||||
width: 99%;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
#cmd_output {
|
||||
/*font-size: 0.8em;*/
|
||||
color: rgb(127,127,127);
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
#cmd_output > p {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#history {
|
||||
background: #c0c0c0;
|
||||
padding: 3px 5px;
|
||||
/*font-size: 0.4em;*/
|
||||
}
|
||||
|
||||
#information {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#cmd_input {
|
||||
position: relative;
|
||||
}
|
||||
#cmd_input > label {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
bottom: 0;
|
||||
right: 30px;
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
#history_bar > h3 {
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
#history_bar > span {
|
||||
position: absolute;
|
||||
vertical-align: middle;
|
||||
background-color: #c0c0c0;
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
bottom: 1px;
|
||||
right: 0px;
|
||||
width: 12%;
|
||||
height:22px;
|
||||
text-align:right;
|
||||
padding-right: 5px;
|
||||
cursor: pointer;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/*Hex panel */
|
||||
.hex {
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
width: 650px;
|
||||
height: 100%;
|
||||
}
|
||||
.hexdump {
|
||||
float: left;
|
||||
line-height: 20px;
|
||||
width: 340px;
|
||||
}
|
||||
|
||||
/*Hex panel */
|
||||
.hex {
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
width: 650px;
|
||||
height: 100%;
|
||||
}
|
||||
.hexdump {
|
||||
float: left;
|
||||
line-height: 20px;
|
||||
width: 340px;
|
||||
}
|
||||
.hextext {
|
||||
float: left;
|
||||
line-height: 20px;
|
||||
width: 140px;
|
||||
color: white;
|
||||
}
|
||||
.hexoffset {
|
||||
float: left;
|
||||
line-height: 20px;
|
||||
padding-right: 30px;
|
||||
text-align: right;
|
||||
width: 100px;
|
||||
}
|
@ -1,507 +0,0 @@
|
||||
/***
|
||||
Spectrum Colorpicker v1.5.2
|
||||
https://github.com/bgrins/spectrum
|
||||
Author: Brian Grinstead
|
||||
License: MIT
|
||||
***/
|
||||
|
||||
.sp-container {
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
display:inline-block;
|
||||
*display: inline;
|
||||
*zoom: 1;
|
||||
/* https://github.com/bgrins/spectrum/issues/40 */
|
||||
z-index: 9999994;
|
||||
overflow: hidden;
|
||||
}
|
||||
.sp-container.sp-flat {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Fix for * { box-sizing: border-box; } */
|
||||
.sp-container,
|
||||
.sp-container * {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
|
||||
.sp-top {
|
||||
position:relative;
|
||||
width: 100%;
|
||||
display:inline-block;
|
||||
}
|
||||
.sp-top-inner {
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
}
|
||||
.sp-color {
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:20%;
|
||||
}
|
||||
.sp-hue {
|
||||
position: absolute;
|
||||
top:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
left:84%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.sp-clear-enabled .sp-hue {
|
||||
top:33px;
|
||||
height: 77.5%;
|
||||
}
|
||||
|
||||
.sp-fill {
|
||||
padding-top: 80%;
|
||||
}
|
||||
.sp-sat, .sp-val {
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.sp-alpha-enabled .sp-top {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.sp-alpha-enabled .sp-alpha {
|
||||
display: block;
|
||||
}
|
||||
.sp-alpha-handle {
|
||||
position:absolute;
|
||||
top:-4px;
|
||||
bottom: -4px;
|
||||
width: 6px;
|
||||
left: 50%;
|
||||
cursor: pointer;
|
||||
border: 1px solid black;
|
||||
background: white;
|
||||
opacity: .8;
|
||||
}
|
||||
.sp-alpha {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: -14px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 8px;
|
||||
}
|
||||
.sp-alpha-inner {
|
||||
border: solid 1px #333;
|
||||
}
|
||||
|
||||
.sp-clear {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sp-clear.sp-clear-display {
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.sp-clear-enabled .sp-clear {
|
||||
display: block;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
right:0;
|
||||
bottom:0;
|
||||
left:84%;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
/* Don't allow text selection */
|
||||
.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
|
||||
-webkit-user-select:none;
|
||||
-moz-user-select: -moz-none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.sp-container.sp-input-disabled .sp-input-container {
|
||||
display: none;
|
||||
}
|
||||
.sp-container.sp-buttons-disabled .sp-button-container {
|
||||
display: none;
|
||||
}
|
||||
.sp-container.sp-palette-buttons-disabled .sp-palette-button-container {
|
||||
display: none;
|
||||
}
|
||||
.sp-palette-only .sp-picker-container {
|
||||
display: none;
|
||||
}
|
||||
.sp-palette-disabled .sp-palette-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sp-initial-disabled .sp-initial {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
|
||||
.sp-sat {
|
||||
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
|
||||
background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
|
||||
background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
|
||||
background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
|
||||
background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
|
||||
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
|
||||
filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
|
||||
}
|
||||
.sp-val {
|
||||
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
|
||||
background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
|
||||
background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
|
||||
background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
|
||||
background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
|
||||
background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
|
||||
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
|
||||
}
|
||||
|
||||
.sp-hue {
|
||||
background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
|
||||
background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
|
||||
}
|
||||
|
||||
/* IE filters do not support multiple color stops.
|
||||
Generate 6 divs, line them up, and do two color gradients for each.
|
||||
Yes, really.
|
||||
*/
|
||||
.sp-1 {
|
||||
height:17%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
|
||||
}
|
||||
.sp-2 {
|
||||
height:16%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
|
||||
}
|
||||
.sp-3 {
|
||||
height:17%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
|
||||
}
|
||||
.sp-4 {
|
||||
height:17%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
|
||||
}
|
||||
.sp-5 {
|
||||
height:16%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
|
||||
}
|
||||
.sp-6 {
|
||||
height:17%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
|
||||
}
|
||||
|
||||
.sp-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Clearfix hack */
|
||||
.sp-cf:before, .sp-cf:after { content: ""; display: table; }
|
||||
.sp-cf:after { clear: both; }
|
||||
.sp-cf { *zoom: 1; }
|
||||
|
||||
/* Mobile devices, make hue slider bigger so it is easier to slide */
|
||||
@media (max-device-width: 480px) {
|
||||
.sp-color { right: 40%; }
|
||||
.sp-hue { left: 63%; }
|
||||
.sp-fill { padding-top: 60%; }
|
||||
}
|
||||
.sp-dragger {
|
||||
border-radius: 5px;
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
border: 1px solid #fff;
|
||||
background: #000;
|
||||
cursor: pointer;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
}
|
||||
.sp-slider {
|
||||
position: absolute;
|
||||
top:0;
|
||||
cursor:pointer;
|
||||
height: 3px;
|
||||
left: -1px;
|
||||
right: -1px;
|
||||
border: 1px solid #000;
|
||||
background: white;
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
/*
|
||||
Theme authors:
|
||||
Here are the basic themeable display options (colors, fonts, global widths).
|
||||
See http://bgrins.github.io/spectrum/themes/ for instructions.
|
||||
*/
|
||||
|
||||
.sp-container {
|
||||
border-radius: 0;
|
||||
background-color: #ECECEC;
|
||||
border: solid 1px #f0c49B;
|
||||
padding: 0;
|
||||
}
|
||||
.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear {
|
||||
font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.sp-top {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.sp-color, .sp-hue, .sp-clear {
|
||||
border: solid 1px #666;
|
||||
}
|
||||
|
||||
/* Input */
|
||||
.sp-input-container {
|
||||
float:right;
|
||||
width: 100px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.sp-initial-disabled .sp-input-container {
|
||||
width: 100%;
|
||||
}
|
||||
.sp-input {
|
||||
font-size: 12px !important;
|
||||
border: 1px inset;
|
||||
padding: 4px 5px;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
background:transparent;
|
||||
border-radius: 3px;
|
||||
color: #222;
|
||||
}
|
||||
.sp-input:focus {
|
||||
border: 1px solid orange;
|
||||
}
|
||||
.sp-input.sp-validation-error {
|
||||
border: 1px solid red;
|
||||
background: #fdd;
|
||||
}
|
||||
.sp-picker-container , .sp-palette-container {
|
||||
float:left;
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
padding-bottom: 300px;
|
||||
margin-bottom: -290px;
|
||||
}
|
||||
.sp-picker-container {
|
||||
width: 172px;
|
||||
border-left: solid 1px #fff;
|
||||
}
|
||||
|
||||
/* Palettes */
|
||||
.sp-palette-container {
|
||||
border-right: solid 1px #ccc;
|
||||
}
|
||||
|
||||
.sp-palette-only .sp-palette-container {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.sp-palette .sp-thumb-el {
|
||||
display: block;
|
||||
position:relative;
|
||||
float:left;
|
||||
width: 24px;
|
||||
height: 15px;
|
||||
margin: 3px;
|
||||
cursor: pointer;
|
||||
border:solid 2px transparent;
|
||||
}
|
||||
.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
|
||||
border-color: orange;
|
||||
}
|
||||
.sp-thumb-el {
|
||||
position:relative;
|
||||
}
|
||||
|
||||
/* Initial */
|
||||
.sp-initial {
|
||||
float: left;
|
||||
border: solid 1px #333;
|
||||
}
|
||||
.sp-initial span {
|
||||
width: 30px;
|
||||
height: 25px;
|
||||
border:none;
|
||||
display:block;
|
||||
float:left;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.sp-initial .sp-clear-display {
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.sp-palette-button-container,
|
||||
.sp-button-container {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Replacer (the little preview div that shows up instead of the <input>) */
|
||||
.sp-replacer {
|
||||
margin:0;
|
||||
overflow:hidden;
|
||||
cursor:pointer;
|
||||
padding: 4px;
|
||||
display:inline-block;
|
||||
*zoom: 1;
|
||||
*display: inline;
|
||||
border: solid 1px #91765d;
|
||||
background: #eee;
|
||||
color: #333;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.sp-replacer:hover, .sp-replacer.sp-active {
|
||||
border-color: #F0C49B;
|
||||
color: #111;
|
||||
}
|
||||
.sp-replacer.sp-disabled {
|
||||
cursor:default;
|
||||
border-color: silver;
|
||||
color: silver;
|
||||
}
|
||||
.sp-dd {
|
||||
padding: 2px 0;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
float:left;
|
||||
font-size:10px;
|
||||
}
|
||||
.sp-preview {
|
||||
position:relative;
|
||||
width:25px;
|
||||
height: 20px;
|
||||
border: solid 1px #222;
|
||||
margin-right: 5px;
|
||||
float:left;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.sp-palette {
|
||||
*width: 220px;
|
||||
max-width: 220px;
|
||||
}
|
||||
.sp-palette .sp-thumb-el {
|
||||
width:16px;
|
||||
height: 16px;
|
||||
margin:2px 1px;
|
||||
border: solid 1px #d0d0d0;
|
||||
}
|
||||
|
||||
.sp-container {
|
||||
padding-bottom:0;
|
||||
}
|
||||
|
||||
|
||||
/* Buttons: http://hellohappy.org/css3-buttons/ */
|
||||
.sp-container button {
|
||||
background-color: #eeeeee;
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
|
||||
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
|
||||
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
|
||||
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
|
||||
background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: 1px solid #bbb;
|
||||
border-radius: 3px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
padding: 5px 4px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #eee;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.sp-container button:hover {
|
||||
background-color: #dddddd;
|
||||
background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
|
||||
background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
|
||||
background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
|
||||
background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
|
||||
background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
|
||||
border: 1px solid #bbb;
|
||||
border-bottom: 1px solid #999;
|
||||
cursor: pointer;
|
||||
text-shadow: 0 1px 0 #ddd;
|
||||
}
|
||||
.sp-container button:active {
|
||||
border: 1px solid #aaa;
|
||||
border-bottom: 1px solid #888;
|
||||
-webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
||||
-moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
||||
-ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
||||
-o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
||||
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
||||
}
|
||||
.sp-cancel {
|
||||
font-size: 11px;
|
||||
color: #d93f3f !important;
|
||||
margin:0;
|
||||
padding:2px;
|
||||
margin-right: 5px;
|
||||
vertical-align: middle;
|
||||
text-decoration:none;
|
||||
|
||||
}
|
||||
.sp-cancel:hover {
|
||||
color: #d93f3f !important;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
.sp-palette span:hover, .sp-palette span.sp-thumb-active {
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
.sp-preview, .sp-alpha, .sp-thumb-el {
|
||||
position:relative;
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
|
||||
}
|
||||
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
|
||||
display:block;
|
||||
position:absolute;
|
||||
top:0;left:0;bottom:0;right:0;
|
||||
}
|
||||
|
||||
.sp-palette .sp-thumb-inner {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
|
||||
}
|
||||
|
||||
.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
|
||||
}
|
||||
|
||||
.sp-clear-display {
|
||||
background-repeat:no-repeat;
|
||||
background-position: center;
|
||||
background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
|
||||
}
|
@ -1,148 +0,0 @@
|
||||
ul.jqtree-tree {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
ul.jqtree-tree,
|
||||
ul.jqtree-tree ul.jqtree_common {
|
||||
list-style: none outside;
|
||||
margin-bottom: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.jqtree-tree ul.jqtree_common {
|
||||
display: block;
|
||||
margin-left: 12px;
|
||||
margin-right: 0;
|
||||
}
|
||||
ul.jqtree-tree li.jqtree-closed > ul.jqtree_common {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree_common {
|
||||
clear: both;
|
||||
list-style-type: none;
|
||||
}
|
||||
ul.jqtree-tree .jqtree-toggler {
|
||||
border-bottom: none;
|
||||
/*color: #333;*/
|
||||
text-decoration: none;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
ul.jqtree-tree .jqtree-toggler:hover {
|
||||
/*color: #000;*/
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul.jqtree-tree .jqtree-element {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.jqtree-tree .jqtree-title {
|
||||
color: #1C4257;
|
||||
vertical-align: middle;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
.jqtree-tree .jqtree-title.jqtree-title-folder {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
span.addr:hover,
|
||||
div#strings .jqtree-title-folder:hover,
|
||||
div#types .jqtree-title-folder:hover {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-folder {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-folder.jqtree-closed {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
ul.jqtree-tree .jqtree-toggler.jqtree-closed {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
span.jqtree-dragging {
|
||||
color: #fff;
|
||||
background: #000;
|
||||
opacity: 0.6;
|
||||
cursor: pointer;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-ghost {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-ghost span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-ghost span.jqtree-circle {
|
||||
border: solid 2px #0000ff;
|
||||
-webkit-border-radius: 100px;
|
||||
-moz-border-radius: 100px;
|
||||
border-radius: 100px;
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
left: -6px;
|
||||
}
|
||||
|
||||
/* IE 6, 7, 8 */
|
||||
@media \0screen\,screen\9 {
|
||||
ul.jqtree-tree li.jqtree-ghost span.jqtree-circle {
|
||||
background: url(jqtree-circle.png) no-repeat;
|
||||
border: 0 none;
|
||||
}
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-ghost span.jqtree-line {
|
||||
background-color: #0000ff;
|
||||
height: 2px;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: 2px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-ghost.jqtree-inside {
|
||||
margin-left: 48px;
|
||||
}
|
||||
|
||||
ul.jqtree-tree span.jqtree-border {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: -2px;
|
||||
top: 0;
|
||||
border: solid 2px #0000ff;
|
||||
border-radius: 6px;
|
||||
margin: 0;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
ul.jqtree-tree .jqtree-element {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
ul.jqtree-tree li.jqtree-selected > .jqtree-element,
|
||||
ul.jqtree-tree li.jqtree-selected > .jqtree-element:hover {
|
||||
background-color: #97BDD6;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#BEE0F5), to(#89AFCA));
|
||||
background: -moz-linear-gradient(top, #BEE0F5, #89AFCA);
|
||||
background: -ms-linear-gradient(top, #BEE0F5, #89AFCA);
|
||||
background: -o-linear-gradient(top, #BEE0F5, #89AFCA);
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
ul.jqtree-tree .jqtree-moving > .jqtree-element .jqtree-title {
|
||||
outline: dashed 1px #0000ff;
|
||||
}
|
@ -1,588 +0,0 @@
|
||||
// DISASSEMBLER PANEL
|
||||
var DisasmPanel = function () {
|
||||
this.display = "flat";
|
||||
this.min = 0;
|
||||
this.max = 0;
|
||||
this.block = 512;
|
||||
this.base = "entry0";
|
||||
this.selected = null;
|
||||
this.selected_offset = null;
|
||||
this.tmp_address = null;
|
||||
this.renaming = null;
|
||||
this.renameOldValue = "";
|
||||
this.rbox = null;
|
||||
this.panel = $("#disasm_tab")[0];
|
||||
this.scroll_offset = null;
|
||||
this.minimap = true;
|
||||
this.instructions = [];
|
||||
this.scrolling = false;
|
||||
};
|
||||
DisasmPanel.prototype.render = function(mode) {
|
||||
|
||||
// r2ui.seek("$$", false);
|
||||
$("#center_panel").unbind( "click" );
|
||||
$(document).unbind( "keypress" );
|
||||
$(document).unbind( "click" );
|
||||
$(document).unbind( "dblclick" );
|
||||
$("#center_panel").scroll(on_scroll);
|
||||
$(document).keypress(handleKeypress);
|
||||
$(document).click(handleClick);
|
||||
$(document).dblclick(handleDoubleClick);
|
||||
// Context menu for disas addresses:
|
||||
$(document).contextmenu({
|
||||
delegate: ".addr",
|
||||
menu: [
|
||||
{title: "jump to address<kbd>g</kbd>", cmd: "goto"},
|
||||
{title: "rename<kbd>n</kbd>", cmd: "rename"},
|
||||
{title: "add comment<kbd>;</kbd>", cmd: "comment"},
|
||||
{title: "code<kbd>c</kbd>", cmd: "define"},
|
||||
{title: "undefine<kbd>u</kbd>", cmd: "undefine"},
|
||||
{title: "random colors<kbd>R</kbd>", cmd: "randomcolors"},
|
||||
{title: "switch disasm/graph<kbd>s</kbd>", cmd: "switchview"}
|
||||
],
|
||||
preventSelect: true,
|
||||
taphold: true,
|
||||
preventContextMenuForPopup: true,
|
||||
show: false,
|
||||
position: function(event, ui){
|
||||
return {my: "left+100 top-10", at: "left bottom", of: ui.target};
|
||||
},
|
||||
beforeOpen: function(event, ui) {
|
||||
var address = get_address_from_class(ui.target[0]);
|
||||
var xrefs_to = [];
|
||||
var xrefs_from = [];
|
||||
var xrefto_submenu = null;
|
||||
var xreffrom_submenu = null;
|
||||
r2.cmd("axf @" + address, function(x){
|
||||
var lines = x.split('\n');
|
||||
for (var l in lines) {
|
||||
if (lines[l] !== "") xrefs_to[xrefs_to.length] = lines[l];
|
||||
}
|
||||
});
|
||||
if (xrefs_to.length > 0) {
|
||||
$(document).contextmenu("showEntry", "xrefs_to", true);
|
||||
var refs = [];
|
||||
for (var r in xrefs_to) {
|
||||
var addr = xrefs_to[r].split(' ')[1];
|
||||
var type = xrefs_to[r].split(' ')[0];
|
||||
refs[refs.length] = {title: addr + "<kbd>" + type + "</kbd>", cmd: "jumpto_" + addr};
|
||||
}
|
||||
var xrefto_submenu = {title: "xrefs to", children: refs};
|
||||
}
|
||||
r2.cmd("axt @" + address, function(x){
|
||||
var lines = x.split('\n');
|
||||
for (var l in lines) {
|
||||
if (lines[l] !== "") xrefs_from[xrefs_from.length] = lines[l];
|
||||
}
|
||||
});
|
||||
if (xrefs_from.length > 0) {
|
||||
$(document).contextmenu("showEntry", "xrefs_from", true);
|
||||
var refs = [];
|
||||
for (var r in xrefs_from) {
|
||||
var addr = xrefs_from[r].split(' ')[1];
|
||||
var type = xrefs_from[r].split(' ')[0];
|
||||
refs[refs.length] = {title: addr + "<kbd>" + type + "</kbd>", cmd: "jumpto_" + addr};
|
||||
}
|
||||
var xreffrom_submenu = {title: "xrefs from", children: refs};
|
||||
}
|
||||
var menu = [
|
||||
{title: "jump to address<kbd>g</kbd>", cmd: "goto"},
|
||||
{title: "rename<kbd>n</kbd>", cmd: "rename"},
|
||||
{title: "add comment<kbd>;</kbd>", cmd: "comment"},
|
||||
{title: "code<kbd>c</kbd>", cmd: "define"},
|
||||
{title: "undefine<kbd>u</kbd>", cmd: "undefine"},
|
||||
{title: "random colors<kbd>R</kbd>", cmd: "randomcolors"},
|
||||
{title: "switch disasm/graph<kbd>s</kbd>", cmd: "switchview"}
|
||||
];
|
||||
if (xreffrom_submenu !== null || xrefto_submenu !== null) {
|
||||
if (xrefto_submenu !== null) menu[menu.length] = xrefto_submenu;
|
||||
if (xreffrom_submenu !== null) menu[menu.length] = xreffrom_submenu;
|
||||
}
|
||||
$(document).contextmenu("replaceMenu", menu);
|
||||
|
||||
r2.cmdj("pdj 1 @" + address, function(x) {
|
||||
if(x) {
|
||||
if(x[0].fcn_addr == x[0].offset) {
|
||||
$(document).contextmenu("showEntry", "define", false);
|
||||
$(document).contextmenu("showEntry", "undefine", true);
|
||||
} else {
|
||||
$(document).contextmenu("showEntry", "define", true);
|
||||
$(document).contextmenu("showEntry", "undefine", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (ui.target.hasClass('insaddr')) {
|
||||
$(document).contextmenu("showEntry", "comment", true);
|
||||
$(document).contextmenu("showEntry", "rename", true);
|
||||
} else {
|
||||
$(document).contextmenu("showEntry", "comment", false);
|
||||
$(document).contextmenu("showEntry", "rename", true);
|
||||
$(document).contextmenu("showEntry", "define", false);
|
||||
$(document).contextmenu("showEntry", "undefine", false);
|
||||
}
|
||||
if (ui.target.hasClass('reloc') || ui.target.hasClass('symbol') || ui.target.hasClass('import')) {
|
||||
$(document).contextmenu("showEntry", "comment", false);
|
||||
$(document).contextmenu("showEntry", "rename", false);
|
||||
$(document).contextmenu("showEntry", "define", false);
|
||||
$(document).contextmenu("showEntry", "undefine", false);
|
||||
}
|
||||
// Context manu on disasm panel
|
||||
if (!$.contains($("#disasm_tab")[0], ui.target[0])) {
|
||||
$(document).contextmenu("showEntry", "switchview", false);
|
||||
}
|
||||
},
|
||||
select: function(event, ui) {
|
||||
$(document).contextmenu("close");
|
||||
var target = ui.target[0];
|
||||
var address = get_address_from_class(target);
|
||||
if (ui.cmd.indexOf("jumpto_") == 0) {
|
||||
address = ui.cmd.substring(ui.cmd.indexOf("jumpto_") + 7);
|
||||
do_jumpto(address);
|
||||
}
|
||||
switch (ui.cmd) {
|
||||
case "goto": do_goto(); break;
|
||||
case "comment": do_comment(target); break;
|
||||
case "rename": do_rename(target, event); break;
|
||||
case "define": do_define(target); break;
|
||||
case "undefine": do_undefine(target); break;
|
||||
case "randomcolors": do_randomcolors(target); break;
|
||||
case "switchview": do_switchview(target); break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Show disasm panel and seek to entrypoint
|
||||
if (mode === "flat")
|
||||
this.display_flat();
|
||||
else if (mode === "graph")
|
||||
this.display_graph();
|
||||
var addr = null;
|
||||
if (this.selected_offset !== null) {
|
||||
addr = this.selected_offset;
|
||||
} else {
|
||||
addr = this.base;
|
||||
}
|
||||
r2ui.seek(addr,true);
|
||||
if (addr.indexOf("0x") === 0) {
|
||||
addr = address_canonicalize(addr);
|
||||
} else {
|
||||
addr = r2.get_flag_address(addr);
|
||||
}
|
||||
scroll_to_address(addr);
|
||||
}
|
||||
DisasmPanel.prototype.seek = function(addr, scroll) {
|
||||
var panel = this.panel;
|
||||
var error = false;
|
||||
if (this.display === "graph") {
|
||||
panel.innerHTML = "";
|
||||
r2.cmd("agj " + addr, function(x) {
|
||||
panel.innerHTML = "<div id='minimap'></div></div><div id='canvas' class='canvas enyo-selectable ec_gui_background'></div>";
|
||||
// If render fails (address does not belong to function) then switch to flat view
|
||||
if (render_graph(x) === false) error = true;
|
||||
});
|
||||
}
|
||||
if (error) this.display_flat();
|
||||
if (this.display === "flat") {
|
||||
this.min = this.max = 0;
|
||||
r2.get_disasm_before_after(addr, -100, 100, function(x) {
|
||||
panel.innerHTML = "<div id='canvas' class='canvas enyo-selectable ec_gui_background'></div>";
|
||||
r2ui._dis.instructions = x;
|
||||
render_instructions(r2ui._dis.instructions);
|
||||
});
|
||||
}
|
||||
this.selected = get_element_by_address(addr);
|
||||
this.selected_offset = addr;
|
||||
|
||||
render_history();
|
||||
rehighlight_iaddress(addr);
|
||||
};
|
||||
DisasmPanel.prototype.display_graph = function() {
|
||||
this.display = "graph";
|
||||
$("#main_panel").removeClass("ec_gui_background");
|
||||
$("#main_panel").addClass("ec_gui_alt_background");
|
||||
if ($('#minimap').length) $('#minimap')[0].innerHTML = "";
|
||||
};
|
||||
DisasmPanel.prototype.display_flat = function() {
|
||||
this.display = "flat";
|
||||
$("#main_panel").removeClass("ec_gui_alt_background");
|
||||
$("#main_panel").addClass("ec_gui_background");
|
||||
if ($('#minimap').length) $('#minimap')[0].innerHTML = "";
|
||||
};
|
||||
DisasmPanel.prototype.goToAddress = function() {
|
||||
if (this.renaming === null && this.selected !== null && (this.selected.className.indexOf(" addr ") > -1)) {
|
||||
var address = get_address_from_class(this.selected);
|
||||
if (this.selected.className.indexOf("ec_gui_dataoffset") > -1) {
|
||||
// address is located in not executable memory, switching to hex view
|
||||
r2ui.openpage(address, 2);
|
||||
return;
|
||||
}
|
||||
if (address !== undefined && address !== null) {
|
||||
address = address_canonicalize(address);
|
||||
do_jumpto(address);
|
||||
}
|
||||
}
|
||||
};
|
||||
DisasmPanel.prototype.handleInputTextChange = function() {
|
||||
if (this.renaming !== null && this.rbox.value.length > 0) {
|
||||
if ($(this.selected).hasClass('insaddr')) {
|
||||
var old_value = get_offset_flag(r2ui._dis.selected_offset);
|
||||
var type = "offsets";
|
||||
r2.cmdj("afij @ " + r2ui._dis.selected_offset, function(x) {
|
||||
if (x !== null && x !== undefined) {
|
||||
if ("0x" + x[0].offset.toString(16) === r2ui._dis.selected_offset) {
|
||||
type = "functions";
|
||||
}
|
||||
}
|
||||
});
|
||||
rename(r2ui._dis.selected_offset, old_value, this.rbox.value, type);
|
||||
} else if ($(this.selected).hasClass('faddr')) {
|
||||
if ($(this.selected).hasClass('fvar'))
|
||||
r2.cmd("afvn " + r2ui._dis.renameOldValue + " " + r2ui._dis.rbox.value + " @ " + r2ui._dis.selected_offset, function(x){});
|
||||
else if ($(this.selected).hasClass('farg'))
|
||||
r2.cmd("afan " + r2ui._dis.renameOldValue + " " + r2ui._dis.rbox.value + " @ " + r2ui._dis.selected_offset, function(x){});
|
||||
} else {
|
||||
// TODO, try to recognize other spaces
|
||||
var old_value = r2ui._dis.renameOldValue;
|
||||
if (old_value.indexOf("0x") === 0) old_value = "";
|
||||
rename(r2ui._dis.selected_offset, old_value, r2ui._dis.rbox.value, "*");
|
||||
}
|
||||
var instruction;
|
||||
if (this.display == "flat") instruction = $(this.selected).closest(".instructionbox").find('.insaddr')[0];
|
||||
if (this.display == "graph") instruction = $(this.selected).closest(".instruction").find('.insaddr')[0];
|
||||
this.renaming = null;
|
||||
var address = get_address_from_class(instruction);
|
||||
update_binary_details();
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
};
|
||||
function scroll_to_address(address, pos) {
|
||||
if (address === undefined || address === null) return;
|
||||
var offset = 0;
|
||||
if (pos == "top") offset = $('#center_panel').height();
|
||||
else if (pos == "bottom") offset = 0;
|
||||
else offset = window.innerHeight / 2;
|
||||
var elements = $(".insaddr.addr_" + address);
|
||||
if (elements === undefined || elements === null) return;
|
||||
if (elements[0] === undefined || elements[0] === null) return;
|
||||
var top = elements[0].documentOffsetTop() - offset;
|
||||
top = Math.max(0,top);
|
||||
$('#center_panel').scrollTo(top, {axis: 'y'});
|
||||
r2ui._dis.scroll_offset = top;
|
||||
}
|
||||
|
||||
|
||||
function handleClick(inEvent) {
|
||||
|
||||
if ($(inEvent.target).hasClass('addr')) {
|
||||
if ($(inEvent.target).hasClass('history')) {
|
||||
var idx = inEvent.target.className.split(" ").filter(function(x) { return x.substr(0,"history_idx_".length) == "history_idx_"; });
|
||||
idx = String(idx).split("_")[2];
|
||||
r2ui.history_idx = idx;
|
||||
do_jumpto(r2ui.history[idx]);
|
||||
}
|
||||
// If instruction address, add address to history
|
||||
else if ($(inEvent.target).hasClass('insaddr')) {
|
||||
var address = get_address_from_class(inEvent.target);
|
||||
r2ui._dis.selected = inEvent.target;
|
||||
r2ui._dis.selected_offset = address;
|
||||
rehighlight_iaddress(address);
|
||||
|
||||
r2ui.history_push(address);
|
||||
render_history();
|
||||
var get_more_instructions = false;
|
||||
var next_instruction;
|
||||
var prev_instruction;
|
||||
var address;
|
||||
if (r2ui._dis.display == "flat") {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".instructionbox").next().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) > $("#gbox .instructionbox").length - 10) {
|
||||
get_more_instructions = true;
|
||||
address = get_address_from_class(next_instruction);
|
||||
}
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".instructionbox").prev().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) < 10) {
|
||||
get_more_instructions = true;
|
||||
address = get_address_from_class(prev_instruction);
|
||||
}
|
||||
}
|
||||
if (r2ui._dis.display == "graph") {
|
||||
var next_instruction = $(r2ui._dis.selected).closest(".instruction").next().find('.insaddr')[0];
|
||||
if (next_instruction === undefined || next_instruction === null) {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".basicblock").next().find('.insaddr')[0];
|
||||
}
|
||||
var prev_instruction = $(r2ui._dis.selected).closest(".instruction").prev().find('.insaddr')[0];
|
||||
if (prev_instruction === undefined || prev_instruction === null) {
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
|
||||
}
|
||||
}
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
} else if ($(inEvent.target).hasClass('fvar') || $(inEvent.target).hasClass('farg')) {
|
||||
var eid = null;
|
||||
var address = get_address_from_class(inEvent.target, "faddr");
|
||||
r2ui._dis.selected = inEvent.target;
|
||||
r2ui._dis.selected_offset = address;
|
||||
var classes = inEvent.target.className.split(' ');
|
||||
for (var j in classes) {
|
||||
var klass = classes[j];
|
||||
if (klass.indexOf("id_") === 0) eid = klass.substring(3);
|
||||
}
|
||||
if (eid !== null) rehighlight_iaddress(eid, "id");
|
||||
}
|
||||
}
|
||||
|
||||
function handleDoubleClick (inEvent) {
|
||||
if ($(inEvent.target).hasClass('addr') && !$(inEvent.target).hasClass('insaddr')) {
|
||||
var address = get_address_from_class(inEvent.target);
|
||||
do_jumpto(address);
|
||||
}
|
||||
}
|
||||
|
||||
// key handler
|
||||
function handleKeypress(inEvent) {
|
||||
var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
var key = String.fromCharCode(keynum);
|
||||
// console.log(key);
|
||||
|
||||
if (inEvent.ctrlKey||inEvent.metaKey) return;
|
||||
if ($(inEvent.target).prop("tagName") === "INPUT" || $(inEvent.target).prop("tagName") === "TEXTAREA") return;
|
||||
|
||||
if (r2ui._dis.renaming !== null) return;
|
||||
|
||||
// Spacebar Switch flat and graph views
|
||||
if (key === ' ') {
|
||||
do_switchview();
|
||||
inEvent.preventDefault();
|
||||
}
|
||||
|
||||
if (key === 'm' && r2ui._dis.display == "graph") toggle_minimap();
|
||||
|
||||
// h Seek to previous address in history
|
||||
if (key === 'h') do_jumpto(r2ui.history_prev());
|
||||
|
||||
// l Seek to next address in history
|
||||
if (key === 'l') do_jumpto(r2ui.history_next());
|
||||
|
||||
// j Seek to next Instruction
|
||||
if (key === 'j') {
|
||||
var get_more_instructions = false;
|
||||
if ($(r2ui._dis.selected).hasClass("insaddr")) {
|
||||
var next_instruction;
|
||||
if (r2ui._dis.display == "flat") {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".instructionbox").next().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) > $("#gbox .instructionbox").length - 10) get_more_instructions = true;
|
||||
}
|
||||
if (r2ui._dis.display == "graph") {
|
||||
var next_instruction = $(r2ui._dis.selected).closest(".instruction").next().find('.insaddr')[0];
|
||||
if (next_instruction === undefined || next_instruction === null) {
|
||||
next_instruction = $(r2ui._dis.selected).closest(".basicblock").next().find('.insaddr')[0];
|
||||
}
|
||||
}
|
||||
|
||||
// if (next_instruction === null || next_instruction === undefined) return;
|
||||
var address = get_address_from_class(next_instruction);
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
} else {
|
||||
r2ui.history_push(address);
|
||||
render_history();
|
||||
r2ui._dis.selected = next_instruction;
|
||||
r2ui._dis.selected_offset = address;
|
||||
}
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
// k Seek to previous instruction
|
||||
if (key === 'k') {
|
||||
var get_more_instructions = false;
|
||||
if ($(r2ui._dis.selected).hasClass("insaddr")) {
|
||||
var prev_instruction;
|
||||
if (r2ui._dis.display == "flat") {
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".instructionbox").prev().find('.insaddr')[0];
|
||||
if ($("#gbox .instructionbox").index( $(r2ui._dis.selected).closest(".instructionbox")[0]) < 10) get_more_instructions = true;
|
||||
}
|
||||
if (r2ui._dis.display == "graph") {
|
||||
var prev_instruction = $(r2ui._dis.selected).closest(".instruction").prev().find('.insaddr')[0];
|
||||
if (prev_instruction === undefined || prev_instruction === null) {
|
||||
prev_instruction = $(r2ui._dis.selected).closest(".basicblock").prev().find('.insaddr').last()[0];
|
||||
}
|
||||
}
|
||||
var address = get_address_from_class(prev_instruction);
|
||||
if (get_more_instructions) {
|
||||
r2ui.seek(address, false);
|
||||
} else {
|
||||
r2ui.history_push(address);
|
||||
render_history();
|
||||
r2ui._dis.selected = prev_instruction;
|
||||
r2ui._dis.selected_offset = address;
|
||||
}
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
// c Define function
|
||||
if (key === 'c') do_define(r2ui._dis.selected);
|
||||
|
||||
// u Clear function metadata
|
||||
if (key === 'u') do_undefine(r2ui._dis.selected);
|
||||
|
||||
// g Go to address
|
||||
if (key === 'g') {
|
||||
var a = prompt('Go to');
|
||||
if (a !== null) do_jumpto(a);
|
||||
}
|
||||
|
||||
// ; Add comment
|
||||
if (key === ';') do_comment(r2ui._dis.selected);
|
||||
|
||||
// n Rename
|
||||
if (key === 'n') do_rename(r2ui._dis.selected, inEvent);
|
||||
|
||||
if (key === 'R') do_randomcolors();
|
||||
|
||||
// esc
|
||||
if (keynum === 27) {
|
||||
// Esc belongs to renaming
|
||||
if(r2ui._dis.renaming !== null) {
|
||||
r2ui._dis.renaming.innerHTML = r2ui._dis.renameOldValue;
|
||||
r2ui._dis.renaming = null;
|
||||
} else {
|
||||
// go back in history
|
||||
var addr = r2ui.history_prev();
|
||||
if (addr !== undefined && addr !== null) r2ui.seek(addr, false);
|
||||
scroll_to_address(addr);
|
||||
}
|
||||
}
|
||||
// enter
|
||||
if (keynum === 13) {
|
||||
r2ui._dis.goToAddress();
|
||||
}
|
||||
}
|
||||
|
||||
function do_switchview() {
|
||||
$("#switch_button").text("loading ...");
|
||||
var address = get_address_from_class(r2ui._dis.selected);
|
||||
if (address !== undefined && address !== null) {
|
||||
if (r2ui._dis.display === "flat") r2ui._dis.display_graph();
|
||||
else if (r2ui._dis.display === "graph") r2ui._dis.display_flat();
|
||||
r2ui.seek(address, true);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
$("#switch_button").text("switch view");
|
||||
}
|
||||
|
||||
function do_jumpto(address) {
|
||||
var element = $('.insaddr.addr_' + address);
|
||||
if (element.length > 0) {
|
||||
r2ui.history_push(address);
|
||||
r2ui._dis.selected = element[0];
|
||||
r2ui._dis.selected_offset = address;
|
||||
render_history();
|
||||
} else {
|
||||
r2ui.seek(address, true);
|
||||
}
|
||||
rehighlight_iaddress(address);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
|
||||
function do_rename(element, inEvent) {
|
||||
var address = get_address_from_class(element);
|
||||
if ($(element).hasClass("addr") && $(element).hasClass("flag")) {
|
||||
var space = "*";
|
||||
if ($(element).hasClass("function")) space = "functions";
|
||||
if ($(element).hasClass("import")) space = "functions";
|
||||
if ($(element).hasClass("symbol")) space = "symbols";
|
||||
if ($(element).hasClass("reloc")) space = "relocs";
|
||||
if ($(element).hasClass("section")) space = "sections";
|
||||
if ($(element).hasClass("string")) space = "strings";
|
||||
var old_value = $(element).html();
|
||||
var new_name = prompt('New name', old_value);
|
||||
if (new_name !== null) {
|
||||
rename(address, old_value, new_name, space);
|
||||
store_scroll_offset();
|
||||
r2ui.seek("$$", false);
|
||||
scroll_to_last_offset();
|
||||
}
|
||||
} else if (r2ui._dis.renaming === null && element !== null && $(element).hasClass("addr")) {
|
||||
r2ui._dis.selected = element;
|
||||
r2ui._dis.selected_offset = address;
|
||||
r2ui._dis.renaming = element;
|
||||
r2ui._dis.renameOldValue = element.innerHTML;
|
||||
r2ui._dis.rbox = document.createElement('input');
|
||||
r2ui._dis.rbox.setAttribute("type", "text");
|
||||
r2ui._dis.rbox.setAttribute("id", "rename");
|
||||
r2ui._dis.rbox.setAttribute("style", "border-width: 0;padding: 0;");
|
||||
r2ui._dis.rbox.setAttribute("onChange", "handleInputTextChange()");
|
||||
if ($(element).hasClass('insaddr')) {
|
||||
var value = get_offset_flag(address);
|
||||
r2ui._dis.rbox.setAttribute("value",value);
|
||||
r2ui._dis.rbox.setSelectionRange(value.length, value.length);
|
||||
} else {
|
||||
r2ui._dis.rbox.setAttribute("value", r2ui._dis.renameOldValue);
|
||||
r2ui._dis.rbox.setSelectionRange(r2ui._dis.renameOldValue.length, r2ui._dis.renameOldValue.length);
|
||||
}
|
||||
r2ui._dis.renaming.innerHTML = "";
|
||||
r2ui._dis.renaming.appendChild(r2ui._dis.rbox);
|
||||
setTimeout('r2ui._dis.rbox.focus();', 200);
|
||||
inEvent.returnValue=false;
|
||||
inEvent.preventDefault();
|
||||
} else if (r2ui._dis.renaming === null && element !== null && $(element).hasClass("faddr")) {
|
||||
address = get_address_from_class(element, "faddr");
|
||||
r2ui._dis.selected = element;
|
||||
r2ui._dis.selected_offset = address;
|
||||
r2ui._dis.renaming = element;
|
||||
r2ui._dis.renameOldValue = element.innerText;
|
||||
r2ui._dis.rbox = document.createElement('input');
|
||||
r2ui._dis.rbox.setAttribute("type", "text");
|
||||
r2ui._dis.rbox.setAttribute("id", "rename");
|
||||
r2ui._dis.rbox.setAttribute("style", "border-width: 0;padding: 0;");
|
||||
r2ui._dis.rbox.setAttribute("onChange", "handleInputTextChange()");
|
||||
r2ui._dis.rbox.setAttribute("value", r2ui._dis.renameOldValue);
|
||||
r2ui._dis.rbox.setSelectionRange(r2ui._dis.renameOldValue.length, r2ui._dis.renameOldValue.length);
|
||||
r2ui._dis.renaming.innerHTML = "";
|
||||
r2ui._dis.renaming.appendChild(r2ui._dis.rbox);
|
||||
setTimeout('r2ui._dis.rbox.focus();', 200);
|
||||
inEvent.returnValue=false;
|
||||
inEvent.preventDefault();
|
||||
}
|
||||
update_binary_details();
|
||||
}
|
||||
|
||||
function do_comment(element) {
|
||||
var address = get_address_from_class(element);
|
||||
var c = prompt('Comment');
|
||||
if (c !== null) {
|
||||
r2.cmd('CC ' + c + " @ " + address);
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
||||
|
||||
function do_undefine(element) {
|
||||
var address = get_address_from_class(element);
|
||||
r2.cmd("af-");
|
||||
r2.update_flags();
|
||||
update_binary_details();
|
||||
if (r2ui._dis.display == "graph") r2ui._dis.display_flat();
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
|
||||
function do_define(element) {
|
||||
var address = get_address_from_class(element);
|
||||
var msg = prompt ('Function name?');
|
||||
if (msg !== null) {
|
||||
r2.cmd("af " + msg + " @ " + address);
|
||||
r2.update_flags();
|
||||
update_binary_details();
|
||||
r2ui.seek(address, false);
|
||||
scroll_to_address(address);
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
// ENTROPY PANEL
|
||||
var EntropyPanel = function () {
|
||||
|
||||
};
|
||||
|
||||
EntropyPanel.prototype.render = function() {
|
||||
var table = "<table id='entropy_chart'>";
|
||||
r2.cmd("p=", function(x) {
|
||||
var blocks = x.split('\n');
|
||||
for (var i in blocks) {
|
||||
var block = blocks[i];
|
||||
var idx = block.split(' ')[0];
|
||||
var value = parseInt(block.split(' ')[1],16);
|
||||
if (value > 0) {
|
||||
table += "<tr><td>" + idx + "</td><td>" + value + "</td></tr>";
|
||||
}
|
||||
}
|
||||
});
|
||||
table += "</table>";
|
||||
$("#entropy_tab").html("<pre id='hexdump' style='color:rgb(127,127,127);''>" + table + "</pre>");
|
||||
$("#entropy_chart").horizontalTableGraph();
|
||||
};
|
||||
|
||||
jQuery.fn.horizontalTableGraph = function() {
|
||||
$(this).find("thead").remove();
|
||||
var maxvalue = 0;
|
||||
$(this).find("tr").each(function(i) {
|
||||
$(this).removeClass();
|
||||
$(this).find("td").eq(0).animate({width : '50px'}, 1000);
|
||||
$(this).find("td").eq(1).animate({width : '500px'}, 1000).css("text-align","left");
|
||||
$(this).find("td").eq(1).css("width","500px");
|
||||
var getvalue = $(this).find("td").eq(1).html();
|
||||
maxvalue = Math.max(maxvalue,getvalue);
|
||||
});
|
||||
$(this).find("tr").each(function(i) {
|
||||
var thevalue = $(this).find("td").eq(1).html();
|
||||
var newBar = $("<span>").html(thevalue);
|
||||
newBar.css({
|
||||
"display": "block",
|
||||
"width": "0px",
|
||||
"backgroundColor": "#600",
|
||||
"marginBottom": "0px",
|
||||
"padding": "0px",
|
||||
"color": "#FFF"
|
||||
});
|
||||
$(this).find("td").eq(1).html(newBar);
|
||||
newBar.animate({"width": (100 * thevalue / maxvalue) + "%"}, "slow");
|
||||
})
|
||||
};
|
@ -1,368 +0,0 @@
|
||||
// HEXDUMP PANEL
|
||||
var HexPanel = function () {
|
||||
this.block = 1024;
|
||||
this.base = "entry0";
|
||||
this.first = 0;
|
||||
this.last = 0;
|
||||
this.lines = {};
|
||||
this.scrolling = false;
|
||||
this.renaming = null;
|
||||
this.dwors = null;
|
||||
this.renameOldValue = "";
|
||||
this.rbox = null;
|
||||
this.address = null;
|
||||
this.scroll_offset = 0;
|
||||
this.dragStart = -1;
|
||||
this.dragEnd = -1;
|
||||
this.isDragging = false;
|
||||
};
|
||||
HexPanel.prototype.scrollTo = function(x,y) {
|
||||
};
|
||||
HexPanel.prototype.render = function() {
|
||||
r2ui.seek("$$", false);
|
||||
$("#center_panel").unbind( "click" );
|
||||
$(document).unbind( "keypress" );
|
||||
$(document).unbind( "click" );
|
||||
$(document).unbind( "dblclick" );
|
||||
|
||||
$("#center_panel").scroll(on_hex_scroll);
|
||||
$(document).keypress(handle_hex_keypress);
|
||||
$(document).dblclick(handle_hex_double_click);
|
||||
// $(document).click(rename_dword);
|
||||
// $(document).dblclick(handle_hex_double_click);
|
||||
// Context menu for dwords:
|
||||
$('#center_panel').contextmenu({
|
||||
delegate: ".dword",
|
||||
menu: [
|
||||
{title: "bytes to console", cmd: "hex_menu_to_console"}
|
||||
],
|
||||
preventSelect: true,
|
||||
preventContextMenuForPopup: true,
|
||||
show: false,
|
||||
select: function(event, ui) {
|
||||
$(document).contextmenu("close");
|
||||
switch (ui.cmd) {
|
||||
case "hex_menu_to_console": hex_menu_to_console(); break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function hex_menu_to_console() {
|
||||
value = "";
|
||||
if (r2ui._hex.dragEnd > -1 && r2ui._hex.dragStart > -1) {
|
||||
if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
|
||||
var cells = $("span.dword").slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
|
||||
for (var i in cells) {
|
||||
value += uncolor_dword(cells[i].innerHTML);
|
||||
}
|
||||
} else {
|
||||
var cells = $("span.dword").slice(r2ui._hex.dragStart, r2ui._hex.dragEnd + 1);
|
||||
for (var i in cells) {
|
||||
value += uncolor_dword(cells[i].innerHTML);
|
||||
}
|
||||
}
|
||||
var old_value = $("#cmd_output").text();
|
||||
$("#cmd_output").html(old_value + "\n" + value );
|
||||
}
|
||||
}
|
||||
function handle_hex_keypress(inEvent) {
|
||||
var keynum = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
var key = String.fromCharCode(keynum);
|
||||
}
|
||||
function scroll_to_hexaddress(address, pos) {
|
||||
if (address === undefined || address === null) return;
|
||||
var offset = 0;
|
||||
if (pos == "top") offset = $('#center_panel').height();
|
||||
else if (pos == "bottom") offset = 0;
|
||||
else offset = window.innerHeight / 2;
|
||||
var elements = $(".hexaddr.hexaddr_" + address);
|
||||
if (elements === undefined || elements === null) return;
|
||||
if (elements[0] === undefined || elements[0] === null) return;
|
||||
var top = elements[0].documentOffsetTop() - offset;
|
||||
top = Math.max(0,top);
|
||||
$('#center_panel').scrollTo(top, {axis: 'y'});
|
||||
r2ui._dis.scroll_offset = top;
|
||||
}
|
||||
function on_hex_scroll() {
|
||||
if (!r2ui._hex.scrolling) {
|
||||
r2ui._hex.scrolling = true;
|
||||
var scroll_offset = $("#center_panel").scrollTop();
|
||||
var top_offset = $(".hexoffset").height() - $("#center_panel").height();
|
||||
var container_element = $("#hex_tab");
|
||||
if (scroll_offset === 0 ) {
|
||||
var new_lines = get_hexdump(r2ui._hex.first - r2ui._hex.block + 16);
|
||||
for (var offset in r2ui._hex.lines) {
|
||||
new_lines[offset] = r2ui._hex.lines[offset];
|
||||
}
|
||||
r2ui._hex.lines = new_lines;
|
||||
html = "<div class='hex'>";
|
||||
html += render_hexdump(r2ui._hex.lines);
|
||||
html += "</div>";
|
||||
$("#hex_tab").html(html);
|
||||
scroll_to_hexaddress("0x"+r2ui._hex.first.toString(16), "bottom");
|
||||
r2ui._hex.first = r2ui._hex.first - r2ui._hex.block + 16;
|
||||
} else if (scroll_offset > top_offset-10) {
|
||||
var new_lines = get_hexdump(r2ui._hex.last - 16);
|
||||
for (var offset in new_lines) {
|
||||
r2ui._hex.lines[offset] = new_lines[offset];
|
||||
}
|
||||
r2ui._hex.last = r2ui._hex.last - 16 + r2ui._hex.block;
|
||||
html = "<div class='hex'>";
|
||||
html += render_hexdump(r2ui._hex.lines);
|
||||
html += "</div>";
|
||||
$("#hex_tab").html(html);
|
||||
scroll_to_hexaddress("0x"+r2ui._hex.last.toString(16), "top");
|
||||
}
|
||||
$(".dword").click(function(inEvent) {
|
||||
if ($(inEvent.target).hasClass('dword')) {
|
||||
var dword = inEvent.target.className.split(" ").filter(function(x) { return x.substr(0,"dword_".length) == "dword_"; });
|
||||
$('.autohighlighti').removeClass('autohighlighti');
|
||||
$("." + dword).addClass('autohighlighti');
|
||||
}
|
||||
});
|
||||
r2ui._hex.scrolling = false;
|
||||
}
|
||||
};
|
||||
|
||||
function get_hexdump(addr) {
|
||||
var l = {};
|
||||
r2.cmd ("px " + r2ui._hex.block + "@" + addr, function (x) {
|
||||
var lines = x.split('\n');
|
||||
for (var i in lines) {
|
||||
if (i > 1 && i < lines.length-1) {
|
||||
var offset = lines[i].split(' ')[0];
|
||||
var dwords = (lines[i].split(' ')[1]).split(' ');
|
||||
var text = lines[i].split(' ')[2].match(/.{1,2}/g);
|
||||
var line = { 'offset': offset, 'dwords': dwords, 'text': text};
|
||||
l[offset] = line;
|
||||
}
|
||||
}
|
||||
});
|
||||
return l;
|
||||
}
|
||||
function color_dword(dword) {
|
||||
return dword
|
||||
.replace(/(7f)/gi, function(x){return "<font class='ec_b0x7f'>" + x + "</font>";})
|
||||
.replace(/(ff)/gi, function(x){return "<font class='ec_b0xff'>" + x + "</font>";})
|
||||
.replace(/(00)/gi, function(x){return "<font class='ec_b0x00'>" + x + "</font>";});
|
||||
}
|
||||
function uncolor_dword(cdword) {
|
||||
if (cdword !== undefined && cdword !== null) return cdword.replace(/(<([^>]+)>)/ig,"");
|
||||
else return "";
|
||||
}
|
||||
function render_hexdump(lines) {
|
||||
r2ui._hex.scrolling = true;
|
||||
var hexoffset = "<div class='hexoffset'><div><div>";
|
||||
var hexdump = "<div class='hexdump' style='color: white;'>";
|
||||
var hextext = "<div class='hextext'>";
|
||||
for (var l in lines) {
|
||||
var line = lines[l];
|
||||
hexoffset += "<span class='hexaddr ec_offset hexaddr_" + address_canonicalize(line.offset) + "'>" + line.offset + "</span><br>";
|
||||
for (var i in line.dwords) {
|
||||
var offset_dec = parseInt(line.offset, 16);
|
||||
offset_dec = offset_dec + i*2;
|
||||
dword_offset = "0x" + offset_dec.toString(16);
|
||||
hexdump += "<span class='dword dword_" + address_canonicalize(dword_offset) + " line_" + address_canonicalize(line.offset) +"'>" + color_dword(line.dwords[i]) + "</span> ";
|
||||
}
|
||||
hexdump += "<br>";
|
||||
for (var i in line.text) {
|
||||
var offset_dec = parseInt(line.offset, 16);
|
||||
offset_dec = offset_dec + i*2;
|
||||
dword_offset = "0x" + offset_dec.toString(16);
|
||||
hextext += "<span class='dword dword_" + address_canonicalize(dword_offset) + "'>" + line.text[i] + "</span>";
|
||||
}
|
||||
hextext += "<br>";
|
||||
}
|
||||
hextext += "</div>";
|
||||
hexdump += "</div>";
|
||||
hexoffset += "</div></div></div>";
|
||||
return hexoffset + hexdump + hextext;
|
||||
};
|
||||
HexPanel.prototype.seek = function(addr) {
|
||||
this.base = addr;
|
||||
this.first = parseInt(addr, 16);
|
||||
this.last = parseInt(addr, 16) + this.block;
|
||||
this.lines = get_hexdump(addr);
|
||||
html = "<div class='hex'>";
|
||||
html += render_hexdump(this.lines);
|
||||
html += "</div>";
|
||||
$("#hex_tab").html(html);
|
||||
$(document).on('dblclick','.dword', handle_hex_double_click);
|
||||
|
||||
// $(document).on('mouseenter','.dword', highlight_in);
|
||||
// $(document).on('mouseleave','.dword', highlight_out);
|
||||
// $(document).on('mouseenter','.dword font', highlight_in);
|
||||
// $(document).on('mouseleave','.dword font', highlight_out);
|
||||
|
||||
$(document).on('mousedown','.dword', rangeMouseDown);
|
||||
$(document).on('mousemove','.dword', rangeMouseMove);
|
||||
$(document).on('mouseup', '.dword', rangeMouseUp);
|
||||
r2ui._hex.scrolling = false;
|
||||
};
|
||||
function rangeMouseDown(e) {
|
||||
if (isRightClick(e)) {
|
||||
return false;
|
||||
} else {
|
||||
var allCells = $("span.dword");
|
||||
r2ui._hex.dragStart = allCells.index($(this));
|
||||
r2ui._hex.isDragging = true;
|
||||
if (typeof e.preventDefault != 'undefined') { e.preventDefault(); }
|
||||
document.documentElement.onselectstart = function () { return false; };
|
||||
}
|
||||
}
|
||||
function rangeMouseUp(e) {
|
||||
if (isRightClick(e)) {
|
||||
return false;
|
||||
} else {
|
||||
var allCells = $("span.dword");
|
||||
r2ui._hex.dragEnd = allCells.index($(e.target));
|
||||
r2ui._hex.isDragging = false;
|
||||
if (r2ui._hex.dragEnd > -1) {
|
||||
selectRange();
|
||||
}
|
||||
document.documentElement.onselectstart = function () { return true; };
|
||||
}
|
||||
}
|
||||
function rangeMouseMove(e) {
|
||||
if (r2ui._hex.isDragging) {
|
||||
var allCells = $("span.dword");
|
||||
r2ui._hex.dragEnd = allCells.index($(this));
|
||||
selectRange();
|
||||
}
|
||||
}
|
||||
function selectRange() {
|
||||
$("span.dword").removeClass('autohighlighti');
|
||||
if (r2ui._hex.dragEnd + 1 < r2ui._hex.dragStart) { // reverse select
|
||||
var cells = $("span.dword").slice(r2ui._hex.dragEnd, r2ui._hex.dragStart + 1).addClass('autohighlighti');
|
||||
for (var i in cells) {
|
||||
if (cells[i].className !== undefined) {
|
||||
var dword = cells[i].className.split(" ").filter(function(x) { return x.substr(0,"dword_".length) == "dword_"; });
|
||||
$("." + dword).addClass('autohighlighti');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var cells = $("span.dword").slice(r2ui._hex.dragStart, r2ui._hex.dragEnd + 1);
|
||||
for (var i in cells) {
|
||||
if (cells[i].className !== undefined) {
|
||||
var dword = cells[i].className.split(" ").filter(function(x) { return x.substr(0,"dword_".length) == "dword_"; });
|
||||
$("." + dword).addClass('autohighlighti');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function isRightClick(e) {
|
||||
if (e.which) {
|
||||
return (e.which == 3);
|
||||
} else if (e.button) {
|
||||
return (e.button == 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function handleInputHexChange() {
|
||||
if (r2ui._hex.renaming !== null && r2ui._hex.rbox.value.length > 0) {
|
||||
var value = r2ui._hex.rbox.value;
|
||||
value = value.match(/^[0-9a-f]{0,4}$/gi);
|
||||
if (value === null) {
|
||||
alert("Invalid dword");
|
||||
value = r2ui._hex.renameOldValue;
|
||||
}
|
||||
if (value.length < 4) {
|
||||
var zeroes = "0";
|
||||
var padding = 5 - value.length;
|
||||
for (var i = 0; i < padding; i++) { zeroes += "0"; }
|
||||
value = (zeroes + value).slice(padding * -1);
|
||||
}
|
||||
if (value !== r2ui._hex.renameOldValue) {
|
||||
r2.cmdj("wx 0x" + value.substring(0,2) + " @ " + parseInt(r2ui._hex.dword,16), function(x) {});
|
||||
r2.cmdj("wx 0x" + value.substring(2,4) + " @ " + (parseInt(r2ui._hex.dword,16)+1), function(x) {});
|
||||
}
|
||||
r2ui._hex.renaming[0].innerHTML = "<span class='dword dword_" + r2ui._hex.dword + " line_" + r2ui._hex.address + "'>" + color_dword(value) + "</span>";
|
||||
$('.autohighlighti').removeClass('autohighlighti');
|
||||
$(".dword_" + r2ui._hex.dword).addClass('autohighlighti');
|
||||
r2ui._hex.renaming = null;
|
||||
r2ui._hex.rbox = null;
|
||||
}
|
||||
}
|
||||
function handle_hex_double_click(inEvent) {
|
||||
// handle offset seek
|
||||
if ($(inEvent.target).hasClass('hexaddr')) {
|
||||
var address = get_address_from_class(inEvent.target, "hexaddr");
|
||||
console.log(address);
|
||||
r2ui._dis.selected_offset = address;
|
||||
return;
|
||||
}
|
||||
// Handle renaming
|
||||
var write = true;
|
||||
r2.cmdj("ij", function(x) {
|
||||
if (x['core']['mode'].indexOf("w") == -1) {
|
||||
write = false;
|
||||
alert("Not in write mode");
|
||||
}
|
||||
});
|
||||
if (!write) return;
|
||||
var element = null;
|
||||
if ($(inEvent.target).hasClass('dword')) {
|
||||
element = $(inEvent.target);
|
||||
} else if ($(inEvent.target).parent().hasClass('dword')) {
|
||||
element = $(inEvent.target).parent();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
if (r2ui._hex.renaming === null && element !== null && element.hasClass("dword")) {
|
||||
var classes = element[0].className.split(' ');
|
||||
var dword = 0;
|
||||
var offset = 0;
|
||||
for (var i in classes) {
|
||||
if (classes[i].indexOf('dword_') > -1) {
|
||||
dword = classes[i].substr(6);
|
||||
} else if (classes[i].indexOf('line_') > -1) {
|
||||
offset = classes[i].substr(5);
|
||||
}
|
||||
}
|
||||
r2ui._hex.dword = dword;
|
||||
r2ui._hex.address = offset;
|
||||
r2ui._hex.renaming = element;
|
||||
r2ui._hex.renameOldValue = uncolor_dword(element[0].innerHTML);
|
||||
|
||||
var form = document.createElement('form');
|
||||
form.setAttribute("onSubmit", "handleInputHexChange(); return false;");
|
||||
form.setAttribute("style", "display:inline;");
|
||||
r2ui._hex.rbox = document.createElement('input');
|
||||
r2ui._hex.rbox.setAttribute("type", "text");
|
||||
r2ui._hex.rbox.setAttribute("id", "rename");
|
||||
r2ui._hex.rbox.setAttribute("style", "border-width: 0;padding: 0; background-color:yellow; font-family: monospace; font-size: 10pt;");
|
||||
r2ui._hex.rbox.setAttribute("size", "4");
|
||||
r2ui._hex.rbox.setAttribute("maxlength", "4");
|
||||
r2ui._hex.rbox.setAttribute("value",r2ui._hex.renameOldValue);
|
||||
r2ui._hex.rbox.setSelectionRange(r2ui._hex.renameOldValue.length, r2ui._hex.renameOldValue.length);
|
||||
r2ui._hex.renaming[0].innerHTML = "";
|
||||
form.appendChild(r2ui._hex.rbox);
|
||||
r2ui._hex.renaming[0].appendChild(form);
|
||||
setTimeout('r2ui._hex.rbox.focus();', 200);
|
||||
inEvent.returnValue=false;
|
||||
inEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
function highlight_in(inEvent) {
|
||||
var element = null;
|
||||
if ($(inEvent.target).hasClass('dword')) {
|
||||
element = inEvent.target;
|
||||
} else if ($(inEvent.target).parent().hasClass('dword')) {
|
||||
element = $(inEvent.target).parent()[0];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var dword = element.className.split(" ").filter(function(x) { return x.substr(0,"dword_".length) == "dword_"; });
|
||||
$("." + dword).addClass('autohighlighti');
|
||||
}
|
||||
function highlight_out(inEvent) {
|
||||
if (!r2ui._hex.isDragging) $('.autohighlighti').removeClass('autohighlighti');
|
||||
}
|
||||
function highlight_dword(inEvent) {
|
||||
if ($(inEvent.target).hasClass('dword')) {
|
||||
var dword = inEvent.target.className.split(" ").filter(function(x) { return x.substr(0,"dword_".length) == "dword_"; });
|
||||
$('.autohighlighti').removeClass('autohighlighti');
|
||||
$("." + dword).addClass('autohighlighti');
|
||||
}
|
||||
}
|
9555
shlr/www/p/lib/js/jquery-1.9.0.js
vendored
520
shlr/www/p/lib/js/jquery-colpick.js
vendored
@ -1,520 +0,0 @@
|
||||
/*
|
||||
colpick Color Picker
|
||||
Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
|
||||
|
||||
For usage and examples: colpick.com/plugin
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var colpick = function () {
|
||||
var
|
||||
tpl = '<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',
|
||||
defaults = {
|
||||
showEvent: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
colorScheme: 'light',
|
||||
color: '3289c7',
|
||||
livePreview: true,
|
||||
flat: false,
|
||||
layout: 'full',
|
||||
submit: 1,
|
||||
submitText: 'OK',
|
||||
height: 156
|
||||
},
|
||||
//Fill the inputs of the plugin
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = hsbToRgb(hsb);
|
||||
$(cal).data('colpick').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colpick').fields
|
||||
.eq(4).val(Math.round(hsb.h)).end()
|
||||
.eq(5).val(Math.round(hsb.s)).end()
|
||||
.eq(6).val(Math.round(hsb.b)).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colpick').fields.eq(0).val(hsbToHex(hsb));
|
||||
},
|
||||
//Set the round selector position
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colpick').selector.css('backgroundColor', '#' + hsbToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colpick').selectorIndic.css({
|
||||
left: parseInt($(cal).data('colpick').height * hsb.s/100, 10),
|
||||
top: parseInt($(cal).data('colpick').height * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
//Set the hue selector position
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colpick').hue.css('top', parseInt($(cal).data('colpick').height - $(cal).data('colpick').height * hsb.h/360, 10));
|
||||
},
|
||||
//Set current and new colors
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colpick').currentColor.css('backgroundColor', '#' + hsbToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colpick').newColor.css('backgroundColor', '#' + hsbToHex(hsb));
|
||||
},
|
||||
//Called when the new color is changed
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colpick').color = col = hexToHsb(fixHex(this.value));
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colpick').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colpick').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colpick').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colpick').fields.eq(6).val(), 10)
|
||||
});
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
} else {
|
||||
cal.data('colpick').color = col = rgbToHsb(fixRGB({
|
||||
r: parseInt(cal.data('colpick').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colpick').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colpick').fields.eq(3).val(), 10)
|
||||
}));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 0]);
|
||||
},
|
||||
//Change style on blur and on focus of inputs
|
||||
blur = function (ev) {
|
||||
$(this).parent().removeClass('colpick_focus');
|
||||
},
|
||||
focus = function () {
|
||||
$(this).parent().parent().data('colpick').fields.parent().removeClass('colpick_focus');
|
||||
$(this).parent().addClass('colpick_focus');
|
||||
},
|
||||
//Increment/decrement arrows functions
|
||||
downIncrement = function (ev) {
|
||||
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colpick_slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colpick').livePreview
|
||||
};
|
||||
$(document).mouseup(current, upIncrement);
|
||||
$(document).mousemove(current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val - ev.pageY + ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colpick_slider').find('input').focus();
|
||||
$(document).off('mouseup', upIncrement);
|
||||
$(document).off('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
//Hue slider functions
|
||||
downHue = function (ev) {
|
||||
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
$(document).on('mouseup touchend',current,upHue);
|
||||
$(document).on('mousemove touchmove',current,moveHue);
|
||||
|
||||
var pageY = ((ev.type == 'touchstart') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
|
||||
change.apply(
|
||||
current.cal.data('colpick')
|
||||
.fields.eq(4).val(parseInt(360*(current.cal.data('colpick').height - (pageY - current.y))/current.cal.data('colpick').height, 10))
|
||||
.get(0),
|
||||
[current.cal.data('colpick').livePreview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
var pageY = ((ev.type == 'touchmove') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
|
||||
change.apply(
|
||||
ev.data.cal.data('colpick')
|
||||
.fields.eq(4).val(parseInt(360*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.y))))/ev.data.cal.data('colpick').height, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||
$(document).off('mouseup touchend',upHue);
|
||||
$(document).off('mousemove touchmove',moveHue);
|
||||
return false;
|
||||
},
|
||||
//Color selector functions
|
||||
downSelector = function (ev) {
|
||||
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colpick').livePreview;
|
||||
|
||||
$(document).on('mouseup touchend',current,upSelector);
|
||||
$(document).on('mousemove touchmove',current,moveSelector);
|
||||
|
||||
var payeX,pageY;
|
||||
if(ev.type == 'touchstart') {
|
||||
pageX = ev.originalEvent.changedTouches[0].pageX,
|
||||
pageY = ev.originalEvent.changedTouches[0].pageY;
|
||||
} else {
|
||||
pageX = ev.pageX;
|
||||
pageY = ev.pageY;
|
||||
}
|
||||
|
||||
change.apply(
|
||||
current.cal.data('colpick').fields
|
||||
.eq(6).val(parseInt(100*(current.cal.data('colpick').height - (pageY - current.pos.top))/current.cal.data('colpick').height, 10)).end()
|
||||
.eq(5).val(parseInt(100*(pageX - current.pos.left)/current.cal.data('colpick').height, 10))
|
||||
.get(0),
|
||||
[current.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
var payeX,pageY;
|
||||
if(ev.type == 'touchmove') {
|
||||
pageX = ev.originalEvent.changedTouches[0].pageX,
|
||||
pageY = ev.originalEvent.changedTouches[0].pageY;
|
||||
} else {
|
||||
pageX = ev.pageX;
|
||||
pageY = ev.pageY;
|
||||
}
|
||||
|
||||
change.apply(
|
||||
ev.data.cal.data('colpick').fields
|
||||
.eq(6).val(parseInt(100*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.pos.top))))/ev.data.cal.data('colpick').height, 10)).end()
|
||||
.eq(5).val(parseInt(100*(Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageX - ev.data.pos.left))))/ev.data.cal.data('colpick').height, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||
$(document).off('mouseup touchend',upSelector);
|
||||
$(document).off('mousemove touchmove',moveSelector);
|
||||
return false;
|
||||
},
|
||||
//Submit button
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colpick').color;
|
||||
cal.data('colpick').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colpick').onSubmit(col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el);
|
||||
},
|
||||
//Show/hide the color picker
|
||||
show = function (ev) {
|
||||
// Prevent the trigger of any direct parent
|
||||
ev.stopPropagation();
|
||||
var cal = $('#' + $(this).data('colpickId'));
|
||||
cal.data('colpick').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
var viewPort = getViewport();
|
||||
var calW = cal.width();
|
||||
if (left + calW > viewPort.l + viewPort.w) {
|
||||
left -= calW;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colpick').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
//Hide when user clicks outside
|
||||
$('html').mousedown({cal:cal}, hide);
|
||||
cal.mousedown(function(ev){ev.stopPropagation();})
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (ev.data.cal.data('colpick').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$('html').off('mousedown', hide);
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth)
|
||||
};
|
||||
},
|
||||
//Fix the values if the user enters a negative or high value
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
restoreOriginal = function () {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colpick').origColor;
|
||||
cal.data('colpick').color = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
};
|
||||
return {
|
||||
init: function (opt) {
|
||||
opt = $.extend({}, defaults, opt||{});
|
||||
//Set color
|
||||
if (typeof opt.color == 'string') {
|
||||
opt.color = hexToHsb(opt.color);
|
||||
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||
opt.color = rgbToHsb(opt.color);
|
||||
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||
opt.color = fixHSB(opt.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
|
||||
//For each selected DOM element
|
||||
return this.each(function () {
|
||||
//If the element does not have an ID
|
||||
if (!$(this).data('colpickId')) {
|
||||
var options = $.extend({}, opt);
|
||||
options.origColor = opt.color;
|
||||
//Generate and assign a random ID
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colpickId', id);
|
||||
//Set the tpl's ID and get the HTML
|
||||
var cal = $(tpl).attr('id', id);
|
||||
//Add class according to layout
|
||||
cal.addClass('colpick_'+options.layout+(options.submit?'':' colpick_'+options.layout+'_ns'));
|
||||
//Add class if the color scheme is not default
|
||||
if(options.colorScheme != 'light') {
|
||||
cal.addClass('colpick_'+options.colorScheme);
|
||||
}
|
||||
//Setup submit button
|
||||
cal.find('div.colpick_submit').html(options.submitText).click(clickSubmit);
|
||||
//Setup input fields
|
||||
options.fields = cal.find('input').change(change).blur(blur).focus(focus);
|
||||
cal.find('div.colpick_field_arrs').mousedown(downIncrement).end().find('div.colpick_current_color').click(restoreOriginal);
|
||||
//Setup hue selector
|
||||
options.selector = cal.find('div.colpick_color').on('mousedown touchstart',downSelector);
|
||||
options.selectorIndic = options.selector.find('div.colpick_selector_outer');
|
||||
//Store parts of the plugin
|
||||
options.el = this;
|
||||
options.hue = cal.find('div.colpick_hue_arrs');
|
||||
huebar = options.hue.parent();
|
||||
//Paint the hue bar
|
||||
var UA = navigator.userAgent.toLowerCase();
|
||||
var isIE = navigator.appName === 'Microsoft Internet Explorer';
|
||||
var IEver = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
|
||||
var ngIE = ( isIE && IEver < 10 );
|
||||
var stops = ['#ff0000','#ff0080','#ff00ff','#8000ff','#0000ff','#0080ff','#00ffff','#00ff80','#00ff00','#80ff00','#ffff00','#ff8000','#ff0000'];
|
||||
if(ngIE) {
|
||||
var i, div;
|
||||
for(i=0; i<=11; i++) {
|
||||
div = $('<div></div>').attr('style','height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+')";');
|
||||
huebar.append(div);
|
||||
}
|
||||
} else {
|
||||
stopList = stops.join(',');
|
||||
huebar.attr('style','background:-webkit-linear-gradient(top,'+stopList+'); background: -o-linear-gradient(top,'+stopList+'); background: -ms-linear-gradient(top,'+stopList+'); background:-moz-linear-gradient(top,'+stopList+'); -webkit-linear-gradient(top,'+stopList+'); background:linear-gradient(to bottom,'+stopList+'); ');
|
||||
}
|
||||
cal.find('div.colpick_hue').on('mousedown touchstart',downHue);
|
||||
options.newColor = cal.find('div.colpick_new_color');
|
||||
options.currentColor = cal.find('div.colpick_current_color');
|
||||
//Store options and fill with default color
|
||||
cal.data('colpick', options);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
//Append to body if flat=false, else show in place
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
$(this).on(options.showEvent, show);
|
||||
cal.css({
|
||||
position:'absolute'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//Shows the picker
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colpickId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
//Hides the picker
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colpickId')) {
|
||||
$('#' + $(this).data('colpickId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//Sets a color as new and current (default)
|
||||
setColor: function(col, setCurrent) {
|
||||
setCurrent = (typeof setCurrent === "undefined") ? 1 : setCurrent;
|
||||
if (typeof col == 'string') {
|
||||
col = hexToHsb(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = rgbToHsb(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colpickId')) {
|
||||
var cal = $('#' + $(this).data('colpickId'));
|
||||
cal.data('colpick').color = col;
|
||||
cal.data('colpick').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colpick').onChange.apply(cal.parent(), [col, hsbToHex(col), hsbToRgb(col), cal.data('colpick').el, 1]);
|
||||
if(setCurrent) {
|
||||
setCurrentColor(col, cal.get(0));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
//Color space convertions
|
||||
var hexToRgb = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
};
|
||||
var hexToHsb = function (hex) {
|
||||
return rgbToHsb(hexToRgb(hex));
|
||||
};
|
||||
var rgbToHsb = function (rgb) {
|
||||
var hsb = {h: 0, s: 0, b: 0};
|
||||
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta;
|
||||
else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||
else hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||
} else hsb.h = -1;
|
||||
hsb.h *= 60;
|
||||
if (hsb.h < 0) hsb.h += 360;
|
||||
hsb.s *= 100/255;
|
||||
hsb.b *= 100/255;
|
||||
return hsb;
|
||||
};
|
||||
var hsbToRgb = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = hsb.h;
|
||||
var s = hsb.s*255/100;
|
||||
var v = hsb.b*255/100;
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
};
|
||||
var rgbToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
};
|
||||
var hsbToHex = function (hsb) {
|
||||
return rgbToHex(hsbToRgb(hsb));
|
||||
};
|
||||
$.fn.extend({
|
||||
colpick: colpick.init,
|
||||
colpickHide: colpick.hidePicker,
|
||||
colpickShow: colpick.showPicker,
|
||||
colpickSetColor: colpick.setColor
|
||||
});
|
||||
$.extend({
|
||||
colpick:{
|
||||
rgbToHex: rgbToHex,
|
||||
rgbToHsb: rgbToHsb,
|
||||
hsbToHex: hsbToHex,
|
||||
hsbToRgb: hsbToRgb,
|
||||
hexToHsb: hexToHsb,
|
||||
hexToRgb: hexToRgb
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
14879
shlr/www/p/lib/js/jquery-ui-latest.js
vendored
@ -1,36 +0,0 @@
|
||||
;(function($){
|
||||
$.fn.extend({
|
||||
donetyping: function(callback,timeout){
|
||||
timeout = timeout || 1e3; // 1 second default timeout
|
||||
var timeoutReference,
|
||||
doneTyping = function(el){
|
||||
if (!timeoutReference) return;
|
||||
timeoutReference = null;
|
||||
callback.call(el);
|
||||
};
|
||||
return this.each(function(i,el){
|
||||
var $el = $(el);
|
||||
// Chrome Fix (Use keyup over keypress to detect backspace)
|
||||
// thank you @palerdot
|
||||
$el.is(':input') && $el.on('keyup keypress',function(e){
|
||||
// This catches the backspace button in chrome, but also prevents
|
||||
// the event from triggering too premptively. Without this line,
|
||||
// using tab/shift+tab will make the focused element fire the callback.
|
||||
if (e.type=='keyup' && e.keyCode!=8) return;
|
||||
|
||||
// Check if timeout has been set. If it has, "reset" the clock and
|
||||
// start over again.
|
||||
if (timeoutReference) clearTimeout(timeoutReference);
|
||||
timeoutReference = setTimeout(function(){
|
||||
// if we made it here, our timeout has elapsed. Fire the
|
||||
// callback
|
||||
doneTyping(el);
|
||||
}, timeout);
|
||||
}).on('blur',function(){
|
||||
// If we can, fire the event since we're leaving the field
|
||||
doneTyping(el);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* UI Layout Callback: resizePaneAccordions
|
||||
*
|
||||
* This callback is used when a layout-pane contains 1 or more accordions
|
||||
* - whether the accordion a child of the pane or is nested within other elements
|
||||
* Assign this callback to the pane.onresize event:
|
||||
*
|
||||
* SAMPLE:
|
||||
* < jQuery UI 1.9: $("#elem").tabs({ show: $.layout.callbacks.resizePaneAccordions });
|
||||
* > jQuery UI 1.9: $("#elem").tabs({ activate: $.layout.callbacks.resizePaneAccordions });
|
||||
* $("body").layout({ center__onresize: $.layout.callbacks.resizePaneAccordions });
|
||||
*
|
||||
* Version: 1.2 - 2013-01-12
|
||||
* Author: Kevin Dalman (kevin@jquery-dev.com)
|
||||
*/
|
||||
;(function ($) {
|
||||
var _ = $.layout;
|
||||
|
||||
// make sure the callbacks branch exists
|
||||
if (!_.callbacks) _.callbacks = {};
|
||||
|
||||
_.callbacks.resizePaneAccordions = function (x, ui) {
|
||||
// may be called EITHER from layout-pane.onresize OR tabs.show
|
||||
var $P = ui.jquery ? ui : $(ui.newPanel || ui.panel);
|
||||
// find all VISIBLE accordions inside this pane and resize them
|
||||
$P.find(".ui-accordion:visible").each(function(){
|
||||
var $E = $(this);
|
||||
if ($E.data("accordion")) // jQuery < 1.9
|
||||
$E.accordion("resize");
|
||||
if ($E.data("ui-accordion")) // jQuery >= 1.9
|
||||
$E.accordion("refresh");
|
||||
});
|
||||
};
|
||||
})( jQuery );
|
@ -1,413 +0,0 @@
|
||||
/** jquery.onoff - v0.4.0 - 2014-10-30
|
||||
* https://github.com/timmywil/jquery.onoff
|
||||
* Copyright (c) 2014 Timmy Willison; Licensed MIT */
|
||||
(function(global, factory) {
|
||||
// AMD
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([ 'jquery' ], factory);
|
||||
// CommonJS/Browserify
|
||||
} else if (typeof exports === 'object') {
|
||||
factory(require('jquery'));
|
||||
// Global
|
||||
} else {
|
||||
factory(global.jQuery);
|
||||
}
|
||||
}(this, function($) {
|
||||
'use strict';
|
||||
|
||||
// Common properties to lift for touch or pointer events
|
||||
var list = 'over out down up move enter leave cancel'.split(' ');
|
||||
var hook = $.extend({}, $.event.mouseHooks);
|
||||
var events = {};
|
||||
|
||||
// Support pointer events in IE11+ if available
|
||||
if ( window.PointerEvent ) {
|
||||
$.each(list, function( i, name ) {
|
||||
// Add event name to events property and add fixHook
|
||||
$.event.fixHooks[
|
||||
(events[name] = 'pointer' + name)
|
||||
] = hook;
|
||||
});
|
||||
} else {
|
||||
var mouseProps = hook.props;
|
||||
// Add touch properties for the touch hook
|
||||
hook.props = mouseProps.concat(['touches', 'changedTouches', 'targetTouches', 'altKey', 'ctrlKey', 'metaKey', 'shiftKey']);
|
||||
|
||||
/**
|
||||
* Support: Android
|
||||
* Android sets pageX/Y to 0 for any touch event
|
||||
* Attach first touch's pageX/pageY and clientX/clientY if not set correctly
|
||||
*/
|
||||
hook.filter = function( event, originalEvent ) {
|
||||
var touch;
|
||||
var i = mouseProps.length;
|
||||
if ( !originalEvent.pageX && originalEvent.touches && (touch = originalEvent.touches[0]) ) {
|
||||
// Copy over all mouse properties
|
||||
while(i--) {
|
||||
event[mouseProps[i]] = touch[mouseProps[i]];
|
||||
}
|
||||
}
|
||||
return event;
|
||||
};
|
||||
|
||||
$.each(list, function( i, name ) {
|
||||
// No equivalent touch events for over and out
|
||||
if (i < 2) {
|
||||
events[ name ] = 'mouse' + name;
|
||||
} else {
|
||||
var touch = 'touch' +
|
||||
(name === 'down' ? 'start' : name === 'up' ? 'end' : name);
|
||||
// Add fixHook
|
||||
$.event.fixHooks[ touch ] = hook;
|
||||
// Add event names to events property
|
||||
events[ name ] = touch + ' mouse' + name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$.pointertouch = events;
|
||||
|
||||
var count = 1;
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
/**
|
||||
* Create an OnOff object for a given element
|
||||
* @constructor
|
||||
* @param {Element} elem - Element to use pan and zoom
|
||||
* @param {Object} [options] - An object literal containing options
|
||||
* to override default options (See OnOff.defaults)
|
||||
*/
|
||||
function OnOff(elem, options) {
|
||||
|
||||
// Allow instantiation without `new` keyword
|
||||
if (!(this instanceof OnOff)) {
|
||||
return new OnOff(elem, options);
|
||||
}
|
||||
|
||||
// Sanity checks
|
||||
if (elem.nodeName.toLowerCase() !== 'input' || elem.type !== 'checkbox') {
|
||||
return $.error('OnOff should be called on checkboxes');
|
||||
}
|
||||
|
||||
// Don't remake
|
||||
var d = $.data(elem, OnOff.datakey);
|
||||
if (d) {
|
||||
return d;
|
||||
}
|
||||
|
||||
// Extend default with given object literal
|
||||
// Each instance gets its own options
|
||||
this.options = options = $.extend({}, OnOff.defaults, options);
|
||||
this.elem = elem;
|
||||
this.$elem = $(elem).addClass(options.className);
|
||||
this.$doc = $(elem.ownerDocument || document);
|
||||
|
||||
// Add guid to event namespace
|
||||
options.namespace += $.guid++;
|
||||
|
||||
// Add an ID if none has been added
|
||||
if (!elem.id) {
|
||||
elem.id = 'onoffswitch' + count++;
|
||||
}
|
||||
|
||||
// Enable
|
||||
this.enable();
|
||||
|
||||
// Save the instance
|
||||
$.data(elem, OnOff.datakey, this);
|
||||
}
|
||||
|
||||
OnOff.datakey = '_onoff';
|
||||
|
||||
OnOff.defaults = {
|
||||
// The event namespace
|
||||
// Should always be non-empty
|
||||
// Used to bind jQuery events without collisions
|
||||
namespace: '.onoff',
|
||||
|
||||
// The class added to the checkbox (see the CSS file)
|
||||
className: 'onoffswitch-checkbox'
|
||||
};
|
||||
|
||||
OnOff.prototype = {
|
||||
constructor: OnOff,
|
||||
|
||||
/**
|
||||
* @returns {OnOff} Returns the instance
|
||||
*/
|
||||
instance: function() {
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrap the checkbox and add the label element
|
||||
*/
|
||||
wrap: function() {
|
||||
var elem = this.elem;
|
||||
var $elem = this.$elem;
|
||||
var options = this.options;
|
||||
|
||||
// Get or create elem wrapper
|
||||
var $con = $elem.parent('.onoffswitch');
|
||||
if (!$con.length) {
|
||||
$elem.wrap('<div class="onoffswitch"></div>');
|
||||
$con = $elem.parent()
|
||||
.addClass(elem.className.replace(options.className, ''));
|
||||
}
|
||||
this.$con = $con;
|
||||
|
||||
// Get or create label
|
||||
var $label = $elem.next('label[for="' + elem.id + '"]');
|
||||
if (!$label.length) {
|
||||
$label = $('<label/>')
|
||||
.attr('for', elem.id)
|
||||
.insertAfter(elem);
|
||||
}
|
||||
this.$label = $label.addClass('onoffswitch-label');
|
||||
|
||||
// Inner
|
||||
var $inner = $label.find('.onoffswitch-inner');
|
||||
if (!$inner.length) {
|
||||
$inner = $('<span/>')
|
||||
.addClass('onoffswitch-inner')
|
||||
.prependTo($label);
|
||||
}
|
||||
this.$inner = $inner;
|
||||
|
||||
// Switch
|
||||
var $switch = $label.find('.onoffswitch-switch');
|
||||
if (!$switch.length) {
|
||||
$switch = $('<span/>')
|
||||
.addClass('onoffswitch-switch')
|
||||
.appendTo($label);
|
||||
}
|
||||
this.$switch = $switch;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles the move event on the switch
|
||||
*/
|
||||
_handleMove: function(e) {
|
||||
if (this.disabled) return;
|
||||
this.moved = true;
|
||||
this.lastX = e.pageX;
|
||||
var right = Math.max(Math.min(this.startX - this.lastX, this.maxRight), 0);
|
||||
this.$switch.css('right', right);
|
||||
this.$inner.css('marginLeft', -(right / this.maxRight) * 100 + '%');
|
||||
},
|
||||
|
||||
/**
|
||||
* Bind the move and end events to the document
|
||||
*/
|
||||
_startMove: function(e) {
|
||||
// Prevent default to avoid touch event collision
|
||||
e.preventDefault();
|
||||
var moveType, endType;
|
||||
if (e.type === 'pointerdown') {
|
||||
moveType = 'pointermove';
|
||||
endType = 'pointerup';
|
||||
} else if (e.type === 'touchstart') {
|
||||
moveType = 'touchmove';
|
||||
endType = 'touchend';
|
||||
} else {
|
||||
moveType = 'mousemove';
|
||||
endType = 'mouseup';
|
||||
}
|
||||
var elem = this.elem;
|
||||
var $elem = this.$elem;
|
||||
var ns = this.options.namespace;
|
||||
// Disable transitions
|
||||
var $handle = this.$switch;
|
||||
var handle = $handle[0];
|
||||
var $t = this.$inner.add($handle).css('transition', 'none');
|
||||
|
||||
// Starting values
|
||||
this.maxRight = this.$con.width() - $handle.width() -
|
||||
$.css(handle, 'margin-left', true) -
|
||||
$.css(handle, 'margin-right', true) -
|
||||
$.css(handle, 'border-left-width', true) -
|
||||
$.css(handle, 'border-right-width', true);
|
||||
var startChecked = elem.checked;
|
||||
this.moved = false;
|
||||
this.startX = e.pageX + (startChecked ? 0 : this.maxRight);
|
||||
|
||||
// Bind document events
|
||||
var self = this;
|
||||
var $doc = this.$doc
|
||||
.on(moveType + ns, $.proxy(this._handleMove, this))
|
||||
.on(endType + ns, function() {
|
||||
// Reenable transition
|
||||
$t.css('transition', '');
|
||||
$doc.off(ns);
|
||||
|
||||
setTimeout(function() {
|
||||
// If there was a move
|
||||
// ensure the proper checked value
|
||||
if (self.moved) {
|
||||
var checked = self.lastX > (self.startX - self.maxRight / 2);
|
||||
if (elem.checked !== checked) {
|
||||
elem.checked = checked;
|
||||
// Trigger change in case it wasn't already fired
|
||||
$elem.trigger('change');
|
||||
}
|
||||
}
|
||||
// Normalize CSS and animate
|
||||
self.$switch.css('right', '');
|
||||
self.$inner.css('marginLeft', '');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Binds all necessary events
|
||||
*/
|
||||
_bind: function() {
|
||||
this._unbind();
|
||||
this.$switch.on(
|
||||
$.pointertouch.down,
|
||||
$.proxy(this._startMove, this)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable or re-enable the onoff instance
|
||||
*/
|
||||
enable: function() {
|
||||
// Ensures the correct HTML before binding
|
||||
this.wrap();
|
||||
this._bind();
|
||||
this.disabled = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Unbind all events
|
||||
*/
|
||||
_unbind: function() {
|
||||
this.$doc.add(this.$switch).off(this.options.namespace);
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable onoff
|
||||
* Removes all added HTML
|
||||
*/
|
||||
disable: function() {
|
||||
this.disabled = true;
|
||||
this._unbind();
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all onoffswitch HTML and leaves the checkbox
|
||||
* Also disables this instance
|
||||
*/
|
||||
unwrap: function() {
|
||||
// Destroys this OnOff
|
||||
this.disable();
|
||||
this.$label.remove();
|
||||
this.$elem.unwrap().removeClass(this.options.className);
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns {Boolean} Returns whether the current onoff instance is disabled
|
||||
*/
|
||||
isDisabled: function() {
|
||||
return this.disabled;
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the onoff instance
|
||||
*/
|
||||
destroy: function() {
|
||||
this.disable();
|
||||
$.removeData(this.elem, OnOff.datakey);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get/set option on an existing instance
|
||||
* @returns {Array|undefined} If getting, returns an array of
|
||||
* all values on each instance for a given key. If setting,
|
||||
* continue chaining by returning undefined.
|
||||
*/
|
||||
option: function(key, value) {
|
||||
var newOpts;
|
||||
var options = this.options;
|
||||
if (!key) {
|
||||
// Avoids returning direct reference
|
||||
return $.extend({}, options);
|
||||
}
|
||||
|
||||
if (typeof key === 'string') {
|
||||
if (arguments.length === 1) {
|
||||
return options[ key ] !== undefined ?
|
||||
options[ key ] :
|
||||
null;
|
||||
}
|
||||
newOpts = {};
|
||||
newOpts[ key ] = value;
|
||||
} else {
|
||||
newOpts = key;
|
||||
}
|
||||
|
||||
// Set options
|
||||
$.each(newOpts, $.proxy(function(k, val) {
|
||||
switch(k) {
|
||||
case 'namespace':
|
||||
this._unbind();
|
||||
break;
|
||||
case 'className':
|
||||
this.$elem.removeClass(options.className);
|
||||
}
|
||||
options[ k ] = val;
|
||||
switch(k) {
|
||||
case 'namespace':
|
||||
this._bind();
|
||||
break;
|
||||
case 'className':
|
||||
this.$elem.addClass(val);
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Extend jQuery
|
||||
* @param {Object|String} options - The name of a method to call
|
||||
* on the prototype or an object literal of options
|
||||
* @returns {jQuery|Mixed} jQuery instance for regular chaining or
|
||||
* the return value(s) of a onoff method call
|
||||
*/
|
||||
$.fn.onoff = function(options) {
|
||||
var instance, args, m, ret;
|
||||
|
||||
// Call methods widget-style
|
||||
if (typeof options === 'string') {
|
||||
ret = [];
|
||||
args = slice.call(arguments, 1);
|
||||
this.each(function() {
|
||||
instance = $.data(this, OnOff.datakey);
|
||||
|
||||
if (!instance) {
|
||||
ret.push(undefined);
|
||||
|
||||
// Ignore methods beginning with `_`
|
||||
} else if (options.charAt(0) !== '_' &&
|
||||
typeof (m = instance[ options ]) === 'function' &&
|
||||
// If nothing is returned, do not add to return values
|
||||
(m = m.apply(instance, args)) !== undefined) {
|
||||
|
||||
ret.push(m);
|
||||
}
|
||||
});
|
||||
|
||||
// Return an array of values for the jQuery instances
|
||||
// Or the value itself if there is only one
|
||||
// Or keep chaining
|
||||
return ret.length ?
|
||||
(ret.length === 1 ? ret[0] : ret) :
|
||||
this;
|
||||
}
|
||||
|
||||
return this.each(function() { new OnOff(this, options); });
|
||||
};
|
||||
|
||||
return ($.OnOff = OnOff);
|
||||
}));
|
@ -1,187 +0,0 @@
|
||||
/*!
|
||||
* jQuery.scrollTo
|
||||
* Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
|
||||
* @projectDescription Easy element scrolling using jQuery.
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.14
|
||||
*/
|
||||
;(function (define) {
|
||||
'use strict';
|
||||
|
||||
define(['jquery'], function ($) {
|
||||
|
||||
var $scrollTo = $.scrollTo = function( target, duration, settings ) {
|
||||
return $(window).scrollTo( target, duration, settings );
|
||||
};
|
||||
|
||||
$scrollTo.defaults = {
|
||||
axis:'xy',
|
||||
duration: 0,
|
||||
limit:true
|
||||
};
|
||||
|
||||
// Returns the element that needs to be animated to scroll the window.
|
||||
// Kept for backwards compatibility (specially for localScroll & serialScroll)
|
||||
$scrollTo.window = function( scope ) {
|
||||
return $(window)._scrollable();
|
||||
};
|
||||
|
||||
// Hack, hack, hack :)
|
||||
// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
|
||||
$.fn._scrollable = function() {
|
||||
return this.map(function() {
|
||||
var elem = this,
|
||||
isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;
|
||||
|
||||
if (!isWin)
|
||||
return elem;
|
||||
|
||||
var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
|
||||
|
||||
return /webkit/i.test(navigator.userAgent) || doc.compatMode == 'BackCompat' ?
|
||||
doc.body :
|
||||
doc.documentElement;
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.scrollTo = function( target, duration, settings ) {
|
||||
if (typeof duration == 'object') {
|
||||
settings = duration;
|
||||
duration = 0;
|
||||
}
|
||||
if (typeof settings == 'function')
|
||||
settings = { onAfter:settings };
|
||||
|
||||
if (target == 'max')
|
||||
target = 9e9;
|
||||
|
||||
settings = $.extend( {}, $scrollTo.defaults, settings );
|
||||
// Speed is still recognized for backwards compatibility
|
||||
duration = duration || settings.duration;
|
||||
// Make sure the settings are given right
|
||||
settings.queue = settings.queue && settings.axis.length > 1;
|
||||
|
||||
if (settings.queue)
|
||||
// Let's keep the overall duration
|
||||
duration /= 2;
|
||||
settings.offset = both( settings.offset );
|
||||
settings.over = both( settings.over );
|
||||
|
||||
return this._scrollable().each(function() {
|
||||
// Null target yields nothing, just like jQuery does
|
||||
if (target == null) return;
|
||||
|
||||
var elem = this,
|
||||
$elem = $(elem),
|
||||
targ = target, toff, attr = {},
|
||||
win = $elem.is('html,body');
|
||||
|
||||
switch (typeof targ) {
|
||||
// A number will pass the regex
|
||||
case 'number':
|
||||
case 'string':
|
||||
if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
|
||||
targ = both( targ );
|
||||
// We are done
|
||||
break;
|
||||
}
|
||||
// Relative/Absolute selector, no break!
|
||||
targ = win ? $(targ) : $(targ, this);
|
||||
if (!targ.length) return;
|
||||
case 'object':
|
||||
// DOMElement / jQuery
|
||||
if (targ.is || targ.style)
|
||||
// Get the real position of the target
|
||||
toff = (targ = $(targ)).offset();
|
||||
}
|
||||
|
||||
var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
|
||||
|
||||
$.each( settings.axis.split(''), function( i, axis ) {
|
||||
var Pos = axis == 'x' ? 'Left' : 'Top',
|
||||
pos = Pos.toLowerCase(),
|
||||
key = 'scroll' + Pos,
|
||||
old = elem[key],
|
||||
max = $scrollTo.max(elem, axis);
|
||||
|
||||
if (toff) {// jQuery / DOMElement
|
||||
attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );
|
||||
|
||||
// If it's a dom element, reduce the margin
|
||||
if (settings.margin) {
|
||||
attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
|
||||
attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
|
||||
}
|
||||
|
||||
attr[key] += offset[pos] || 0;
|
||||
|
||||
if(settings.over[pos])
|
||||
// Scroll to a fraction of its width/height
|
||||
attr[key] += targ[axis=='x'?'width':'height']() * settings.over[pos];
|
||||
} else {
|
||||
var val = targ[pos];
|
||||
// Handle percentage values
|
||||
attr[key] = val.slice && val.slice(-1) == '%' ?
|
||||
parseFloat(val) / 100 * max
|
||||
: val;
|
||||
}
|
||||
|
||||
// Number or 'number'
|
||||
if (settings.limit && /^\d+$/.test(attr[key]))
|
||||
// Check the limits
|
||||
attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max );
|
||||
|
||||
// Queueing axes
|
||||
if (!i && settings.queue) {
|
||||
// Don't waste time animating, if there's no need.
|
||||
if (old != attr[key])
|
||||
// Intermediate animation
|
||||
animate( settings.onAfterFirst );
|
||||
// Don't animate this axis again in the next iteration.
|
||||
delete attr[key];
|
||||
}
|
||||
});
|
||||
|
||||
animate( settings.onAfter );
|
||||
|
||||
function animate( callback ) {
|
||||
$elem.animate( attr, duration, settings.easing, callback && function() {
|
||||
callback.call(this, targ, settings);
|
||||
});
|
||||
}
|
||||
}).end();
|
||||
};
|
||||
|
||||
// Max scrolling position, works on quirks mode
|
||||
// It only fails (not too badly) on IE, quirks mode.
|
||||
$scrollTo.max = function( elem, axis ) {
|
||||
var Dim = axis == 'x' ? 'Width' : 'Height',
|
||||
scroll = 'scroll'+Dim;
|
||||
|
||||
if (!$(elem).is('html,body'))
|
||||
return elem[scroll] - $(elem)[Dim.toLowerCase()]();
|
||||
|
||||
var size = 'client' + Dim,
|
||||
html = elem.ownerDocument.documentElement,
|
||||
body = elem.ownerDocument.body;
|
||||
|
||||
return Math.max( html[scroll], body[scroll] ) - Math.min( html[size] , body[size] );
|
||||
};
|
||||
|
||||
function both( val ) {
|
||||
return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
|
||||
}
|
||||
|
||||
// AMD requirement
|
||||
return $scrollTo;
|
||||
})
|
||||
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
// Node
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}));
|
@ -1,430 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* jquery.ui-contextmenu.js plugin.
|
||||
*
|
||||
* jQuery plugin that provides a context menu (based on the jQueryUI menu widget).
|
||||
*
|
||||
* @see https://github.com/mar10/jquery-ui-contextmenu
|
||||
*
|
||||
* Copyright (c) 2014, Martin Wendt (http://wwWendt.de). Licensed MIT.
|
||||
*/
|
||||
|
||||
(function( factory ) {
|
||||
"use strict";
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([ "jquery" ], factory );
|
||||
} else {
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
}(function( $ ) {
|
||||
"use strict";
|
||||
var supportSelectstart = "onselectstart" in document.createElement("div"),
|
||||
match, uiVersion;
|
||||
|
||||
$.widget("moogle.contextmenu", {
|
||||
version: "@VERSION",
|
||||
options: {
|
||||
autoTrigger: true, // open menu on browser's `contextmenu` event
|
||||
delegate: null, // selector
|
||||
hide: { effect: "fadeOut", duration: "fast"},
|
||||
ignoreParentSelect: true, // Don't trigger 'select' for sub-menu parents
|
||||
menu: null, // selector or jQuery pointing to <UL>, or a definition hash
|
||||
position: null, // popup positon
|
||||
preventContextMenuForPopup: false, // prevent opening the browser's system context menu on menu entries
|
||||
preventSelect: false, // disable text selection of target
|
||||
show: { effect: "slideDown", duration: "fast"},
|
||||
taphold: false, // open menu on taphold events (requires external plugins)
|
||||
uiMenuOptions: {}, // Additional options, used when UI Menu is created
|
||||
// Events:
|
||||
beforeOpen: $.noop, // menu about to open; return `false` to prevent opening
|
||||
blur: $.noop, // menu option lost focus
|
||||
close: $.noop, // menu was closed
|
||||
create: $.noop, // menu was initialized
|
||||
createMenu: $.noop, // menu was initialized (original UI Menu)
|
||||
focus: $.noop, // menu option got focus
|
||||
open: $.noop, // menu was opened
|
||||
select: $.noop // menu option was selected; return `false` to prevent closing
|
||||
},
|
||||
/** Constructor */
|
||||
_create: function () {
|
||||
var cssText, eventNames, targetId,
|
||||
opts = this.options;
|
||||
|
||||
this.$headStyle = null;
|
||||
this.$menu = null;
|
||||
this.menuIsTemp = false;
|
||||
this.currentTarget = null;
|
||||
|
||||
if(opts.preventSelect){
|
||||
// Create a global style for all potential menu targets
|
||||
// If the contextmenu was bound to `document`, we apply the
|
||||
// selector relative to the <body> tag instead
|
||||
targetId = ($(this.element).is(document) ? $("body") : this.element).uniqueId().attr("id");
|
||||
cssText = "#" + targetId + " " + opts.delegate + " { " +
|
||||
"-webkit-user-select: none; " +
|
||||
"-khtml-user-select: none; " +
|
||||
"-moz-user-select: none; " +
|
||||
"-ms-user-select: none; " +
|
||||
"user-select: none; " +
|
||||
"}";
|
||||
this.$headStyle = $("<style class='moogle-contextmenu-style' />")
|
||||
.prop("type", "text/css")
|
||||
.appendTo("head");
|
||||
|
||||
try {
|
||||
this.$headStyle.html(cssText);
|
||||
} catch( e ) {
|
||||
// issue #47: fix for IE 6-8
|
||||
this.$headStyle[0].styleSheet.cssText = cssText;
|
||||
}
|
||||
|
||||
// TODO: the selectstart is not supported by FF?
|
||||
if(supportSelectstart){
|
||||
this.element.delegate(opts.delegate, "selectstart" + this.eventNamespace, function(event){
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
this._createUiMenu(opts.menu);
|
||||
|
||||
eventNames = "contextmenu" + this.eventNamespace;
|
||||
if(opts.taphold){
|
||||
eventNames += " taphold" + this.eventNamespace;
|
||||
}
|
||||
this.element.delegate(opts.delegate, eventNames, $.proxy(this._openMenu, this));
|
||||
},
|
||||
/** Destructor, called on $().contextmenu("destroy"). */
|
||||
_destroy: function(){
|
||||
this.element.undelegate(this.eventNamespace);
|
||||
|
||||
this._createUiMenu(null);
|
||||
|
||||
if(this.$headStyle){
|
||||
this.$headStyle.remove();
|
||||
this.$headStyle = null;
|
||||
}
|
||||
},
|
||||
/** (Re)Create jQuery UI Menu. */
|
||||
_createUiMenu: function(menuDef){
|
||||
var ct;
|
||||
// Remove temporary <ul> if any
|
||||
if(this.isOpen()){
|
||||
ct = this.currentTarget; // #58: 'replaceMenu' in beforeOpen causing select: to lose ui.target
|
||||
// close without animation, to force async mode
|
||||
this._closeMenu(true);
|
||||
this.currentTarget = ct;
|
||||
}
|
||||
|
||||
if(this.menuIsTemp){
|
||||
this.$menu.remove(); // this will also destroy ui.menu
|
||||
} else if(this.$menu){
|
||||
this.$menu.menu("destroy").hide();
|
||||
}
|
||||
this.$menu = null;
|
||||
this.menuIsTemp = false;
|
||||
// If a menu definition array was passed, create a hidden <ul>
|
||||
// and generate the structure now
|
||||
if( ! menuDef ){
|
||||
return;
|
||||
} else if($.isArray(menuDef)){
|
||||
this.$menu = $.moogle.contextmenu.createMenuMarkup(menuDef);
|
||||
this.menuIsTemp = true;
|
||||
}else if ( typeof menuDef === "string" ){
|
||||
this.$menu = $(menuDef);
|
||||
}else{
|
||||
this.$menu = menuDef;
|
||||
}
|
||||
// Create - but hide - the jQuery UI Menu widget
|
||||
this.$menu
|
||||
.hide()
|
||||
// .addClass("moogle-contextmenu")
|
||||
// Create a menu instance that delegates events to our widget
|
||||
.menu($.extend(true, {}, this.options.uiMenuOptions, {
|
||||
blur: $.proxy(this.options.blur, this),
|
||||
create: $.proxy(this.options.createMenu, this),
|
||||
focus: $.proxy(this.options.focus, this),
|
||||
select: $.proxy(function(event, ui){
|
||||
// User selected a menu entry
|
||||
var retval,
|
||||
isParent = $.moogle.contextmenu.isMenu(ui.item),
|
||||
actionHandler = ui.item.data("actionHandler");
|
||||
ui.cmd = ui.item.attr("data-command");
|
||||
ui.target = $(this.currentTarget);
|
||||
// ignore clicks, if they only open a sub-menu
|
||||
if( !isParent || !this.options.ignoreParentSelect){
|
||||
retval = this._trigger.call(this, "select", event, ui);
|
||||
if( actionHandler ){
|
||||
retval = actionHandler.call(this, event, ui);
|
||||
}
|
||||
if( retval !== false ){
|
||||
this._closeMenu.call(this);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}, this)
|
||||
}));
|
||||
},
|
||||
/** Open popup (called on 'contextmenu' event). */
|
||||
_openMenu: function(event){
|
||||
var opts = this.options,
|
||||
posOption = opts.position,
|
||||
self = this,
|
||||
manualTrigger = !!event.isTrigger,
|
||||
ui = {menu: this.$menu, target: $(event.target), extraData: event.extraData, originalEvent: event};
|
||||
|
||||
if( !opts.autoTrigger && !manualTrigger ) {
|
||||
// ignore browser's `contextmenu` events
|
||||
return;
|
||||
}
|
||||
this.currentTarget = event.target;
|
||||
|
||||
// Prevent browser from opening the system context menu
|
||||
event.preventDefault();
|
||||
|
||||
if( this._trigger("beforeOpen", event, ui) === false ){
|
||||
this.currentTarget = null;
|
||||
return false;
|
||||
}
|
||||
ui.menu = this.$menu; // Might have changed in beforeOpen
|
||||
// Register global event handlers that close the dropdown-menu
|
||||
$(document).bind("keydown" + this.eventNamespace, function(event){
|
||||
if( event.which === $.ui.keyCode.ESCAPE ){
|
||||
self._closeMenu();
|
||||
}
|
||||
}).bind("mousedown" + this.eventNamespace + " touchstart" + this.eventNamespace, function(event){
|
||||
// Close menu when clicked outside menu
|
||||
if( !$(event.target).closest(".ui-menu-item").length ){
|
||||
self._closeMenu();
|
||||
}
|
||||
});
|
||||
|
||||
// required for custom positioning (issue #18 and #13).
|
||||
if ($.isFunction(posOption)) {
|
||||
posOption = posOption(event, ui);
|
||||
}
|
||||
posOption = $.extend({
|
||||
my: "left top",
|
||||
at: "left bottom",
|
||||
// if called by 'open' method, event does not have pageX/Y
|
||||
of: (event.pageX === undefined) ? event.target : event,
|
||||
collision: "fit"
|
||||
}, posOption);
|
||||
|
||||
// Finally display the popup
|
||||
this.$menu
|
||||
.show() // required to fix positioning error
|
||||
.css({
|
||||
position: "absolute",
|
||||
left: 0,
|
||||
top: 0
|
||||
}).position(posOption)
|
||||
.hide(); // hide again, so we can apply nice effects
|
||||
|
||||
if( opts.preventContextMenuForPopup ) {
|
||||
this.$menu.bind("contextmenu" + this.eventNamespace, function(event){
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
this._show(this.$menu, this.options.show, function(){
|
||||
self._trigger.call(self, "open", event, ui);
|
||||
});
|
||||
},
|
||||
/** Close popup. */
|
||||
_closeMenu: function(immediately){
|
||||
var self = this,
|
||||
hideOpts = immediately ? false : this.options.hide;
|
||||
|
||||
// Note: we don't want to unbind the 'contextmenu' event
|
||||
$(document)
|
||||
.unbind("mousedown" + this.eventNamespace)
|
||||
.unbind("touchstart" + this.eventNamespace)
|
||||
.unbind("keydown" + this.eventNamespace);
|
||||
this.$menu
|
||||
.unbind("contextmenu" + this.eventNamespace);
|
||||
self.currentTarget = null; // issue #44 after hide animation is too late
|
||||
|
||||
this._hide(this.$menu, hideOpts, function() {
|
||||
self._trigger("close");
|
||||
});
|
||||
},
|
||||
/** Handle $().contextmenu("option", key, value) calls. */
|
||||
_setOption: function(key, value){
|
||||
switch(key){
|
||||
case "menu":
|
||||
this.replaceMenu(value);
|
||||
break;
|
||||
}
|
||||
$.Widget.prototype._setOption.apply(this, arguments);
|
||||
},
|
||||
/** Return ui-menu entry (<LI> tag). */
|
||||
_getMenuEntry: function(cmd){
|
||||
return this.$menu.find("li[data-command=" + cmd + "]");
|
||||
},
|
||||
/** Close context menu. */
|
||||
close: function(){
|
||||
if(this.isOpen()){
|
||||
this._closeMenu();
|
||||
}
|
||||
},
|
||||
/** Enable or disable the menu command. */
|
||||
enableEntry: function(cmd, flag){
|
||||
this._getMenuEntry(cmd).toggleClass("ui-state-disabled", (flag === false));
|
||||
},
|
||||
/** Return Menu element (UL). */
|
||||
getMenu: function(){
|
||||
return this.$menu;
|
||||
},
|
||||
/** Return true if menu is open. */
|
||||
isOpen: function(){
|
||||
// return this.$menu && this.$menu.is(":visible");
|
||||
return !!this.$menu && !!this.currentTarget;
|
||||
},
|
||||
/** Open context menu on a specific target (must match options.delegate)
|
||||
* Optional `extraData` is passed to event handlers as `ui.extraData`.
|
||||
*/
|
||||
open: function(target, extraData){
|
||||
// Fake a 'contextmenu' event
|
||||
extraData = extraData || {};
|
||||
var e = jQuery.Event("contextmenu", {target: target.get(0), extraData: extraData});
|
||||
return this.element.trigger(e);
|
||||
},
|
||||
/** Replace the menu altogether. */
|
||||
replaceMenu: function(data){
|
||||
this._createUiMenu(data);
|
||||
},
|
||||
/** Redefine menu entry (title or all of it). */
|
||||
setEntry: function(cmd, titleOrData){
|
||||
var $entry = this._getMenuEntry(cmd);
|
||||
|
||||
if(typeof titleOrData === "string"){
|
||||
$.moogle.contextmenu.updateTitle($entry, titleOrData);
|
||||
}else{
|
||||
$entry.empty();
|
||||
titleOrData.cmd = titleOrData.cmd || cmd;
|
||||
$.moogle.contextmenu.createEntryMarkup(titleOrData, $entry);
|
||||
}
|
||||
},
|
||||
/** Show or hide the menu command. */
|
||||
showEntry: function(cmd, flag){
|
||||
this._getMenuEntry(cmd).toggle(flag !== false);
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Global functions
|
||||
*/
|
||||
$.extend($.moogle.contextmenu, {
|
||||
/** Convert a nested array of command objects into a <ul> structure. */
|
||||
createMenuMarkup: function(options, $parentUl){
|
||||
var i, menu, $ul, $li;
|
||||
if( $parentUl == null ){
|
||||
$parentUl = $("<ul class='ui-helper-hidden' />").appendTo("body");
|
||||
}
|
||||
for(i = 0; i < options.length; i++){
|
||||
menu = options[i];
|
||||
$li = $("<li/>").appendTo($parentUl);
|
||||
|
||||
$.moogle.contextmenu.createEntryMarkup(menu, $li);
|
||||
|
||||
if( $.isArray(menu.children) ){
|
||||
$ul = $("<ul/>").appendTo($li);
|
||||
$.moogle.contextmenu.createMenuMarkup(menu.children, $ul);
|
||||
}
|
||||
}
|
||||
return $parentUl;
|
||||
},
|
||||
/** Replaces the value of elem's first text node child*/
|
||||
replaceFirstTextNodeChild: function(elem, text) {
|
||||
elem
|
||||
.contents()
|
||||
.filter(function(){ return this.nodeType === 3; })
|
||||
.first()
|
||||
.replaceWith(text);
|
||||
}
|
||||
});
|
||||
|
||||
match = $.ui.menu.version.match(/^(\d)\.(\d+)/);
|
||||
|
||||
uiVersion = {
|
||||
major: parseInt(match[1], 10),
|
||||
minor: parseInt(match[2], 10)
|
||||
};
|
||||
|
||||
if ( uiVersion.major < 2 && uiVersion.minor < 11 ) {
|
||||
$.extend($.moogle.contextmenu, {
|
||||
/** Convert a menu description into a into a <li> content. */
|
||||
createEntryMarkup: function(entry, $parentLi){
|
||||
var $a = null;
|
||||
|
||||
// if(entry.title.match(/^---/)){
|
||||
if( !/[^\-\u2014\u2013\s]/.test( entry.title ) ){
|
||||
// hyphen, em dash, en dash: separator as defined by UI Menu 1.10
|
||||
$parentLi.text(entry.title);
|
||||
}else{
|
||||
$parentLi.attr("data-command", entry.cmd);
|
||||
$a = $("<a/>", {
|
||||
html: "" + entry.title, // allow to pass HTML markup
|
||||
href: "#"
|
||||
}).appendTo($parentLi);
|
||||
if( $.isFunction(entry.action) ){
|
||||
$parentLi.data("actionHandler", entry.action);
|
||||
}
|
||||
if(entry.uiIcon){
|
||||
$a.append($("<span class='ui-icon' />").addClass(entry.uiIcon));
|
||||
}
|
||||
if(entry.disabled){
|
||||
$parentLi.addClass("ui-state-disabled");
|
||||
}
|
||||
if($.isPlainObject(entry.data)){
|
||||
$a.data(entry.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
/** Returns true if the menu item has child menu items */
|
||||
isMenu: function(item) {
|
||||
return item.has(">a[aria-haspopup='true']").length > 0;
|
||||
},
|
||||
/** Updates the menu item's title */
|
||||
updateTitle: function(item, title) {
|
||||
$.moogle.contextmenu.replaceFirstTextNodeChild($("a", item), title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.extend($.moogle.contextmenu, {
|
||||
/** Convert a menu description into a into a <li> content. */
|
||||
createEntryMarkup: function(entry, $parentLi){
|
||||
if( !/[^\-\u2014\u2013\s]/.test( entry.title ) ){
|
||||
$parentLi.text(entry.title);
|
||||
} else {
|
||||
$parentLi
|
||||
.attr("data-command", entry.cmd)
|
||||
.html("" + entry.title);
|
||||
if( $.isFunction(entry.action) ) {
|
||||
$parentLi.data("actionHandler", entry.action);
|
||||
}
|
||||
if( entry.uiIcon ) {
|
||||
$parentLi
|
||||
.append($("<span class='ui-icon' />")
|
||||
.addClass(entry.uiIcon));
|
||||
}
|
||||
if( entry.disabled ) {
|
||||
$parentLi.addClass("ui-state-disabled");
|
||||
}
|
||||
if( $.isPlainObject(entry.data) ) {
|
||||
$parentLi.data(entry.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
/** Returns true if the menu item has child menu items */
|
||||
isMenu: function(item) {
|
||||
return item.is("[aria-haspopup='true']");
|
||||
},
|
||||
/** Updates the menu item's title */
|
||||
updateTitle: function(item, title) {
|
||||
$.moogle.contextmenu.replaceFirstTextNodeChild(item, title);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}));
|
@ -1,364 +0,0 @@
|
||||
var myLayout;
|
||||
|
||||
$(document).ready( function() {
|
||||
// create tabs FIRST so elems are correct size BEFORE Layout measures them
|
||||
$("#main_panel").tabs({
|
||||
select: function( event, ui ) {
|
||||
if (ui.tab.innerHTML.indexOf("Entropy") > -1) r2ui._ent.render();
|
||||
else if(ui.tab.innerHTML.indexOf("Strings") > -1) r2ui._str.render();
|
||||
else if(ui.tab.innerHTML.indexOf("Types") > -1) r2ui._typ.render();
|
||||
else if(ui.tab.innerHTML.indexOf("Settings") > -1) r2ui._set.render();
|
||||
else if(ui.tab.innerHTML.indexOf("Projects") > -1) r2ui._prj.render();
|
||||
else if(ui.tab.innerHTML.indexOf("Hex") > -1) r2ui._hex.render();
|
||||
},
|
||||
activate: function( event, ui ) {
|
||||
if ( ui.newTab[0].innerHTML.indexOf("Disas") > -1 ) {r2ui._dis.render();}
|
||||
}
|
||||
});
|
||||
|
||||
// Layout
|
||||
myLayout = $('body').layout({
|
||||
west__size: 200,
|
||||
east__size: 200,
|
||||
south__size: 200,
|
||||
north__resizable: false,
|
||||
center__onresize: function () {if (r2ui._dis.display == "graph" && r2ui._dis.minimap) update_minimap();},
|
||||
west__onresize: $.layout.callbacks.resizePaneAccordions,
|
||||
east__onresize: $.layout.callbacks.resizePaneAccordions
|
||||
});
|
||||
// myLayout.disableClosable("north", true);
|
||||
$("#accordion1").accordion({ heightStyle: "fill" });
|
||||
$("#accordion2").accordion({ heightStyle: "fill" });
|
||||
|
||||
// Boot r2 analysis, settings, ....
|
||||
r2.update_flags();
|
||||
r2.analAll();
|
||||
r2.load_mmap();
|
||||
r2ui.load_colors();
|
||||
r2.load_settings();
|
||||
load_binary_details();
|
||||
|
||||
// Create panels
|
||||
var disasm_panel = new DisasmPanel();
|
||||
var hex_panel = new HexPanel();
|
||||
var entropy_panel = new EntropyPanel();
|
||||
var strings_panel = new StringsPanel();
|
||||
var types_panel = new TypesPanel();
|
||||
var settings_panel = new SettingsPanel();
|
||||
var projects_panel = new ProjectsPanel();
|
||||
r2ui._ent = entropy_panel;
|
||||
r2ui._dis = disasm_panel;
|
||||
r2ui._str = strings_panel;
|
||||
r2ui._typ = types_panel;
|
||||
r2ui._set = settings_panel;
|
||||
r2ui._hex = hex_panel;
|
||||
r2ui._prj = projects_panel;
|
||||
|
||||
// For enyo compatibility
|
||||
r2ui.ra = {};
|
||||
r2ui.mp = {};
|
||||
r2ui.ra.getIndex = function() {};
|
||||
r2ui.ra.setIndex = function() {};
|
||||
r2ui.mp.openPage = function() {};
|
||||
|
||||
var console_history = [];
|
||||
var console_history_idx = 0;
|
||||
|
||||
// Handle commands in console
|
||||
$("#command").keypress(function( inEvent ) {
|
||||
var key = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
if (key === 13) {
|
||||
var cmd = inEvent.target.value.trim();
|
||||
var reloadUI = cmd == '';
|
||||
|
||||
console_history[console_history.length] = cmd;
|
||||
console_history_idx += 1;
|
||||
/* empty input reloads UI */
|
||||
if (cmd != '') {
|
||||
if (r2ui.console_lang == "r2") {
|
||||
r2.cmd(inColor(cmd), function(x) {
|
||||
var old_value = $("#cmd_output").text();
|
||||
$("#cmd_output").html(old_value + "\n> " + cmd + "\n" + x );
|
||||
$('#cmd_output').scrollTo($('#cmd_output')[0].scrollHeight);
|
||||
});
|
||||
if (cmd.indexOf("s ") === 0) {
|
||||
r2ui.history_push(r2ui._dis.selected_offset);
|
||||
}
|
||||
} else if (r2ui.console_lang == "js") {
|
||||
x = eval(cmd);
|
||||
var old_value = $("#cmd_output").text();
|
||||
$("#cmd_output").html(old_value + "\n> " + cmd + "\n" + x );
|
||||
$('#cmd_output').scrollTo($('#cmd_output')[0].scrollHeight);
|
||||
}
|
||||
}
|
||||
inEvent.target.value = "";
|
||||
/* if command starts with :, do not reload */
|
||||
if (reloadUI && r2ui.console_lang == "r2") {
|
||||
r2.load_settings();
|
||||
r2ui.load_colors();
|
||||
update_binary_details();
|
||||
r2ui.seek("$$", false);
|
||||
scroll_to_element(r2ui._dis.selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('input').bind('keydown', function(e){
|
||||
if(e.keyCode == '38' || e.keyCode == '40'){
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
$("#command").keydown(function( inEvent ) {
|
||||
var key = inEvent.keyCode || inEvent.charCode || inEvent.which || 0;
|
||||
if (key === 40) {
|
||||
console_history_idx++;
|
||||
if (console_history_idx > console_history.length - 1) console_history_idx = console_history.length;
|
||||
inEvent.target.value = console_history[console_history_idx] === undefined ? "" : console_history[console_history_idx];
|
||||
}
|
||||
if (key === 38) {
|
||||
console_history_idx--;
|
||||
if (console_history_idx < 0) console_history_idx = 0;
|
||||
inEvent.target.value = console_history[console_history_idx] === undefined ? "" : console_history[console_history_idx];
|
||||
}
|
||||
});
|
||||
|
||||
// Console menu
|
||||
$("#console_panel").contextmenu({
|
||||
menu: [
|
||||
{title: "clear buffer<kbd></kbd>", cmd: "clearbuffer"},
|
||||
{title: "switch r2/JS<kbd>s</kbd>", cmd: "switchlang"}
|
||||
],
|
||||
preventSelect: true,
|
||||
taphold: true,
|
||||
preventContextMenuForPopup: true,
|
||||
show: false,
|
||||
select: function(event, ui) {
|
||||
$(document).contextmenu("close");
|
||||
switch (ui.cmd) {
|
||||
case "clearbuffer": $("#cmd_output").html(""); break;
|
||||
case "switchlang": r2ui.toggle_console_lang(); break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Project notes
|
||||
r2.cmdj("Pnj", function(x){
|
||||
if (x !== null) $("#pnotes").html(atob(x));
|
||||
});
|
||||
$("#pnotes").donetyping(function() {
|
||||
r2.cmd("Pnj " + btoa($("#pnotes").val()));
|
||||
r2.cmd("Po", function(x) {
|
||||
if (x === "") alert("Notes won't be persited until a project is opened. Use Project's tab or 'Ps name' to save current project");
|
||||
});
|
||||
});
|
||||
|
||||
$("#switch_button").click(function(){do_switchview()});
|
||||
|
||||
// Render Disasm Panel
|
||||
r2ui._dis.render();
|
||||
});
|
||||
|
||||
function scroll_to_element(element) {
|
||||
if (element === undefined || element === null) return;
|
||||
var top = Math.max(0,element.documentOffsetTop() - ( window.innerHeight / 2 ));
|
||||
$('#center_panel').scrollTo(top, {axis: 'y'});
|
||||
r2ui._dis.scroll_offset = top;
|
||||
}
|
||||
|
||||
function store_scroll_offset() {
|
||||
r2ui._dis.scroll_offset = $('#center_panel').scrollTop();
|
||||
}
|
||||
function scroll_to_last_offset() {
|
||||
if (r2ui._dis.scroll_offset !== null) $('#center_panel').scrollTo(r2ui._dis.scroll_offset, {axis: 'y'});
|
||||
}
|
||||
|
||||
function load_binary_details() {
|
||||
// <div id="symbols"></div>
|
||||
r2.cmdj("isj", function(x) {
|
||||
render_symbols(x);
|
||||
});
|
||||
// <div id="functions"></div>
|
||||
r2.cmdj("aflj", function(x) {
|
||||
render_functions(x);
|
||||
});
|
||||
// <div id="imports"></div>
|
||||
r2.cmdj("iij", function(x) {
|
||||
render_imports(x);
|
||||
});
|
||||
// <div id="relocs"></div>
|
||||
r2.cmdj("irj", function(x) {
|
||||
render_relocs(x);
|
||||
});
|
||||
// <div id="flags"></div>
|
||||
// TODO: replace with individual fetches of spaces so we can add a class saying what type of flag it is (for renaming)
|
||||
r2.cmdj("fs *;fj", function(x) {
|
||||
render_flags(x);
|
||||
});
|
||||
// <div id="information"></div>
|
||||
r2.cmd("i", function(x) {
|
||||
$('#information').html("<pre>" + x + "</pre>");
|
||||
});
|
||||
// <div id="sections"></div>
|
||||
r2.cmdj("iSj", function(x) {
|
||||
render_sections(x);
|
||||
});
|
||||
render_history();
|
||||
}
|
||||
|
||||
function update_binary_details() {
|
||||
// <div id="symbols"></div>
|
||||
r2.cmdj("isj", function(x) {
|
||||
render_symbols(x);
|
||||
});
|
||||
// <div id="functions"></div>
|
||||
r2.cmdj("aflj", function(x) {
|
||||
render_functions(x);
|
||||
});
|
||||
// <div id="imports"></div>
|
||||
r2.cmdj("iij", function(x) {
|
||||
render_imports(x);
|
||||
});
|
||||
// <div id="relocs"></div>
|
||||
r2.cmdj("irj", function(x) {
|
||||
render_relocs(x);
|
||||
});
|
||||
// <div id="flags"></div>
|
||||
// TODO: replace with individual fetches of spaces so we can add a class saying what type of flag it is (for renaming)
|
||||
r2.cmdj("fs *;fj", function(x) {
|
||||
render_flags(x);
|
||||
});
|
||||
render_history();
|
||||
}
|
||||
|
||||
function render_functions(functions) {
|
||||
var imports = null;
|
||||
r2.cmdj("iij", function(x) {
|
||||
imports = x;
|
||||
});
|
||||
var fcn_data = [];
|
||||
for (var i in functions) {
|
||||
var f = functions[i];
|
||||
if (f.name !== undefined) {
|
||||
var is_import = false;
|
||||
for (var k in imports) if (f.offset === imports[k].plt) is_import = true;
|
||||
if (is_import) continue;
|
||||
var fd = {
|
||||
offset: f.offset,
|
||||
label: "<span class='flag function addr addr_" + "0x" + f.offset.toString(16) + "'>" + f.name + "</span>",
|
||||
children: [{label: "offset: " + "0x" + f.offset.toString(16)}, {label: "size: " + f.size} ]
|
||||
};
|
||||
if (f.callrefs.length > 0) {
|
||||
var xrefs = {label: "xrefs:", children: []};
|
||||
for (var j in f.callrefs) {
|
||||
xrefs.children[xrefs.children.length] = "<span class='xref addr addr_0x" + f.callrefs[j].addr.toString(16) + "'>0x" + f.callrefs[j].addr.toString(16) + "</span> (" + (f.callrefs[j].type == "C"? "call":"jump") + ")";
|
||||
}
|
||||
fd.children[fd.children.length] = xrefs;
|
||||
}
|
||||
fcn_data[fcn_data.length] = fd;
|
||||
}
|
||||
}
|
||||
fcn_data = fcn_data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#functions').tree({data: [],selectable: false,slide: false,useContextMenu: false, autoEscape: false});
|
||||
$('#functions').tree('loadData', fcn_data);
|
||||
$('#functions_label').html("Functions <span class='right_label'>" + fcn_data.length + "</span>");
|
||||
}
|
||||
|
||||
function render_imports(imports) {
|
||||
var imp_data = [];
|
||||
for (var i in imports) {
|
||||
var f = imports[i];
|
||||
if (f.name !== undefined) {
|
||||
var id = {
|
||||
label: "<span class='flag import addr addr_" + "0x" + f.plt.toString(16) + "'>" + f.name + "</span>",
|
||||
children: [ {label: "plt: " + "0x" + f.plt.toString(16)}, {label: "ord: " + i} ]
|
||||
};
|
||||
imp_data[imp_data.length] = id;
|
||||
}
|
||||
}
|
||||
$('#imports').tree({data: [],selectable: false,slide: false,useContextMenu: false, autoEscape: false});
|
||||
$('#imports').tree('loadData', imp_data);
|
||||
$('#imports_label').html("Imports <span class='right_label'>" + imp_data.length + "</span>");
|
||||
}
|
||||
|
||||
|
||||
function render_symbols(symbols) {
|
||||
var data = [];
|
||||
for (var i in symbols) {
|
||||
var s = symbols[i];
|
||||
var sd = {
|
||||
offset: s.addr,
|
||||
label: "<span class='flag symbol addr addr_" + "0x" + s.addr.toString(16) + "'>" + s.name + "</span>",
|
||||
children: [ {label: "offset: " + "0x" + s.addr.toString(16)}, {label: "size: " + s.size} ] };
|
||||
data[data.length] = sd;
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#symbols').tree({data: data,selectable: false,slide: false,useContextMenu: false, autoEscape: false});
|
||||
$('#symbols_label').html("Symbols <span class='right_label'>" + data.length + "</span>");
|
||||
}
|
||||
function render_relocs(relocs) {
|
||||
var data = [];
|
||||
for (var i in relocs) {
|
||||
var r = relocs[i];
|
||||
var rd = {
|
||||
offset: r.vaddr,
|
||||
label: "<span class='flag reloc addr addr_" + "0x" + r.vaddr.toString(16) + "'>" + r.name + "</span>",
|
||||
children: [ {label: "offset: " + "0x" + r.vaddr.toString(16)}, {label: "type: " + r.type} ] };
|
||||
data[data.length] = rd;
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#relocs').tree({data: [],selectable: false,slide: false,useContextMenu: false, autoEscape: false});
|
||||
$('#relocs').tree('loadData', data);
|
||||
$('#relocs_label').html("Relocs <span class='right_label'>" + data.length + "</span>");
|
||||
}
|
||||
function render_flags(flags) {
|
||||
var data = [];
|
||||
for (var i in flags) {
|
||||
var f = flags[i];
|
||||
var fd = {
|
||||
offset: f.offset,
|
||||
label: "<span class='flag addr addr_" + "0x" + f.offset.toString(16) + "'>" + f.name + "</span>",
|
||||
children: [ {label: "offset: " + "0x" + f.offset.toString(16)}, {label: "size: " + f.size} ] };
|
||||
data[data.length] = fd;
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#flags').tree({data: [],selectable: false,slide: false,useContextMenu: false, autoEscape: false});
|
||||
$('#flags').tree('loadData', data);
|
||||
$('#flags_label').html("Flags <span class='right_label'>" + data.length + "</span>");
|
||||
}
|
||||
function render_sections(sections) {
|
||||
var data = [];
|
||||
for (var i in sections) {
|
||||
var f = sections[i];
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: "0x" + f.addr.toString(16) + ": " + f.name,
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "flags: " + f.flags},
|
||||
{label: "size: " + f.size},
|
||||
{label: "vsize: " + f.vsize}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#sections').tree({data: [],selectable: false,slide: false,useContextMenu: false});
|
||||
$('#sections').tree('loadData', data);
|
||||
$('#sections_label').html("Sections <span class='right_label'>" + data.length + "</span>");
|
||||
}
|
||||
function render_history(){
|
||||
var html = "<div>";
|
||||
for (var i in r2ui.history) {
|
||||
if (i > r2ui.history_idx - 8 && i < r2ui.history_idx + 3) {
|
||||
var flag = r2.get_flag_names(r2ui.history[i]);
|
||||
if (flag.length > 0) flag = flag[0];
|
||||
else flag = r2ui.history[i];
|
||||
if (i == r2ui.history_idx - 1) html += " > <span class='history history_idx addr addr_" + r2ui.history[i] + " history_idx_" + i + "'>" + flag + "</span>";
|
||||
else html += " > <span class='history addr addr_" + r2ui.history[i] + " history_idx_" + i + "'>" + flag + "</span>";
|
||||
}
|
||||
}
|
||||
html += "</div>";
|
||||
$('#history').html(html);
|
||||
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
// PROJECTS PANEL
|
||||
var ProjectsPanel = function () {
|
||||
|
||||
};
|
||||
|
||||
ProjectsPanel.prototype.render = function() {
|
||||
$('#projects_tab').html('<div style="color: white;">Open Project:</div><div id="projects" style="color:rgb(127,127,127);"></div><div id="button"><br/><input id="submit" type="submit" value="Save Project" /></div>');
|
||||
r2.cmdj("Plj", function(projects) {
|
||||
var data = [];
|
||||
for (var i in projects) {
|
||||
var p = projects[i];
|
||||
var fd = {
|
||||
label: p,
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
$('#projects').tree({data: [],selectable: false,slide: false,useContextMenu: false});
|
||||
$('#projects').tree('loadData', data);
|
||||
$('#submit').on('click', function(){
|
||||
var project_name = prompt("Project Name:", r2.project_name);
|
||||
if (project_name !== "") {
|
||||
r2.cmd(":Ps " + project_name, function(x) {});
|
||||
} else {
|
||||
alert("Enter a valid name");
|
||||
}
|
||||
r2.project_name = project_name;
|
||||
});
|
||||
$('.jqtree-element').on('click', function(){
|
||||
var project_name = $(this)[0].firstChild.innerText;
|
||||
r2.cmd("Po " + project_name, function(x) {});
|
||||
r2.project_name = project_name;
|
||||
window.location.assign("./p");
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1,15 +0,0 @@
|
||||
// SETTINGS PANEL
|
||||
var SettingsPanel = function () {
|
||||
};
|
||||
|
||||
SettingsPanel.prototype.render = function() {
|
||||
var colors = '<div><h3>Colors:</h3><br/><iframe id="colors_frame" name="colors_frame" src="colors.html" width="100%" height="400px"></iframe></div><br/>';
|
||||
var settings = '<div><h3>Settings:</h3><br/>';
|
||||
settings += '<div>Test: <input id="test" type="checkbox" /></div>';
|
||||
settings += '</div><br/>';
|
||||
settings += '<div><input value="Randomize colors" type="button" onclick="r2.cmd(\'ecr\');"></div>';
|
||||
var html = settings + colors;
|
||||
$('#settings_tab').html(html);
|
||||
$('#settings_tab').css('color', "rgb(127,127,127);");
|
||||
$('input[type=checkbox]').onoff();
|
||||
};
|
@ -1,143 +0,0 @@
|
||||
// STRINGS PANEL
|
||||
var StringsPanel = function () {
|
||||
|
||||
};
|
||||
|
||||
StringsPanel.prototype.render = function() {
|
||||
$('#strings_tab').html('<div id="strings" style="color:rgb(127,127,127);"></div>');
|
||||
//Added String search bar and length bar
|
||||
$('#strings').before('<div class="ui-toolbar ui-widget-header ui-helper-clearfix" style="padding:5px;"><input id="search_string" type="text" placeholder="Search "><input id="string_length" type="text" placeholder="Length" style="margin-left:50px;"></div>');
|
||||
r2.cmdj("izj", function(strings) {
|
||||
var data = [];
|
||||
for (var i in strings) {
|
||||
var f = strings[i];
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: atob(f.string),
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "length: " + f.length},
|
||||
{label: "type: " + f.type}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#strings').tree({data: [],selectable: false,slide: false,useContextMenu: false});
|
||||
$('#strings').tree('loadData', data);
|
||||
});
|
||||
// Searched for all the occurence of the substring in the string
|
||||
$( "#search_string" ).change(function() {
|
||||
str=$('#search_string').val();
|
||||
if(str.length==0)
|
||||
StringsPanel.prototype.render();
|
||||
else
|
||||
{
|
||||
r2.cmdj("izj", function(strings) {
|
||||
var data = [];
|
||||
for (var i in strings) {
|
||||
var f = strings[i];
|
||||
str.toLowerCase();
|
||||
str1=atob(f.string).slice(0,-1)
|
||||
str1.toLowerCase();
|
||||
// Searches all the occurence of the string with fixed length
|
||||
if($('#string_length').val())
|
||||
{
|
||||
len=$('#string_length').val();
|
||||
if(str1.indexOf(str)>=0 && f.length==len)
|
||||
{
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: atob(f.string),
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "length: " + f.length},
|
||||
{label: "type: " + f.type}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(str1.indexOf(str)>=0)
|
||||
{
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: atob(f.string),
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "length: " + f.length},
|
||||
{label: "type: " + f.type}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#strings').tree({data: [],selectable: false,slide: false,useContextMenu: false});
|
||||
$('#strings').tree('loadData', data);
|
||||
});
|
||||
}
|
||||
});
|
||||
// Filtering strings by the string length
|
||||
$('#string_length').change(function(){
|
||||
if($('#string_length').val()==0 || $('#string_length').val()=='undefined' )
|
||||
StringsPanel.prototype.render();
|
||||
else{
|
||||
r2.cmdj("izj", function(strings) {
|
||||
var data = [];
|
||||
for (var i in strings) {
|
||||
var f = strings[i];
|
||||
str=$('#search_string').val();
|
||||
str.toLowerCase();
|
||||
str1=atob(f.string).slice(0,-1)
|
||||
str1.toLowerCase();
|
||||
if(str.length>0 && $('#string_length').val())
|
||||
{
|
||||
len=$('#string_length').val();
|
||||
if(f.length==len && str1.indexOf(str)>=0)
|
||||
{
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: atob(f.string),
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "length: " + f.length},
|
||||
{label: "type: " + f.type}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
len=$('#string_length').val();
|
||||
if(f.length==len)
|
||||
{
|
||||
var fd = {
|
||||
offset: f.paddr,
|
||||
label: atob(f.string),
|
||||
children: [
|
||||
{label: "vaddr: " + "0x" + f.vaddr.toString(16)},
|
||||
{label: "paddr: " + "0x" + f.paddr.toString(16)},
|
||||
{label: "length: " + f.length},
|
||||
{label: "type: " + f.type}
|
||||
]
|
||||
};
|
||||
data[data.length] = fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
data = data.sort(function(a,b) {return a.offset - b.offset;});
|
||||
$('#strings').tree({data: [],selectable: false,slide: false,useContextMenu: false});
|
||||
$('#strings').tree('loadData', data);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -1,117 +0,0 @@
|
||||
// @author Rich Adams <rich@richadams.me>
|
||||
|
||||
// Implements a tap and hold functionality. If you click/tap and release, it will trigger a normal
|
||||
// click event. But if you click/tap and hold for 1s (default), it will trigger a taphold event instead.
|
||||
|
||||
;(function($)
|
||||
{
|
||||
// Default options
|
||||
var defaults = {
|
||||
duration: 1000, // ms
|
||||
clickHandler: null
|
||||
}
|
||||
|
||||
// When start of a taphold event is triggered.
|
||||
function startHandler(event)
|
||||
{
|
||||
var $elem = jQuery(this);
|
||||
|
||||
// Merge the defaults and any user defined settings.
|
||||
settings = jQuery.extend({}, defaults, event.data);
|
||||
|
||||
// If object also has click handler, store it and unbind. Taphold will trigger the
|
||||
// click itself, rather than normal propagation.
|
||||
if (typeof $elem.data("events") != "undefined"
|
||||
&& typeof $elem.data("events").click != "undefined")
|
||||
{
|
||||
// Find the one without a namespace defined.
|
||||
for (var c in $elem.data("events").click)
|
||||
{
|
||||
if ($elem.data("events").click[c].namespace == "")
|
||||
{
|
||||
var handler = $elem.data("events").click[c].handler
|
||||
$elem.data("taphold_click_handler", handler);
|
||||
$elem.unbind("click", handler);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Otherwise, if a custom click handler was explicitly defined, then store it instead.
|
||||
else if (typeof settings.clickHandler == "function")
|
||||
{
|
||||
$elem.data("taphold_click_handler", settings.clickHandler);
|
||||
}
|
||||
|
||||
// Reset the flags
|
||||
$elem.data("taphold_triggered", false); // If a hold was triggered
|
||||
$elem.data("taphold_clicked", false); // If a click was triggered
|
||||
$elem.data("taphold_cancelled", false); // If event has been cancelled.
|
||||
|
||||
// Set the timer for the hold event.
|
||||
$elem.data("taphold_timer",
|
||||
setTimeout(function()
|
||||
{
|
||||
// If event hasn't been cancelled/clicked already, then go ahead and trigger the hold.
|
||||
if (!$elem.data("taphold_cancelled")
|
||||
&& !$elem.data("taphold_clicked"))
|
||||
{
|
||||
// Trigger the hold event, and set the flag to say it's been triggered.
|
||||
$elem.trigger(jQuery.extend(event, jQuery.Event("taphold")));
|
||||
$elem.data("taphold_triggered", true);
|
||||
}
|
||||
}, settings.duration));
|
||||
}
|
||||
|
||||
// When user ends a tap or click, decide what we should do.
|
||||
function stopHandler(event)
|
||||
{
|
||||
var $elem = jQuery(this);
|
||||
|
||||
// If taphold has been cancelled, then we're done.
|
||||
if ($elem.data("taphold_cancelled")) { return; }
|
||||
|
||||
// Clear the hold timer. If it hasn't already triggered, then it's too late anyway.
|
||||
clearTimeout($elem.data("taphold_timer"));
|
||||
|
||||
// If hold wasn't triggered and not already clicked, then was a click event.
|
||||
if (!$elem.data("taphold_triggered")
|
||||
&& !$elem.data("taphold_clicked"))
|
||||
{
|
||||
// If click handler, trigger it.
|
||||
if (typeof $elem.data("taphold_click_handler") == "function")
|
||||
{
|
||||
$elem.data("taphold_click_handler")(jQuery.extend(event, jQuery.Event("click")));
|
||||
}
|
||||
|
||||
// Set flag to say we've triggered the click event.
|
||||
$elem.data("taphold_clicked", true);
|
||||
}
|
||||
}
|
||||
|
||||
// If a user prematurely leaves the boundary of the object we're working on.
|
||||
function leaveHandler(event)
|
||||
{
|
||||
// Cancel the event.
|
||||
$(this).data("taphold_cancelled", true);
|
||||
}
|
||||
|
||||
// Determine if touch events are supported.
|
||||
var touchSupported = ("ontouchstart" in window) // Most browsers
|
||||
|| ("onmsgesturechange" in window); // Mircosoft
|
||||
|
||||
var taphold = $.event.special.taphold =
|
||||
{
|
||||
setup: function(data)
|
||||
{
|
||||
$(this).bind((touchSupported ? "touchstart" : "mousedown"), data, startHandler)
|
||||
.bind((touchSupported ? "touchend" : "mouseup"), stopHandler)
|
||||
.bind((touchSupported ? "touchmove" : "mouseleave"), leaveHandler);
|
||||
},
|
||||
teardown: function(namespaces)
|
||||
{
|
||||
$(this).unbind((touchSupported ? "touchstart" : "mousedown"), startHandler)
|
||||
.unbind((touchSupported ? "touchend" : "mouseup"), stopHandler)
|
||||
.unbind((touchSupported ? "touchmove" : "mouseleave"), leaveHandler);
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
@ -1,144 +0,0 @@
|
||||
var TypesPanel = function () {
|
||||
this.data = [];
|
||||
this.optionSpacer = 300; //space in px for option buttons
|
||||
};
|
||||
|
||||
TypesPanel.prototype.insertData = function(k, v, array) {
|
||||
if(typeof array === 'undefined') { array = this.data };
|
||||
var kt = k[0].trim();
|
||||
|
||||
if(k.length == 1) {
|
||||
//base case
|
||||
array.push({
|
||||
label: kt,
|
||||
id: kt,
|
||||
value: v
|
||||
});
|
||||
return;
|
||||
} else if(array.length < 1) {
|
||||
//if current part of k's path doesn't exist, create it
|
||||
array.push({
|
||||
label: kt ,
|
||||
children: []
|
||||
});
|
||||
this.insertData(k.slice(1), v, array[0].children);
|
||||
return;
|
||||
}
|
||||
|
||||
//traverse already populated array to find right spot for insertion
|
||||
for(var i in array) {
|
||||
if(array[i].hasOwnProperty("label") && array[i].label === kt) {
|
||||
if(array[i].hasOwnProperty("children")) {
|
||||
this.insertData(k.slice(1), v, array[i].children);
|
||||
return;
|
||||
} else if(k.length > 1) {
|
||||
array[i].children = [];
|
||||
this.insertData(k.slice(1), v, array[i].children);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//was not found in array, create + traverse
|
||||
array.push({
|
||||
label: kt
|
||||
});
|
||||
if(k.length > 1) {
|
||||
array[array.length-1].children = [];
|
||||
this.insertData(k.slice(1), v, array[array.length-1].children);
|
||||
}
|
||||
}
|
||||
|
||||
TypesPanel.prototype.generateContent = function() {
|
||||
var ref = this;
|
||||
r2.cmd("t", function(result) {
|
||||
var strings = result.split("\n");
|
||||
|
||||
for(var i in strings) {
|
||||
var s = strings[i].split("=");
|
||||
|
||||
if(s.length < 2)
|
||||
continue;
|
||||
|
||||
var k = s[0].split(".");
|
||||
var v = s[1];
|
||||
|
||||
if(k.length < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ref.insertData(k, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
TypesPanel.prototype.createBarButtons = function() {
|
||||
var $bar = $("#typesButtonBar");
|
||||
var $addButton = $('<button id="addButton">Add type</button>');
|
||||
//Can only do files once we can resolve the non-sandboxed path
|
||||
//var $addFileButton = $('<input type="file" style="color: transparent" id="addFileButton"></button>');
|
||||
|
||||
$addButton.click(function() {
|
||||
var str = prompt("Enter C string:");
|
||||
r2.cmd('"td ' + str + '"', function() { r2ui._typ.render(); });
|
||||
});
|
||||
|
||||
// $addFileButton.change(function() {
|
||||
// var val = $("#addFileButton").val();
|
||||
// r2.cmd('to ' + val, function() { r2ui._typ.render(); });
|
||||
// });
|
||||
|
||||
$bar.append($addButton);
|
||||
// $bar.append($addFileButton);
|
||||
|
||||
}
|
||||
|
||||
TypesPanel.prototype.createTree = function() {
|
||||
var $tree = $("#types");
|
||||
$tree.tree({
|
||||
data: this.data,
|
||||
slide: false,
|
||||
autoOpen: 0,
|
||||
useContextMenu: false, //TODO custom context menu for add/remove/edit?
|
||||
selectable: false,
|
||||
onCreateLi: function(node, $li) {
|
||||
var app = "";
|
||||
if(typeof node.value !== 'undefined') {
|
||||
app += " (" + node.value + ")";
|
||||
}
|
||||
if(node.getLevel() == 2) {
|
||||
//depth level 2 means we're dealing with an actual type
|
||||
var w = r2ui._typ.optionSpacer;
|
||||
if(node.children && node.children.length != 0) {
|
||||
w -= 5; //sub 5px to compensate for fold icon
|
||||
}
|
||||
|
||||
var style = 'font-size: 80%; font-style: normal; font-family: monospace;' +
|
||||
' cursor: pointer; position: absolute; left:' + w + 'px';
|
||||
app += '<i class="remove" style="' + style +
|
||||
'"' + 'data-node-name="' + node.name + '">[-]</i>';
|
||||
}
|
||||
$li.find(".jqtree-element").append(app);
|
||||
}
|
||||
});
|
||||
|
||||
$tree.on("click", ".remove",
|
||||
function(e) {
|
||||
var label = $(e.target).data('node-name');
|
||||
r2.cmd("t- " + label, function() { r2ui._typ.render(); });
|
||||
});
|
||||
}
|
||||
|
||||
TypesPanel.prototype.render = function() {
|
||||
$("#types_tab").html(
|
||||
'<div id="typesButtonBar"></div>'
|
||||
+ '<div id="types" style="color:rgb(127,127,127)"></div>');
|
||||
|
||||
this.createBarButtons();
|
||||
|
||||
this.data = [];
|
||||
this.maxstr = 0;
|
||||
this.generateContent();
|
||||
this.createTree();
|
||||
|
||||
}
|
593
shlr/www/p/r2.js
@ -1,593 +0,0 @@
|
||||
/* radare2 Copyleft 2013-2014 pancake */
|
||||
|
||||
var r2 = {};
|
||||
|
||||
// TODO: avoid globals
|
||||
var backward = false;
|
||||
var next_curoff = 0;
|
||||
var next_lastoff = 0;
|
||||
var prev_curoff = 0;
|
||||
var prev_lastoff = 0;
|
||||
var hascmd = false;
|
||||
|
||||
// async helper
|
||||
function asyncLoop(iterations, func, callback) {
|
||||
var index = 0;
|
||||
var done = false;
|
||||
var loop = {
|
||||
next: function() {
|
||||
if (done) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (index < iterations) {
|
||||
index++;
|
||||
func(loop);
|
||||
|
||||
} else {
|
||||
done = true;
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
iteration: function() {
|
||||
return index - 1;
|
||||
},
|
||||
|
||||
break: function() {
|
||||
done = true;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
loop.next();
|
||||
return loop;
|
||||
}
|
||||
|
||||
if (typeof (module) !== 'undefined') {
|
||||
module.exports = function(r) {
|
||||
if (typeof (r) == 'function') {
|
||||
hascmd = r;
|
||||
} else {
|
||||
hascmd = r.cmd;
|
||||
}
|
||||
return r2;
|
||||
}
|
||||
}
|
||||
|
||||
r2.project_name = "";
|
||||
|
||||
r2.plugin = function() {
|
||||
console.error ("r2.plugin is not available in this environment");
|
||||
}
|
||||
try {
|
||||
if (r2plugin) {
|
||||
r2.plugin = r2plugin
|
||||
}
|
||||
} catch ( e ) {}
|
||||
|
||||
r2.root = ""; // prefix path
|
||||
|
||||
/* helpers */
|
||||
function dump(obj) {
|
||||
var x = "";
|
||||
for (var a in obj) x += a + "\n";
|
||||
if (typeof ('alert') != 'undefined') {
|
||||
alert (x);
|
||||
} else {
|
||||
console.log (x);
|
||||
}
|
||||
}
|
||||
|
||||
r2.analAll = function() {
|
||||
r2.cmd ("aa", function() {});
|
||||
}
|
||||
|
||||
r2.analOp = function(addr, cb) {
|
||||
r2.cmd ("aoj 1 @ " + addr, function(txt) {
|
||||
try {
|
||||
cb(JSON.parse (txt)[0]);
|
||||
} catch ( e ) {
|
||||
console.error (e)
|
||||
cb (txt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.varMap = [];
|
||||
r2.argMap = [];
|
||||
|
||||
function objtostr(obj) {
|
||||
var str = "";
|
||||
for (var a in obj)
|
||||
str += a + ": " + obj[a] + ",\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
function Ajax(method, uri, body, fn) {
|
||||
if (typeof (XMLHttpRequest) == "undefined")
|
||||
return false;
|
||||
var x = new XMLHttpRequest ();
|
||||
if (!x)
|
||||
return false;
|
||||
x.open (method, uri, false);
|
||||
x.setRequestHeader ('Accept', 'text/plain');
|
||||
x.setRequestHeader ('Accept', 'text/html');
|
||||
x.setRequestHeader ("Content-Type", "application/x-ww-form-urlencoded; charset=UTF-8");
|
||||
x.onreadystatechange = function(y) {
|
||||
if (x.status == 200) {
|
||||
if (fn) {
|
||||
fn (x.responseText);
|
||||
}
|
||||
} else {
|
||||
console.error ("ajax " + x.status)
|
||||
}
|
||||
}
|
||||
x.send (body);
|
||||
return true;
|
||||
}
|
||||
|
||||
r2.assemble = function(offset, opcode, fn) {
|
||||
var off = offset ? "@" + offset : '';
|
||||
r2.cmd ('"pa ' + opcode + '"' + off, fn);
|
||||
}
|
||||
|
||||
r2.disassemble = function(offset, bytes, fn) {
|
||||
var off = offset ? "@" + offset : '';
|
||||
var str = 'pi @b:' + bytes + off;
|
||||
r2.cmd (str, fn);
|
||||
}
|
||||
|
||||
r2.get_hexdump = function(offset, length, cb) {
|
||||
r2.cmd ("px " + length + "@" + offset, cb);
|
||||
}
|
||||
|
||||
r2.get_disasm = function(offset, length, cb) {
|
||||
// TODO: honor offset and length
|
||||
r2.cmd ("pD " + length + "@" + offset, cb);
|
||||
}
|
||||
|
||||
r2.get_disasm_before = function(offset, start, cb) {
|
||||
var before = [];
|
||||
r2.cmd("pdj -" + start + "@" + offset, function(x) {
|
||||
before = JSON.parse(x);
|
||||
});
|
||||
cb(before);
|
||||
}
|
||||
|
||||
r2.get_disasm_after = function(offset, end, cb) {
|
||||
var after = [];
|
||||
r2.cmd("pdj " + end + "@" + offset, function(x) {
|
||||
after = JSON.parse(x);
|
||||
});
|
||||
cb(after);
|
||||
}
|
||||
|
||||
r2.get_disasm_before_after = function(offset, start, end, cb) {
|
||||
var before = [];
|
||||
var after = [];
|
||||
r2.cmd("pdj " + start + " @" + offset, function(x) {
|
||||
before = JSON.parse(x);
|
||||
});
|
||||
r2.cmd("pdj " + end + "@" + offset, function(x) {
|
||||
after = JSON.parse(x);
|
||||
});
|
||||
var opcodes = before.concat(after);
|
||||
cb(opcodes);
|
||||
}
|
||||
|
||||
r2.Config = function(k, v, fn) {
|
||||
if (typeof v == 'function' || !v) { // get
|
||||
r2.cmd ("e " + k, fn || v);
|
||||
} else { // set
|
||||
r2.cmd ("e " + k + "=" + v, fn);
|
||||
}
|
||||
return r2;
|
||||
}
|
||||
|
||||
r2.sections = {};
|
||||
|
||||
r2.load_mmap = function() {
|
||||
r2.cmdj("iSj", function(x) {
|
||||
if (x !== undefined && x !== null) {
|
||||
r2.sections = x;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_address_type = function(address) {
|
||||
var offset = parseInt(address, 16);
|
||||
for (var i in r2.sections) {
|
||||
if (offset >= r2.sections[i].addr && offset < r2.sections[i].addr + r2.sections[i].size) {
|
||||
if (r2.sections[i].flags.indexOf("x") > -1) {
|
||||
return "instruction";
|
||||
}
|
||||
else {
|
||||
return "memory";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
r2.settings = {};
|
||||
|
||||
r2.load_settings = function() {
|
||||
r2.cmd ("e asm.arch", function(x) {r2.settings['asm.arch'] = x.trim();});
|
||||
r2.cmd ("e asm.bits", function(x) {r2.settings['asm.bits'] = x.trim();});
|
||||
r2.cmd ("e asm.bytes", function(x) {r2.settings['asm.bytes'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.flags", function(x) {r2.settings['asm.flags'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.offset", function(x) {r2.settings['asm.offset'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.lines", function(x) {r2.settings['asm.lines'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.xrefs", function(x) {r2.settings['asm.xrefs'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.cmtright", function(x) {r2.settings['asm.cmtright'] = toBoolean(x.trim());});
|
||||
r2.cmd ("e asm.pseudo", function(x) {r2.settings['asm.pseudo'] = toBoolean(x.trim());});
|
||||
// console.log("Loading settings from r2");
|
||||
// console.log(r2.settings);
|
||||
}
|
||||
|
||||
|
||||
r2.flags = {};
|
||||
|
||||
r2.update_flags = function() {
|
||||
r2.cmd ("fs *;fj", function(x) {
|
||||
|
||||
var fs = JSON.parse (x);
|
||||
if (fs !== undefined && fs !== null) {
|
||||
r2.flags = {};
|
||||
for (var f in fs) {
|
||||
var addr = "0x" + fs[f].offset.toString(16);
|
||||
addr = address_canonicalize(addr);
|
||||
if (addr in r2.flags) {
|
||||
var fl = r2.flags[addr];
|
||||
fl[fl.length] = { name: fs[f].name, size: fs[f].size};
|
||||
r2.flags[addr] = fl;
|
||||
} else {
|
||||
r2.flags[addr] = [{ name: fs[f].name, size: fs[f].size}];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_flag_address = function(name) {
|
||||
for (var f in r2.flags) {
|
||||
for (var v in r2.flags[f]) {
|
||||
if (name == r2.flags[f][v].name) return f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
r2.get_flag_names = function(offset) {
|
||||
var names = [];
|
||||
for (var i in r2.flags[offset]) {
|
||||
names[names.length] = r2.flags[offset][i].name;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
r2.set_flag_space = function(ns, fn) {
|
||||
r2.cmd ("fs " + ns, fn);
|
||||
}
|
||||
|
||||
r2.get_flags = function(fn) {
|
||||
r2.cmd ("fj", function(x) {
|
||||
fn (x ? JSON.parse (x) : []);
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_opcodes = function(off, n, cb) {
|
||||
r2.cmd ("pdj @" + off + "!" + n, function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_bytes = function(off, n, cb) {
|
||||
r2.cmd ("pcj @" + off + "!" + n, function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.asm_config = {};
|
||||
|
||||
r2.store_asm_config = function() {
|
||||
config = {};
|
||||
r2.cmd ("e", function(x) {
|
||||
conf = x.split("\n");
|
||||
for (var prop in conf) {
|
||||
var fields = conf[prop].split(" ");
|
||||
if (fields.length == 3) {
|
||||
// TODO: Dont know why byt e~asm. is not working so filtering here
|
||||
if (fields[0].trim().indexOf("asm.") == 0) config[fields[0].trim()] = fields[2].trim();
|
||||
}
|
||||
}
|
||||
r2.asm_config = config;
|
||||
});
|
||||
}
|
||||
|
||||
r2.restore_asm_config = function() {
|
||||
cmd = "";
|
||||
for (var prop in r2.asm_config) {
|
||||
cmd += "e " + prop + "=" + r2.asm_config[prop] + ";";
|
||||
}
|
||||
r2.cmd (cmd, function(x) {});
|
||||
}
|
||||
|
||||
r2.get_info = function(cb) {
|
||||
r2.cmd ("ij", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
r2.bin_relocs = function(cb) {
|
||||
r2.cmd ("irj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
r2.bin_imports = function(cb) {
|
||||
r2.cmd ("iij", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.bin_symbols = function(cb) {
|
||||
r2.cmd ("isj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.bin_sections = function(cb) {
|
||||
r2.cmd ("iSj", function(json) {
|
||||
cb (JSON.parse (json));
|
||||
});
|
||||
}
|
||||
|
||||
r2.cmds = function(cmds, cb) {
|
||||
if (cmds.length == 0) return;
|
||||
var cmd = cmds[0];
|
||||
cmds = cmds.splice (1);
|
||||
function lala() {
|
||||
if (cmd == undefined || cmds.length == 0) {
|
||||
return;
|
||||
}
|
||||
cmd = cmds[0];
|
||||
cmds = cmds.splice (1);
|
||||
r2.cmd (cmd, lala);
|
||||
if (cb) {
|
||||
cb ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
r2.cmd (cmd, lala);
|
||||
}
|
||||
|
||||
function _internal_cmd(c, cb) {
|
||||
if (typeof (r2cmd) != 'undefined') {
|
||||
hascmd = r2cmd;
|
||||
}
|
||||
if (hascmd) {
|
||||
// TODO: use setTimeout for async?
|
||||
if (typeof (r2plugin) != "undefined") {
|
||||
// duktape
|
||||
cb (r2cmd(c));
|
||||
} else {
|
||||
// node
|
||||
return hascmd (c, cb);
|
||||
}
|
||||
} else {
|
||||
Ajax ('GET', r2.root + "/cmd/" + encodeURI(c), '', function(x) {
|
||||
if (cb) {
|
||||
cb (x);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
r2.cmd = function(c, cb) {
|
||||
if (Array.isArray (c)) {
|
||||
var res = [];
|
||||
var idx = 0;
|
||||
asyncLoop (c.length, function(loop) {
|
||||
_internal_cmd (c[idx], function(result) {
|
||||
idx = loop.iteration();
|
||||
res[idx] = result.replace(/\n$/, "");
|
||||
idx++;
|
||||
loop.next ();
|
||||
});
|
||||
}, function() {
|
||||
// all iterations done
|
||||
cb (res);
|
||||
});
|
||||
} else {
|
||||
_internal_cmd (c, cb);
|
||||
}
|
||||
}
|
||||
|
||||
r2.cmdj = function(c, cb) {
|
||||
r2.cmd (c, function(x) {
|
||||
try {
|
||||
cb (JSON.parse(x));
|
||||
} catch ( e ) {
|
||||
cb (null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.alive = function(cb) {
|
||||
r2.cmd ("b", function(o) {
|
||||
var ret = false;
|
||||
if (o && o.length () > 0) {
|
||||
ret = true;
|
||||
}
|
||||
if (cb) {
|
||||
cb (o);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
r2.getTextLogger = function(obj) {
|
||||
if (typeof (obj) != "object") {
|
||||
obj = {};
|
||||
}
|
||||
obj.last = 0;
|
||||
obj.events = {};
|
||||
obj.interval = null;
|
||||
r2.cmd ("Tl", function(x) {
|
||||
obj.last = +x;
|
||||
});
|
||||
obj.load = function(cb) {
|
||||
r2.cmd ("Tj " + (obj.last + 1), function(ret) {
|
||||
if (cb) {
|
||||
cb (JSON.parse (ret));
|
||||
}
|
||||
});
|
||||
}
|
||||
obj.clear = function(cb) {
|
||||
// XXX: fix l-N
|
||||
r2.cmd ("T-", cb); //+obj.last, cb);
|
||||
}
|
||||
obj.send = function(msg, cb) {
|
||||
r2.cmd ("T " + msg, cb);
|
||||
}
|
||||
obj.refresh = function(cb) {
|
||||
obj.load (function(ret) {
|
||||
//obj.last = 0;
|
||||
for (var i = 0; i < ret.length; i++) {
|
||||
var message = ret[i];
|
||||
obj.events["message"] ({
|
||||
"id": message[0],
|
||||
"text": message[1]
|
||||
});
|
||||
if (message[0] > obj.last) {
|
||||
obj.last = message[0];
|
||||
}
|
||||
}
|
||||
if (cb) {
|
||||
cb ();
|
||||
}
|
||||
});
|
||||
}
|
||||
obj.autorefresh = function(n) {
|
||||
if (!n) {
|
||||
if (obj.interval) {
|
||||
obj.interval.stop ();
|
||||
}
|
||||
return;
|
||||
}
|
||||
function to() {
|
||||
obj.refresh (function() {
|
||||
//obj.clear ();
|
||||
});
|
||||
if (r2ui.selected_panel === "Logs")
|
||||
setTimeout (to, n * 1000);
|
||||
else console.log("Not in logs :(");
|
||||
return true;
|
||||
}
|
||||
obj.interval = setTimeout (to, n * 1000);
|
||||
}
|
||||
obj.on = function(ev, cb) {
|
||||
obj.events[ev] = cb;
|
||||
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:green>function:</span>");
|
||||
x = x.replace (/;(\s+)/g, ";");
|
||||
x = x.replace (/;(.*)/g, "// <span style='color:#209020'>$1</span>");
|
||||
x = x.replace (/(bl|goto|call)/g, "<b style='color:green'>call</b>");
|
||||
x = x.replace (/(jmp|bne|beq|js|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:#1070d0'>$1</b>");
|
||||
x = x.replace (/(hlt|leave|iretd|retn|ret)/g, "<b style='color:red'>$1</b>");
|
||||
x = x.replace (/(add|sbb|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g, "<b style='color:#d06010'>$1</b>");
|
||||
x = x.replace (/(push|pop)/g, "<b style='color:#40a010'>$1</b>");
|
||||
x = x.replace (/(test|cmp)/g, "<b style='color:#c04080'>$1</b>");
|
||||
x = x.replace (/(outsd|out|string|invalid|int |int3|trap|main|in)/g, "<b style='color:red'>$1</b>");
|
||||
x = x.replace (/nop/g, "<b style='color:blue'>nop</b>");
|
||||
x = x.replace (/(sym|fcn|str|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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |