isle-portable/tools/reccmp/template.html

366 lines
8.8 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Decompilation Status</title>
<style>
body {
background: #202020;
color: #f0f0f0;
font-family: sans-serif;
}
h1 {
text-align: center;
}
.main {
width: 800px;
max-width: 100%;
margin: auto;
}
#search {
width: 100%;
box-sizing: border-box;
background: #303030;
color: #f0f0f0;
border: 1px #f0f0f0 solid;
padding: 0.5em;
border-radius: 0.5em;
}
#search::placeholder {
color: #b0b0b0;
}
#listing {
width: 100%;
border-collapse: collapse;
font-family: monospace;
}
func-row:hover {
background: #404040 !important;
}
func-row:nth-child(odd of :not([hidden])), #listing > thead th {
background: #282828;
}
func-row:nth-child(even of :not([hidden])) {
background: #383838;
}
table#listing {
border: 1px #f0f0f0 solid;
}
#listing > thead th {
padding: 0.5em;
user-select: none;
width: 10%;
text-align: left;
}
#listing:not([show-recomp]) > thead th[data-col="recomp"] {
display: none;
}
#listing > thead th > div {
display: flex;
column-gap: 0.5em;
}
#listing > thead th > div > span {
cursor: pointer;
}
#listing > thead th > div > span:hover {
text-decoration: underline;
text-decoration-style: dotted;
}
#listing > thead th:last-child > div {
justify-content: right;
}
#listing > thead th[data-col="name"] {
width: 60%;
}
.diffneg {
color: #FF8080;
}
.diffpos {
color: #80FF80;
}
.diffslug {
color: #8080FF;
}
.identical {
font-style: italic;
text-align: center;
}
sort-indicator {
user-select: none;
}
.filters {
align-items: top;
display: flex;
font-size: 10pt;
justify-content: space-between;
margin: 0.5em 0 1em 0;
}
.filters > fieldset {
/* checkbox and radio buttons v-aligned with text */
align-items: center;
display: flex;
}
.filters > fieldset > input, .filters > fieldset > label {
cursor: pointer;
}
.filters > fieldset > label {
margin-right: 10px;
}
table.diffTable {
border-collapse: collapse;
}
table.diffTable:not(:last-child) {
/* visual gap *between* diff context groups */
margin-bottom: 40px;
}
table.diffTable td, table.diffTable th {
border: 0 none;
padding: 0 10px 0 0;
}
table.diffTable th {
/* don't break address if asm line is long */
word-break: keep-all;
}
diff-display[data-option="0"] th:nth-child(1) {
display: none;
}
diff-display[data-option="0"] th:nth-child(2),
diff-display[data-option="1"] th:nth-child(2) {
display: none;
}
label {
user-select: none;
}
#pageDisplay > button {
cursor: pointer;
padding: 0.25em 0.5em;
}
#pageDisplay select {
cursor: pointer;
padding: 0.25em;
margin: 0 0.5em;
}
p.rowcount {
align-self: flex-end;
font-size: 1.2em;
margin-bottom: 0;
}
</style>
<script>var data = {{{data}}};</script>
<script>{{{reccmp_js}}}</script>
</script>
</head>
<body>
<div class="main">
<h1>Decompilation Status</h1>
<listing-options>
<input id="search" type="search" placeholder="Search for offset or function name...">
<div class="filters">
<fieldset>
<legend>Options:</legend>
<input type="checkbox" id="cbHidePerfect" />
<label for="cbHidePerfect">Hide 100% match</label>
<input type="checkbox" id="cbHideStub" />
<label for="cbHideStub">Hide stubs</label>
<input type="checkbox" id="cbShowRecomp" />
<label for="cbShowRecomp">Show recomp address</label>
</fieldset>
<fieldset>
<legend>Search filters on:</legend>
<input type="radio" name="filterType" id="filterName" value=1 checked />
<label for="filterName">Name/address</label>
<input type="radio" name="filterType" id="filterAsm" value=2 />
<label for="filterAsm">Asm output</label>
<input type="radio" name="filterType" id="filterDiff" value=3 />
<label for="filterDiff">Asm diffs only</label>
</fieldset>
</div>
<div class="filters">
<p class="rowcount">Results: <span id="rowcount"></span></p>
<fieldset id="pageDisplay">
<legend>Page</legend>
<button id="pagePrev">prev</button>
<select id="pageSelect">
</select>
<button id="pageNext">next</button>
</fieldset>
</div>
</listing-options>
<listing-table>
<table id="listing">
<thead>
<tr>
<th data-col="address">
<div>
<span>Address</span>
<sort-indicator/>
</div>
</th>
<th data-col="recomp">
<div>
<span>Recomp</span>
<sort-indicator/>
</div>
</th>
<th data-col="name">
<div>
<span>Name</span>
<sort-indicator/>
</div>
</th>
<th data-col="diffs" data-no-sort></th>
<th data-col="matching">
<div>
<sort-indicator></sort-indicator>
<span>Matching</span>
</div>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</listing-table>
</div>
<template id="funcrow-template">
<style>
:host(:not([hidden])) {
display: table-row;
}
:host(:not([show-recomp])) > div[data-col="recomp"] {
display: none;
}
div[data-col="name"]:hover {
cursor: pointer;
}
div[data-col="name"]:hover > ::slotted(*) {
text-decoration: underline;
text-decoration-style: dotted;
}
::slotted(*:not([slot="name"])) {
white-space: nowrap;
}
:host > div {
border-top: 1px #f0f0f0 solid;
display: table-cell;
padding: 0.5em;
word-break: break-all !important;
}
:host > div:last-child {
text-align: right;
}
</style>
<div data-col="address"><can-copy><slot name="address"></slot></can-copy></div>
<div data-col="recomp"><can-copy><slot name="recomp"></slot></can-copy></div>
<div data-col="name"><slot name="name"></slot></div>
<div data-col="diffs"><slot name="diffs"></slot></div>
<div data-col="matching"><slot name="matching"></slot></div>
</template>
<template id="diffrow-template">
<style>
:host(:not([hidden])) {
display: table-row;
contain: paint;
}
td.singleCell {
border: 1px #f0f0f0 solid;
border-bottom: 0px none;
display: table-cell;
padding: 0.5em;
word-break: break-all !important;
}
</style>
<td class="singleCell" colspan="5">
<slot></slot>
</td>
</template>
<template id="nodiff-template">
<style>
::slotted(*) {
font-style: italic;
text-align: center;
}
</style>
<slot></slot>
</template>
<template id="can-copy-template">
<style>
:host {
position: relative;
}
::slotted(*) {
cursor: pointer;
}
slot::after {
background-color: #fff;
color: #222;
display: none;
font-size: 12px;
padding: 1px 2px;
width: fit-content;
border-radius: 1px;
text-align: center;
bottom: 120%;
box-shadow: 0 4px 14px 0 rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
position: absolute;
white-space: nowrap;
transition: .1s;
content: 'Copy to clipboard';
}
::slotted(*:hover) {
text-decoration: underline;
text-decoration-style: dotted;
}
slot:hover::after {
display: block;
}
:host([copied]) > slot:hover::after {
content: 'Copied!';
}
</style>
<slot></slot>
</template>
</body>
</html>