Last active
November 4, 2024 19:40
-
-
Save rajdakin/35142f25be1a92660a6eb656a59286f6 to your computer and use it in GitHub Desktop.
box86.org compatibility list code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#table_stats { | |
width: 100%; | |
height: 1em; | |
background: #808080; | |
margin-bottom: 0; | |
text-align: center; | |
line-height: 1em; | |
} | |
#table_stats > div { | |
height: 100%; | |
float: left; | |
font-size: .75em; | |
overflow: hidden; | |
} | |
#table_fail { background: #ff8080; } #table_most { background: #ffff40; } #table_pass { background: #80ff80; } #table_unkn { float: none !important; } | |
#partial_stats { | |
border-top: 1px solid #000000; | |
width: 100%; | |
height: 1em; | |
background: #808080; | |
text-align: center; | |
line-height: 1em; | |
} | |
#partial_stats > div { | |
height: 100%; | |
float: left; | |
font-size: .75em; | |
overflow: hidden; | |
} | |
#partial_fail { background: #ff8080; } #partial_most { background: #ffff40; } #partial_pass { background: #80ff80; } #partial_unkn { float: none !important; } | |
#pagination { | |
height: 34px; | |
} | |
#paginationlist { | |
float: left; | |
margin: 0; | |
padding: 0; | |
} | |
#paginationlist li { | |
list-style-type: none; | |
float: left; | |
margin: 0; | |
border: 1px solid #aaaaaa; | |
border-right: none; | |
padding: 0; | |
width: 34px; | |
height: 34px; | |
text-align: center; | |
line-height: 34px; | |
} | |
#paginationlist li.selected { | |
background: #888888; | |
} | |
#paginationlist li:hover:not(.selected) { | |
background: #00ffff80; | |
} | |
#paginationlist li:first-child { | |
border-top-left-radius: 3px; | |
border-bottom-left-radius: 3px; | |
} | |
#paginationlist li.last-child-pag { | |
border-top-right-radius: 3px; | |
border-bottom-right-radius: 3px; | |
border-right: 1px solid #aaaaaa; | |
} | |
#paginationlist li a { | |
user-select: none; | |
color: #000000; | |
text-decoration: none; | |
text-align: center; | |
} | |
#filters li { | |
display: inline-flex; | |
margin-right: 0; | |
} | |
#filters li a { | |
user-select: none; | |
color: #000000; | |
text-decoration: none; | |
vertical-align: middle; | |
} | |
#statusfilterli { | |
width: 24%; | |
margin-left: 0; | |
} | |
#statusfilterul { | |
margin: 0; | |
} | |
#statusfilterul li { | |
margin: 0; | |
list-style-type: none; | |
border: 1px solid #aaaaaa; | |
border-bottom: none; | |
padding: 5px; | |
line-height: 34px; | |
width: 100%; | |
} | |
#statusfilterul li.selected { | |
background: #888888; | |
} | |
#statusfilterul li:hover:not(.selected) { | |
background: #00ffff80; | |
} | |
#statusfilterul > li:first-child { | |
border-top-left-radius: 3px; | |
border-top-right-radius: 3px; | |
} | |
#statusfilterul > li:last-child { | |
border-bottom-left-radius: 3px; | |
border-bottom-right-radius: 3px; | |
border-bottom: 1px solid #aaaaaa; | |
} | |
#boxfilterli { | |
width: 74%; | |
margin-left: 1%; | |
} | |
#boxfilterli > div { | |
width: 100%; | |
} | |
#boxfilterul { | |
margin: 0; | |
width: 100%; | |
} | |
#boxfilterul > li { | |
margin: 0; | |
list-style-type: none; | |
border: 1px solid #aaaaaa; | |
border-bottom: none; | |
padding: 5px; | |
line-height: 34px; | |
width: 100%; | |
} | |
#boxfilterul li.selected { | |
background: #888888; | |
} | |
#boxfilterul li:hover:not(.selected, .unselectable) { | |
background: #00ffff80; | |
} | |
#boxfilterul > li:first-child { | |
border-top-left-radius: 3px; | |
border-top-right-radius: 3px; | |
} | |
#boxfilterul > li:last-child { | |
border-bottom-left-radius: 3px; | |
border-bottom-right-radius: 3px; | |
border-bottom: 1px solid #aaaaaa; | |
} | |
#boxfilteridx { | |
width: 100%; | |
margin: 0; | |
border: none; | |
} | |
#boxfilteridx > li { | |
margin: 0; | |
border: none; | |
border-right: 1px solid #aaaaaa; | |
list-style-type: none; | |
line-height: 34px; | |
width: 33%; | |
height: 100%; | |
padding: 5px; | |
} | |
#boxfilteridx > li:first-child { | |
width: 34%; | |
} | |
#boxfilteridx > li:last-child { | |
border-right: none; | |
} | |
#boxfilter32s { | |
margin: 0; | |
} | |
#boxfilter32s > li:first-child { | |
margin: 0; | |
border: none; | |
list-style-type: none; | |
line-height: 34px; | |
width: 100%; | |
} | |
#boxfilter32s > li:not(:first-child) { | |
padding: 5px; | |
width: 100%; | |
} | |
#boxfilter32s > li { | |
margin: 0; | |
border: 1px solid #aaaaaa; | |
border-bottom: none; | |
list-style-type: none; | |
line-height: 34px; | |
} | |
#boxfilter32s > li:nth-child(2) { | |
border-top-left-radius: 3px; | |
border-top-right-radius: 3px; | |
} | |
#boxfilter32s > li:last-child { | |
border-bottom-left-radius: 3px; | |
border-bottom-right-radius: 3px; | |
border-bottom: 1px solid #aaaaaa; | |
} | |
.filterlab { | |
position: relative; | |
padding: 0 0 0 25px; | |
margin: 0; | |
font-size: inherit; | |
} | |
.filterlab input { | |
display: none; | |
position: absolute; | |
opacity: 0; | |
cursor: pointer; | |
height: 0; | |
width: 0; | |
} | |
.checkmark { | |
position: absolute; | |
top: 5px; | |
left: 0; | |
height: 20px; | |
width: 20px; | |
background-color: #eeeeee; | |
border-radius: 7px; | |
} | |
.filterlab:hover input ~ .checkmark { | |
background-color: #cccccc; | |
} | |
.filterlab input:checked ~ .checkmark { | |
background-color: #2196f3; | |
} | |
.checkmark:after { | |
content: ""; | |
position: absolute; | |
display: none; | |
} | |
.filterlab input:checked ~ .checkmark:after { | |
display: block; | |
} | |
.filterlab .checkmark:after { | |
left: 6.5px; | |
top: 2.5px; | |
width: 7px; | |
height: 12px; | |
border: solid white; | |
border-width: 0 3px 3px 0; | |
-webkit-transform: rotate(45deg); | |
-ms-transform: rotate(45deg); | |
transform: rotate(45deg); | |
} | |
#table_here { | |
width: 100%; | |
text-align: center; | |
vertical-align: middle; | |
} | |
#table_here > .entry > td { | |
overflow-x: hidden; | |
padding: 5px; | |
} | |
.entrytitle { width: 30%; } .entryuser { width: 16%; } | |
.entrybox-1 { width: 7%; background-color: #ff0000; } | |
.entrybox0 { width: 7%; background-color: #d8d8d8; } | |
.entrybox1 { width: 7%; background-color: #ff8080; } | |
.entrybox2 { width: 7%; background-color: #ffff40; } | |
.entrybox3 { width: 7%; background-color: #80ff80; } | |
.entrybox4 { width: 7%; background-color: #ff6000; } | |
.entrypic { width: 30%; } | |
.entrypic > img { max-width: 100%; max-height: 100%; } | |
</style> | |
<div id="table_stats"><div id="table_fail"></div><div id="table_most"></div><div id="table_pass"></div><div id="table_unkn"></div></div> | |
<div id="partial_stats"><div id="partial_fail"></div><div id="partial_most"></div><div id="partial_pass"></div><div id="partial_unkn"></div></div> | |
<div>Red: not working; Yellow: partially working; Green: working; Gray: unknown. Above: unfiltered; below: filtered.</div> | |
<details> | |
<summary>Show filters</summary> | |
<div><input type="text" placeholder="Search for a game..." onchange="search_changed(this.value);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"></div> | |
<div id="filters"><ul> | |
<li id="statusfilterli"><div><ul id="statusfilterul"> | |
<li onclick="nostatusButtonClick(this)" class="selected">No filter on status</li> | |
<li onclick="this.children[0].click()"><label class="filterlab">Not working | |
<input type="checkbox" checked="checked" onchange="statusButtonClick(1, this)"> | |
<span class="checkmark"></span> | |
</label></li> | |
<li onclick="this.children[0].click()"><label class="filterlab">Partly working | |
<input type="checkbox" checked="checked" onchange="statusButtonClick(2, this)"> | |
<span class="checkmark"></span> | |
</label></li> | |
<li onclick="this.children[0].click()"><label class="filterlab">Working | |
<input type="checkbox" checked="checked" onchange="statusButtonClick(3, this)"> | |
<span class="checkmark"></span> | |
</label></li> | |
<li onclick="this.children[0].click()"><label class="filterlab">Unknown | |
<input type="checkbox" checked="checked" onchange="statusButtonClick(0, this)"> | |
<span class="checkmark"></span> | |
</label></li> | |
</ul></div></li><li id="boxfilterli"><div><ul id="boxfilterul"> | |
<li onclick="noboxButtonClick(this)" class="selected">No filter on box version</li> | |
<li class="unselectable" style="padding: 0"> | |
<ul id="boxfilteridx"> | |
<li class="unselectable"> | |
<ul id="boxfilter32s"> | |
<li onclick="this.children[0].click()"><label class="filterlab">32-bit programs | |
<input id="boxfilter32" type="checkbox" checked="checked" onchange="boxHaveClick(10, this)"> | |
<span class="checkmark"></span> | |
</label></li><li onclick="box32Click(3, this)"><a>box32</a></li><li onclick="box32Click(1, this)"><a>box86</a></li><li onclick="box32Click(0, this)" class="selected"><a>Both</a></li> | |
</ul> | |
</li><li onclick="this.children[0].click()"><label class="filterlab">64-bit programs | |
<input type="checkbox" checked="checked" onchange="boxHaveClick(4, this)"> | |
<span class="checkmark"></span> | |
</label></li><li onclick="this.children[0].click()"><label class="filterlab">Unknown | |
<input type="checkbox" checked="checked" onchange="boxHaveClick(1, this)"> | |
<span class="checkmark"></span> | |
</label></li> | |
</ul> | |
</li> | |
</ul></div></li> | |
</ul></div> | |
</details> | |
<div id="please_wait_loading">Please wait, loading... (Loading 1-100)</div> | |
<div id="pagination"><ul id="paginationlist"></ul></div> | |
<table id="table_here"><tbody><tr><th>Title</th><th>Original poster</th><th>box86</th><th>box64</th><th>box32</th><th>Picture (if available)</th></tr></tbody></table> | |
<div>NW means "not working"; "PW" means "partially working"; "W" means "working".</div> | |
<script> | |
window.elemContent2typ = {"(conflict)": -1, "": 0, "NW": 1, "PW": 2, "W": 3, "(unknown)": 4}; | |
function convert_box_type(typ) { | |
if (typ === -1) return "(conflict)"; | |
else if (typ === 1) return "NW"; | |
else if (typ === 2) return "PW"; | |
else if (typ === 3) return "W"; | |
else if (typ === 4) return "(unknown)"; | |
else return ""; | |
} | |
function maybe_convert_element(id) { | |
elem = window.trcompatibilitylist[id]; | |
if (elem.constructor === Object) { | |
newdiv = document.createElement("tr"); | |
newdiv.className = "entry"; | |
title = document.createElement("td"); | |
title.className = "entrytitle"; | |
title.innerHTML = "<a href=" + elem.html_url + ">" + elem.title + "</a>"; | |
user = document.createElement("td"); | |
user.className = "entryuser"; | |
user.innerText = elem.user; | |
b86 = document.createElement("td"); | |
b86.className = "entrybox" + elem.b86; | |
b86.innerText = convert_box_type(elem.b86); | |
b64 = document.createElement("td"); | |
b64.className = "entrybox" + elem.b64; | |
b64.innerText = convert_box_type(elem.b64); | |
b32 = document.createElement("td"); | |
b32.className = "entrybox" + elem.b32; | |
b32.innerText = convert_box_type(elem.b32); | |
pic = document.createElement("td"); | |
pic.className = "entrypic"; | |
if (elem.picsrc === null) { pic.innerText = "Picture unavailable"; } | |
else { pic.innerHTML = "<img src=\"" + elem.picsrc + "\">"; } | |
newdiv.appendChild(title); | |
newdiv.appendChild(user); | |
newdiv.appendChild(b86); | |
newdiv.appendChild(b64); | |
newdiv.appendChild(b32); | |
newdiv.appendChild(pic); | |
window.trcompatibilitylist[id] = newdiv; | |
} | |
} | |
document.addEventListener("DOMContentLoaded", function(){ | |
reqstr = "https://api.github.com/repos/ptitSeb/box86-compatibility-list/issues?accept=application/vnd.github.v3+json&state=open&per_page=100&page="; | |
failcnt = 0; mostcnt = 0; passcnt = 0; unkncnt = 0; | |
window.trcompatibilitylist = []; window.trcompatibilitynos = []; window.curtbl = 0; window.itemsppage = 15; window.tablerowdummies = []; | |
window.title_filter = ""; window.lastButton = 0; | |
window.finished_load = false; | |
window.filter_statusul = document.getElementById("statusfilterul"); | |
window.filter_nobox = document.getElementById("boxfilterul").children[0]; | |
window.filter_boxul = document.getElementById("boxfilteridx"); | |
window.sel_box32 = window.filter_boxul.children[0].children[0].children[3]; | |
window.box32all = window.filter_boxul.children[0].children[0].children[3]; | |
window.filter_status = 15; window.filter_box = 15; | |
for (i = 0; i < window.itemsppage; ++i) { | |
window.tablerowdummies[i] = document.createElement("div"); | |
document.getElementById("table_here").appendChild(window.tablerowdummies[i]); | |
} | |
function addfailedstr(msg) { | |
faileddiv = document.createElement("div"); | |
failedtxt = document.createTextDiv(msg); | |
faileddiv.style.color = "red"; | |
faileddiv.appendChild(failedtxt); | |
document.getElementById("table_here").appendChild(faileddiv); | |
console.error(msg); | |
} | |
function addtr(tablerow) { | |
window.trcompatibilitylist.push(tablerow); | |
if (window.curtbl === 0) { | |
window.curtbl = 1; | |
window.itemcount = 0; | |
} | |
if (window.itemcount % window.itemsppage === 0) { | |
paglst = document.getElementById("paginationlist"); | |
if (paglst.childElementCount >= 0) { | |
newPage = document.createElement("li"); | |
paglst.appendChild(newPage); | |
if (paglst.childElementCount === 1) { | |
window.selectedPage = 0; | |
newPage.outerHTML = "<li style=\"\" class=\"selected last-child-pag\" onclick=\"paginationButtonClick(0)\"><a>1</a></li>"; | |
} else { | |
newPage.outerHTML = "<li style=\"display: none;\" class=\"\" onclick=\"paginationButtonClick(" + (paglst.childElementCount-1) + ")\"><a>" + paglst.childElementCount + "</a></li>"; | |
} | |
} | |
} | |
++window.itemcount; | |
} | |
function nextPage(page) { | |
req = new XMLHttpRequest(); | |
req.open("GET", reqstr + page); | |
req.onerror = function(){ | |
addfailedstr("Failed to fetch the GitHub issues"); | |
}; | |
req.onload = function(){ | |
if (req.responseType !== "") { | |
addfailedstr("Unknown response type " + req.responseType); | |
} else { | |
var resp = JSON.parse(req.response); | |
for (const issueID in resp) { | |
const issue = resp[issueID]; | |
b32type = 0; // -1 = conflict, 0 = none, 1 = Not-working, 2 = Partially-working, 3 = Working | |
b64type = 0; // -1 = conflict, 0 = none, 1 = Not-working, 2 = Partially-working, 3 = Working | |
b86type = 0; // -1 = conflict, 0 = none, 1 = Not-working, 2 = Partially-working, 3 = Working | |
boxs = 0; // 1 = box86, 2 = box64, 4 = box32 (bitfield) | |
worsttype = 4; | |
for (const labelID in issue["labels"]) { | |
switch (issue["labels"][labelID].id) { | |
case 7698104365: // box32 not working | |
if (b32type === 0) { | |
b32type = 1; | |
worsttype = Math.min(worsttype, 1); | |
} else { | |
console.error("Conflicting box32 types for " + issue["title"] + ": " + b32type + " and 1"); | |
b32type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698100008: // box32 partly working | |
if (b32type === 0) { | |
b32type = 2; | |
worsttype = Math.min(worsttype, 2); | |
} else { | |
console.error("Conflicting box32 types for " + issue["title"] + ": " + b32type + " and 2"); | |
b32type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698094015: // box32 working | |
if (b32type === 0) { | |
b32type = 3; | |
worsttype = Math.min(worsttype, 3); | |
} else { | |
console.error("Conflicting box32 types for " + issue["title"] + ": " + b32type + " and 3"); | |
b32type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698110341: // box64 not working | |
if (b64type === 0) { | |
b64type = 1; | |
worsttype = Math.min(worsttype, 1); | |
} else { | |
console.error("Conflicting box64 types for " + issue["title"] + ": " + b64type + " and 1"); | |
b64type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698111978: // box64 partly working | |
if (b64type === 0) { | |
b64type = 2; | |
worsttype = Math.min(worsttype, 2); | |
} else { | |
console.error("Conflicting box64 types for " + issue["title"] + ": " + b64type + " and 2"); | |
b64type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698113372: // box64 working | |
if (b64type === 0) { | |
b64type = 3; | |
worsttype = Math.min(worsttype, 3); | |
} else { | |
console.error("Conflicting box64 types for " + issue["title"] + ": " + b64type + " and 3"); | |
b64type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698116582: // box86 not working | |
if (b86type === 0) { | |
b86type = 1; | |
worsttype = Math.min(worsttype, 1); | |
} else { | |
console.error("Conflicting box86 types for " + issue["title"] + ": " + b86type + " and 1"); | |
b86type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698118025: // box86 partly working | |
if (b86type === 0) { | |
b86type = 2; | |
worsttype = Math.min(worsttype, 2); | |
} else { | |
console.error("Conflicting box86 types for " + issue["title"] + ": " + b86type + " and 2"); | |
b86type = -1; | |
worsttype = -1; | |
} | |
break; | |
case 7698119238: // box86 working | |
if (b86type === 0) { | |
b86type = 3; | |
worsttype = Math.min(worsttype, 3); | |
} else { | |
console.error("Conflicting box86 types for " + issue["title"] + ": " + b86type + " and 3"); | |
b86type = -1; | |
worsttype = -1; | |
} | |
break; | |
default: | |
continue; | |
} | |
} | |
if (b86type !== 0) boxs |= 1; | |
if (b64type !== 0) boxs |= 2; | |
if (b32type !== 0) boxs |= 4; | |
if (boxs === 0) { | |
// Fallback | |
for (const labelID in issue["labels"]) { | |
if (issue["labels"][labelID].id === 2018095883) worsttype = 1; | |
else if (issue["labels"][labelID].id === 2018095900) worsttype = 2; | |
else if (issue["labels"][labelID].id === 2024688036) worsttype = 3; | |
} | |
for (const labelID in issue["labels"]) { | |
if (issue["labels"][labelID].id === 3486241431) { | |
boxs |= 1; b86type = worsttype; | |
} | |
if (issue["labels"][labelID].id === 3486242986) { | |
boxs |= 2; b64type = worsttype; | |
} | |
} | |
} | |
if (worsttype === 1) ++failcnt; | |
else if (worsttype === 2) ++mostcnt; | |
else if (worsttype === 3) ++passcnt; | |
else ++unkncnt; | |
newrow = { html_url: issue.html_url, title: issue.title, user: issue.user.login, boxs: boxs, | |
b32: b32type, b64: b64type, b86: b86type }; | |
picsrcregexp = /(https?:\/\/[^:<>"']+\/[^:<>"'\/]+\.(png(!thumbnail)?|jpe?g))/gi; | |
picsrc = picsrcregexp.exec(issue.body); | |
if (picsrc === null) { | |
fallbackregexp = /]\((https:\/\/github.com\/(ptitSeb\/box86-compatibility-list|user-attachments)\/assets\/[^)]+)/gi; | |
picsrc = fallbackregexp.exec(issue.body); | |
} | |
if (picsrc === null) { newrow.picsrc = null; } | |
else { newrow.picsrc = picsrc[1]; } | |
addtr(newrow); | |
} | |
totcnt = failcnt + mostcnt + passcnt + unkncnt; | |
document.getElementById("table_fail").style.width = (100*failcnt / totcnt) + "%"; | |
document.getElementById("table_fail").innerText = failcnt; | |
document.getElementById("table_most").style.width = (100*mostcnt / totcnt) + "%"; | |
document.getElementById("table_most").innerText = mostcnt; | |
document.getElementById("table_pass").style.width = (100*passcnt / totcnt) + "%"; | |
document.getElementById("table_pass").innerText = passcnt; | |
document.getElementById("table_unkn").innerText = unkncnt; | |
please_wait = document.getElementById("please_wait_loading"); | |
if (resp.length === 100) { | |
please_wait.innerText = "Pleae wait, loading... (Loading " + page + "01-" + (page+1) + "00)" | |
nextPage(page + 1); | |
} else { | |
please_wait.parentElement.removeChild(please_wait); | |
window.finished_load = true; | |
refilter(); | |
} | |
} | |
}; | |
req.send(); | |
} | |
nextPage(1); | |
}); | |
function add_class(elem, cname) { | |
elem.className = (elem.className.length === 0) ? cname : (elem.className + " " + cname); | |
} | |
function remove_class(elem, cname) { | |
elem.className = elem.className.startsWith(cname + " ") ? elem.className.substr(cname.length + 1) : | |
(elem.className.endsWith(" " + cname) ? elem.className.substr(0, elem.className.length - cname.length - 1) : | |
((elem.className.startsWith(cname) && (elem.className.length === cname.length)) ? "" : | |
elem.className.replace(" " + cname + " ", " "))); | |
} | |
function paginationButtonClick(pageno) { | |
tab = document.getElementById("table_here"); | |
offset = pageno*window.itemsppage; | |
for (i = 0; i < window.itemsppage; ++i) { | |
id = offset + i; | |
if (id < window.trcompatibilitynos.length) { | |
id = window.trcompatibilitynos[id]; | |
maybe_convert_element(id); | |
tab.replaceChild(window.trcompatibilitylist[id], tab.children[i+1]); | |
} else { | |
tab.replaceChild(window.tablerowdummies[i], tab.children[i+1]); | |
} | |
} | |
paglst = document.getElementById("paginationlist"); | |
remove_class(paglst.children[window.selectedPage], "selected"); | |
window.selectedPage = pageno; | |
add_class(paglst.children[window.selectedPage], "selected"); | |
} | |
function refilter() { | |
if (!window.finished_load) return; // Wait until the requests are done; filtering will be done at the end | |
trcompatibilitynos = []; | |
fpasscnt = 0; | |
fmostcnt = 0; | |
ffailcnt = 0; | |
funkncnt = 0; | |
for (i = 0; i < window.trcompatibilitylist.length; ++i) { | |
elem = window.trcompatibilitylist[i]; | |
if (elem.constructor === Object) { | |
title = elem.title; | |
b32t = elem.b32; | |
b64t = elem.b64; | |
b86t = elem.b86; | |
} else { | |
title = elem.children[0].children[0].firstChild.textContent; | |
b32t = window.elemContent2typ[elem.children[4].textContent]; | |
b64t = window.elemContent2typ[elem.children[3].textContent]; | |
b86t = window.elemContent2typ[elem.children[2].textContent]; | |
} | |
wt = 0; // > | |
if ((window.filter_box & 2) && (b86t !== 0)) wt |= 1 << Math.max(b86t, 0); // > | |
if ((window.filter_box & 4) && (b64t !== 0)) wt |= 1 << Math.max(b64t, 0); // > | |
if ((window.filter_box & 8) && (b32t !== 0)) wt |= 1 << Math.max(b32t, 0); // > | |
if ((window.filter_box & 1) && (b32t === 0) && (b64t === 0) && (b86t === 0)) wt |= 1; | |
if (wt & 16) wt |= 1; // Unknown type, yet has a box => transform to unknown | |
if (((window.title_filter === "") || (title.toUpperCase().replace(/\s+/g, "").indexOf(window.title_filter) > -1)) | |
&& ((wt & window.filter_status) !== 0)) { | |
if ((wt & 2) !== 0) ++ffailcnt; | |
else if ((wt & 4) !== 0) ++fmostcnt; | |
else if ((wt & 8) !== 0) ++fpasscnt; | |
else ++funkncnt; | |
trcompatibilitynos.push(i); | |
} | |
} | |
// We may end up replacing a visible child by another one, which is *bad* | |
tab = document.getElementById("table_here"); | |
for (i = 0; i < window.itemsppage; ++i) { | |
tab.replaceChild(window.tablerowdummies[i], tab.children[i+1]); | |
} | |
paglst = document.getElementById("paginationlist"); | |
remove_class(paglst.children[window.lastButton], "last-child-pag"); | |
window.lastButton = (trcompatibilitynos.length === 0) ? 0 : (((trcompatibilitynos.length - 1) / window.itemsppage) >> 0); | |
add_class(paglst.children[window.lastButton], "last-child-pag"); | |
for (i = 0; i <= window.lastButton; ++i) { | |
paglst.children[i].style.display = ''; | |
} | |
for (i = window.lastButton + 1; i < paglst.childElementCount; ++i) { | |
paglst.children[i].style.display = 'none'; | |
} | |
window.trcompatibilitynos = trcompatibilitynos; | |
paginationButtonClick(0); | |
ftotcnt = trcompatibilitynos.length; | |
if (ftotcnt > 0) { | |
document.getElementById("partial_fail").style.width = (100*ffailcnt / ftotcnt) + "%"; | |
document.getElementById("partial_fail").innerText = ffailcnt; | |
document.getElementById("partial_most").style.width = (100*fmostcnt / ftotcnt) + "%"; | |
document.getElementById("partial_most").innerText = fmostcnt; | |
document.getElementById("partial_pass").style.width = (100*fpasscnt / ftotcnt) + "%"; | |
document.getElementById("partial_pass").innerText = fpasscnt; | |
document.getElementById("partial_unkn").innerText = funkncnt; | |
} else { | |
document.getElementById("partial_fail").style.width = "0%"; | |
document.getElementById("partial_fail").innerText = ffailcnt; | |
document.getElementById("partial_most").style.width = "0%"; | |
document.getElementById("partial_most").innerText = fmostcnt; | |
document.getElementById("partial_pass").style.width = "0%"; | |
document.getElementById("partial_pass").innerText = fpasscnt; | |
document.getElementById("partial_unkn").innerText = funkncnt; | |
} | |
} | |
function search_changed(new_search) { | |
window.title_filter = new_search.toUpperCase().replace(/\s+/g, ""); | |
refilter(); | |
} | |
function nostatusButtonClick(button) { | |
button.className = "selected"; | |
window.filter_status = 15; | |
window.filter_statusul.children[1].children[0].children[0].checked = true; | |
window.filter_statusul.children[2].children[0].children[0].checked = true; | |
window.filter_statusul.children[3].children[0].children[0].checked = true; | |
window.filter_statusul.children[4].children[0].children[0].checked = true; | |
refilter(); | |
} | |
function statusButtonClick(buttonid, button) { | |
window.filter_statusul.children[0].className = ""; | |
if (button.checked) { | |
window.filter_status |= 1 << buttonid; | |
} else { | |
// > | |
window.filter_status &= ~(1 << buttonid); | |
} | |
refilter(); | |
} | |
function noboxButtonClick(button) { | |
button.className = "selected"; | |
window.filter_box = 15; | |
window.filter_boxul.children[0].children[0].children[0].children[0].children[0].checked = true; | |
window.filter_boxul.children[1].children[0].children[0].checked = true; | |
window.filter_boxul.children[2].children[0].children[0].checked = true; | |
if (window.sel_box32 !== undefined) window.sel_box32.className = ""; | |
window.sel_box32 = window.box32all; | |
window.sel_box32.className = "selected"; | |
refilter(); | |
} | |
function boxHaveClick(mask, button) { | |
window.filter_nobox.className = ""; | |
button.className = "selected"; | |
if (button.checked) { | |
window.filter_box |= mask; | |
if (mask === 10) { | |
window.sel_box32 = window.box32all; | |
window.sel_box32.className = "selected"; | |
} | |
} else { | |
// > | |
window.filter_box &= ~mask; | |
if (mask === 10) { | |
if (window.sel_box32 !== undefined) window.sel_box32.className = ""; | |
window.sel_box32 = undefined; | |
} | |
} | |
refilter(); | |
} | |
function box32Click(buttonid, button) { | |
window.filter_nobox.className = ""; | |
if (window.sel_box32 !== undefined) window.sel_box32.className = ""; | |
window.sel_box32 = button; | |
button.className = "selected"; | |
window.filter_boxul.children[0].children[0].children[0].children[0].children[0].checked = true; | |
if (buttonid === 0) window.filter_box |= 10; | |
else { | |
window.filter_box = (window.filter_box & ~10) | (1 << buttonid); | |
} | |
refilter(); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment