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