1"use strict"; 2 3$.ajaxSettings.async = false; 4const jsonNameList = ["twoFlipsAlgToInfo", "twoFlipsAlgToNightmare", "twoFlipsPosToCode", "twoFlipsPosToNumber"]; 5const jsonLoaded = jsonNameList.map((name) => $.getJSON(`assets/json/${name}.json`, (json) => { 6 window[`${name}`] = json; 7})); 8 9function algSearch() { 10 let idValue = ""; 11 if (twoFlipsPosToNumber[document.getElementById("edgeinput1").value] < twoFlipsPosToNumber[document.getElementById("edgeinput2").value]) { 12 idValue = twoFlipsPosToCode[document.getElementById("edgeinput1").value] + twoFlipsPosToCode[document.getElementById("edgeinput2").value]; 13 } else { 14 idValue = twoFlipsPosToCode[document.getElementById("edgeinput2").value] + twoFlipsPosToCode[document.getElementById("edgeinput1").value]; 15 } 16 17 const div1 = document.getElementById("div1"); 18 if (twoFlipsAlgToInfo.hasOwnProperty(idValue)) { 19 const rows = twoFlipsAlgToInfo[idValue].length; 20 let tab = `<table id="table"><thead><tr><th>${arrLang[lang]["no"]}</th><th>${arrLang[lang]["algorithm"]}</th><th>${arrLang[lang]["commutator"]}</th><th>${arrLang[lang]["thumbPosition"]}</th></tr></thead><tbody>`; 21 for (let i = 0; i < rows; i++) { 22 if (twoFlipsAlgToInfo[idValue][i] === twoFlipsAlgToNightmare[idValue]) { 23 tab += "<tr bgcolor=\"#D0D0D0\">"; 24 } else { 25 tab += "<tr>"; 26 } 27 tab += `<td>${i + 1}</td>`; 28 tab += `<td>${twoFlipsAlgToInfo[idValue][i]}</td>`; 29 tab += `<td>${commutator(twoFlipsAlgToInfo[idValue][i])}</td>`; 30 tab += `<td>${fingerbeginfrom(twoFlipsAlgToInfo[idValue][i])}</td>`; 31 tab += "</tr>"; 32 } 33 tab += "</tbody></table>"; 34 div1.innerHTML = tab; 35 } else { 36 div1.innerHTML = ""; 37 } 38 const r = $("#table").width() / $("#div1").width(); 39 if (r > 1) { 40 $("#table").css("font-size", 16 / r); 41 } 42}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.