Last active
July 23, 2025 18:06
-
-
Save rajdakin/35142f25be1a92660a6eb656a59286f6 to your computer and use it in GitHub Desktop.
box86.org compatibility list code
This file contains hidden or 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: 19%; | |
| 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: 59%; | |
| 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; | |
| } | |
| #archfilterli { | |
| width: 19%; | |
| margin-left: 0; | |
| } | |
| #archfilterul { | |
| margin: 0; | |
| } | |
| #archfilterul li { | |
| margin: 0; | |
| list-style-type: none; | |
| border: 1px solid #aaaaaa; | |
| border-bottom: none; | |
| padding: 5px; | |
| line-height: 34px; | |
| width: 100%; | |
| } | |
| #archfilterul li.selected { | |
| background: #888888; | |
| } | |
| #archfilterul li:hover:not(.selected) { | |
| background: #00ffff80; | |
| } | |
| #archfilterul > li:first-child { | |
| border-top-left-radius: 3px; | |
| border-top-right-radius: 3px; | |
| } | |
| #archfilterul > 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: 25%; } .entryuser { width: 16%; } .entryarch { width: 7%; } | |
| .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><li id="archfilterli"><div><ul id="archfilterul"> | |
| <li onclick="noarchButtonClick(this)" class="selected">No filter on arch</li> | |
| <li onclick="this.children[0].click()"><label class="filterlab">ARM | |
| <input type="checkbox" checked="checked" onchange="archButtonClick(0, this)"> | |
| <span class="checkmark"></span> | |
| </label></li> | |
| <li onclick="this.children[0].click()"><label class="filterlab">Loongarch | |
| <input type="checkbox" checked="checked" onchange="archButtonClick(1, this)"> | |
| <span class="checkmark"></span> | |
| </label></li> | |
| <li onclick="this.children[0].click()"><label class="filterlab">RiscV | |
| <input type="checkbox" checked="checked" onchange="archButtonClick(2, this)"> | |
| <span class="checkmark"></span> | |
| </label></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>Native arch.</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}; | |
| window.elemArchs2typ = {"ARM": 1, "LA64": 2, "ARMLA64": 3, "RV64": 4, "ARMRV64": 5, "LA64RV64": 6, "ARMLA64RV64": 7}; | |
| 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 convert_archs(archs) { | |
| if (archs === 1) return "ARM"; | |
| if (archs === 2) return "LA64"; | |
| if (archs === 3) return "ARM<br/>LA64"; | |
| if (archs === 4) return "RV64"; | |
| if (archs === 5) return "ARM<br/>RV64"; | |
| if (archs === 6) return "LA64<br/>RV64"; | |
| if (archs === 7) return "ARM<br/>LA64<br/>RV64"; | |
| 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; | |
| archs = document.createElement("td"); | |
| archs.className = "entryarch"; | |
| archs.innerHTML = convert_archs(elem.archs); | |
| 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(archs); | |
| 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.filter_archul = document.getElementById("archfilterul"); | |
| 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; window.filter_arch = 7; | |
| 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 | |
| archs = 0; // 1 = ARM, 2 = LoongArch, 4 = RiscV (bitfield, default is 1) | |
| 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; | |
| case 8471769507: // cpu:arm | |
| archs |= 1; | |
| break; | |
| case 8471770955: // cpu:la64 | |
| archs |= 2; | |
| break; | |
| case 8471770126: // cpu:rv64 | |
| archs |= 4; | |
| 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 (archs === 0) archs = 1; | |
| 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, archs: archs }; | |
| 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) { | |
| fallbackregexp = /<img [^>]*src="(https:\/\/github.com\/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; | |
| archs = elem.archs; | |
| } else { | |
| title = elem.children[0].children[0].firstChild.textContent; | |
| b32t = window.elemContent2typ[elem.children[5].textContent]; | |
| b64t = window.elemContent2typ[elem.children[4].textContent]; | |
| b86t = window.elemContent2typ[elem.children[3].textContent]; | |
| archs = window.elemArchs2typ[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) && ((archs & window.filter_arch) !== 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(); | |
| } | |
| function noarchButtonClick(button) { | |
| button.className = "selected"; | |
| window.filter_arch = 7; | |
| window.filter_archul.children[1].children[0].children[0].checked = true; | |
| window.filter_archul.children[2].children[0].children[0].checked = true; | |
| window.filter_archul.children[3].children[0].children[0].checked = true; | |
| refilter(); | |
| } | |
| function archButtonClick(buttonid, button) { | |
| window.filter_archul.children[0].className = ""; | |
| if (button.checked) { | |
| window.filter_arch |= 1 << buttonid; | |
| } else { | |
| // > | |
| window.filter_arch &= ~(1 << buttonid); | |
| } | |
| refilter(); | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment