PageSourceSearch

https://blddb.net/assets/js/edge.js

js blddb.net collected 2026-10-06 13:14:42 UTC 8,000 bytes, 184 lines download raw bytes

1"use strict";
2
3$.ajaxSettings.async = false;
4const jsonNameList = ["edgeChichuToNumber", "edgeAlgToStandard", "edgeAlgToInfo", "edgeAlgToNightmare", "edgeAlgToInfoManmade", "edgePosToCode", "edgeCodeToPos", "sourceToUrl"];
5const jsonLoaded = jsonNameList.map((name) => $.getJSON(`assets/json/${name}.json`, (json) => {
6    window[`${name}`] = json;
7}));
8
9if (getCookie("edgestyle") === "") {
10    setCookie("edgestyle", "nightmare", 400);
11} else {
12    document.getElementById("edgestyle").value = getCookie("edgestyle");
13}
14
15function switchStyle() {
16    setCookie("edgestyle", document.getElementById("edgestyle").value, 400);
17    algSearch();
18}
19
20function algSearch() {
21    let idValueOrigin = document.getElementById("edgeinput").value;
22    if (typeof idValueOrigin === "undefined") {
23        return;
24    }
25    idValueOrigin = idValueOrigin.toUpperCase();
26    const id = [idValueOrigin[0], idValueOrigin[1], idValueOrigin[2]];
27    let codecookie = "DEGCGAAJWIXKOOMREDCXTQLMKHIRZZPSBBLSQNJYHFFYWTNP";
28    if (getCookie("code") !== "") {
29        codecookie = getCookie("code");
30    }
31    for (const i in edgeChichuToNumber) {
32        for (let j = 0; j <= 2; j++) {
33            if (codecookie[edgeChichuToNumber[i]] === idValueOrigin[j]) {
34                id[j] = i;
35            }
36        }
37    }
38    let edgestylecookie = "nightmare";
39    if (getCookie("edgestyle") !== "") {
40        edgestylecookie = getCookie("edgestyle");
41    }
42    document.getElementById("edgeinput1").value = edgeCodeToPos[id[0]];
43    document.getElementById("edgeinput2").value = edgeCodeToPos[id[1]];
44    document.getElementById("edgeinput3").value = edgeCodeToPos[id[2]];
45    let idValue = edgeAlgToStandard[`${id[0]}${id[1]}${id[2]}`];
46    algSearchMain(idValue, edgestylecookie);
47}
48
49function algSearchByPos() {
50    const id = [];
51    id[0] = edgePosToCode[document.getElementById("edgeinput1").value];
52    id[1] = edgePosToCode[document.getElementById("edgeinput2").value];
53    id[2] = edgePosToCode[document.getElementById("edgeinput3").value];
54    let idValue = edgeAlgToStandard[`${id[0]}${id[1]}${id[2]}`];
55    const edgeinput = [];
56    if (typeof id[0] === "undefined") {
57        id[0] = "";
58    }
59    if (typeof id[1] === "undefined") {
60        id[1] = "";
61    }
62    if (typeof id[2] === "undefined") {
63        id[2] = "";
64    }
65    let codecookie = "DEGCGAAJWIXKOOMREDCXTQLMKHIRZZPSBBLSQNJYHFFYWTNP";
66    if (getCookie("code") !== "") {
67        codecookie = getCookie("code");
68    }
69    for (let i = 0; i <= 2; i++) {
70        if (id[i] === "") {
71            edgeinput[i] = "";
72        } else if (codecookie[edgeChichuToNumber[id[i]]] === "") {
73            edgeinput[i] = id[i];
74        } else {
75            edgeinput[i] = codecookie[edgeChichuToNumber[id[i]]];
76        }
77    }
78    let edgestylecookie = "nightmare";
79    if (getCookie("edgestyle") !== "") {
80        edgestylecookie = getCookie("edgestyle");
81    }
82    document.getElementById("edgeinput").value = `${edgeinput[0]}${edgeinput[1]}${edgeinput[2]}`;
83    algSearchMain(idValue, edgestylecookie);
84}
85
86function algSearchMain(idValue, edgestylecookie) {
87    const div1 = document.getElementById("div1");
88    let edgeAlgToInfoStyle = {};
89    let edgeAlgToStyle = {};
90    if (edgestylecookie === "nightmare") {
91        edgeAlgToInfoStyle = edgeAlgToInfo;
92        edgeAlgToStyle = edgeAlgToNightmare;
93    }
94    if (edgestylecookie === "manmade") {
95        edgeAlgToInfoStyle = edgeAlgToInfoManmade;
96    }
97    if (edgeAlgToInfoStyle.hasOwnProperty(idValue)) {
98        if (document.getElementById("edgeinput") === document.activeElement) {
99            document.getElementById("edgeinput").blur();
100        }
101        const rows = edgeAlgToInfoStyle[idValue].length;
102        let tab = "";
103        if (edgestylecookie === "manmade") {
104            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><th>${arrLang[lang]["source"]}</th></tr></thead><tbody>`;
105        } else {
106            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>`;
107        }
108        for (let i = 0; i < rows; i++) {
109            if (edgestylecookie !== "manmade" && edgeAlgToInfoStyle[idValue][i] === edgeAlgToStyle[idValue]) {
110                tab += "<tr bgcolor=\"#D0D0D0\">";
111            } else {
112                tab += "<tr>";
113            }
114            if (edgestylecookie === "manmade") {
115                const algInfo = edgeAlgToInfoStyle[idValue][i][0];
116                const sourceInfo = edgeAlgToInfoStyle[idValue][i][1];
117                tab += `<td rowspan="${algInfo.length}">${i + 1}</td>`;
118                for (let j = 0; j < algInfo.length; j++) {
119                    if (j === 0) {
120                        tab += `<td>${algInfo[j]}</td>`;
121                    } else {
122                        tab += `<td style="border-left:0px">${algInfo[j]}</td>`;
123                    }
124                    tab += `<td>${commutator(algInfo[j])}</td>`;
125                    let sourceElement = "";
126                    for (const source of sourceInfo) {
127                        let url = "";
128                        if (source in sourceToUrl) {
129                            if ("edge" in sourceToUrl[source]) {
130                                url = sourceToUrl[source]["edge"];
131                            } else if ("3bld" in sourceToUrl[source]) {
132                                url = sourceToUrl[source]["3bld"];
133                            } else if ("bld" in sourceToUrl[source]) {
134                                url = sourceToUrl[source]["bld"];
135                            }
136                        }
137                        let sourceNew = source;
138                        if (source.length > 25) {
139                            sourceNew = source.split("(")[0].trim();
140                            if (sourceNew.length > 25) {
141                                sourceNew = source.slice(0, 25) + "...";
142                            }
143                        }
144                        if (url !== "") {
145                            sourceElement = `${sourceElement}<a href="${url}" target="_blank">${sourceNew}</a>`;
146                        } else {
147                            sourceElement = `${sourceElement}${sourceNew}`;
148                        }
149                        if (source !== sourceInfo[sourceInfo.length - 1]) {
150                            sourceElement += "<br>";
151                        }
152                    }
153                    if (j === 0) {
154                        tab += `<td rowspan="${algInfo.length}">${fingerbeginfrom(algInfo[j])}</td>`;
155                        tab += `<td class="help" rowspan="${algInfo.length}">${sourceInfo.length} <span class="help-content">${sourceElement}</span></td>`;
156                    }
157                    tab += "</tr>";
158                    if (j !== algInfo.length - 1) {
159                        tab += "<tr>";
160                    }
161                }
162            } else {
163                tab += `<td>${i + 1}</td>`;
164                tab += `<td>${edgeAlgToInfoStyle[idValue][i]}</td>`;
165                tab += `<td>${commutator(edgeAlgToInfoStyle[idValue][i])}</td>`;
166                tab += `<td>${fingerbeginfrom(edgeAlgToInfoStyle[idValue][i])}</td>`;
167            }
168            tab += "</tr>";
169        }
170        tab += "</tbody></table>";
171        div1.innerHTML = tab;
172    } else {
173        div1.innerHTML = "";
174    }
175    const r = $("#table").width() / $("#div1").width();
176    if (r > 1) {
177        $("#table").css("font-size", 16 / r);
178    }
179}
180
181function fontAwesome() {
182    $("select").find("option[key='edgeStyleNightmare']").html(`&#128128; ${$("select").find("option[key='edgeStyleNightmare']").html()}`);
183    $("select").find("option[key='edgeStyleManmade']").html(`&thinsp;&#xf2bd; ${$("select").find("option[key='edgeStyleManmade']").html()}`);
184}

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.