Home

ugit @main - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
tree log patch
remove js files
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQMpcGA+QyYbCK45U6t7n4yDzz+trklmyv+Vxi7WghINCEadnOqgUmxU/e0P0kTc3Q9 uwPaullV9ODtZnjp7gJQ4= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
1 week ago
2 changed files, 0 additions(+), 72 deletions(-)
internal/html/repo_file.jsinternal/html/repo_search.js
D internal/html/repo_file.js
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
diff --git a/internal/html/repo_file.js b/internal/html/repo_file.js
deleted file mode 100644
index 9dd234f3506d5b585302801b09f0f5fff9da75e3..0000000000000000000000000000000000000000
--- a/internal/html/repo_file.js
+++ /dev/null
@@ -1,70 +0,0 @@
-const lineRe = /#L(\d+)(?:-L(\d+))?/g
-const $lineLines = document.querySelectorAll(".chroma .lntable .lnt");
-const $codeLines = document.querySelectorAll(".chroma .lntable .line");
-const $copyButton = document.getElementById('copy');
-const $permalink = document.getElementById('permalink');
-const $copyIcon = "📋";
-const $copiedIcon = "✅";
-let $code = ""
-for (let codeLine of $codeLines) $code += codeLine.innerText;
-let start = 0;
-let end = 0;
-const results = [...location.hash.matchAll(lineRe)];
-if (0 in results) {
-    start = results[0][1] !== undefined ? parseInt(results[0][1]) : 0;
-    end = results[0][2] !== undefined ? parseInt(results[0][2]) : 0;
-}
-if (start !== 0) {
-    deactivateLines();
-    activateLines(start, end);
-    let anchor = `#${start}`;
-    if (end !== 0) anchor += `-${end}`;
-    if (anchor !== "") $permalink.href = $permalink.dataset.permalink + anchor;
-    $lineLines[start - 1].scrollIntoView(true);
-}
-for (let line of $lineLines) {
-    line.addEventListener("click", (event) => {
-        event.preventDefault();
-        deactivateLines();
-        const n = parseInt(line.id.substring(1));
-        let anchor = "";
-        if (event.shiftKey) {
-            end = n;
-            anchor = `#L${start}-L${end}`;
-        } else if (start === n) {
-            start = 0;
-            end = 0;
-        } else {
-            start = n;
-            end = 0;
-            anchor = `#L${start}`;
-        }
-        history.replaceState(null, null, window.location.pathname + anchor);
-        $permalink.href = $permalink.dataset.permalink + anchor;
-        if (start !== 0) activateLines(start, end);
-    });
-}
-if (navigator.clipboard && navigator.clipboard.writeText) {
-    $copyButton.innerText = $copyIcon;
-    $copyButton.classList.remove("hidden");
-}
-$copyButton.addEventListener("click", () => {
-    navigator.clipboard.writeText($code);
-    $copyButton.innerText = $copiedIcon;
-    setTimeout(() => {
-        $copyButton.innerText = $copyIcon;
-    }, 1000);
-});
-
-function activateLines(start, end) {
-    if (end < start) end = start;
-    for (let idx = start - 1; idx < end; idx++) {
-        $codeLines[idx].classList.add("active");
-    }
-}
-
-function deactivateLines() {
-    for (let code of $codeLines) {
-        code.classList.remove("active");
-    }
-}
D internal/html/repo_search.js
1
2
3
4
5
6
7
8
diff --git a/internal/html/repo_search.js b/internal/html/repo_search.js
deleted file mode 100644
index 5a9e6ecfde9e42236689ce796a79185549d9e548..0000000000000000000000000000000000000000
--- a/internal/html/repo_search.js
+++ /dev/null
@@ -1,2 +0,0 @@
-const search = new URLSearchParams(window.location.search).get("q");
-if (search !== "") document.querySelector("#search").value = search;