reccomp: add option to hide 100% matching functions (#35)

* add option to hide 100% matching functions

* slight formatting improvement

---------

Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
This commit is contained in:
MS 2023-06-21 17:43:01 -04:00 committed by GitHub
parent fa63d7e341
commit 4d531d1de5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,12 @@
#sortind {
margin: 0 0.5em;
}
.filters {
font-size: 10pt;
text-align: center;
margin: 0.5em 0 1em 0;
}
</style>
<script>
var data = [/* INSERT DATA HERE */];
@ -115,18 +121,25 @@
}
}
function filter(text) {
const filterOptions = { text: '', hidePerfect: false };
function filter() {
closeAllDiffs();
var ltext = text.toLowerCase();
var ltext = filterOptions.text.toLowerCase();
const collection = document.getElementsByClassName("funcrow");
var searchCount = 0;
for (var ele of collection) {
var eledata = data[ele.dataset.index];
if (text == ''
const textOk = (ltext == ''
|| eledata.address.toLowerCase().includes(ltext)
|| eledata.name.toLowerCase().includes(ltext)) {
|| eledata.name.toLowerCase().includes(ltext));
const perfOk = (!filterOptions.hidePerfect || (eledata.matching < 1));
if (textOk && perfOk) {
ele.style.display = '';
searchCount++;
} else {
@ -219,9 +232,16 @@
var search = document.getElementById('search');
search.addEventListener('input', function (evt) {
filter(search.value);
filterOptions.text = search.value;
filter();
});
const cbHidePerfect = document.getElementById('cbHidePerfect');
cbHidePerfect.addEventListener('change', evt => {
filterOptions.hidePerfect = evt.target.checked;
filter();
})
sortByColumn(0);
});
</script>
@ -230,8 +250,10 @@
<div class="main">
<h1>Decompilation Status</h1>
<input id="search" type="search" placeholder="Search for offset or function name...">
<br>
<br>
<div class="filters">
<label for="cbHidePerfect">Hide 100% match</label>
<input type="checkbox" id="cbHidePerfect" />
</div>
<table id="listing">
<tr id='listingheader'><th style='width: 20%'>Address</th><th style="width:60%">Name</th><th style='width: 20%'>Matching</th></tr>
</table>