Skip to content

Commit c80f83f

Browse files
Update misc.js
1 parent c46c581 commit c80f83f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

static/misc.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Why do I keep these here anymore??
12
window.gebid = document.getElementById.bind(document);
23
window.qsel = document.querySelector.bind(document);
34
window.qselall = document.querySelectorAll.bind(document);
@@ -10,7 +11,10 @@ function fillEntirePage() {
1011
});
1112
}
1213

14+
//---------------------------------------------------------------------------------------------------------------
15+
1316
(function () {
17+
if (/armdroid/.test(location.pathname)) return; // The Armdroid site is its own sub thing so ignore it
1418
// Dark mode hack
1519
var dmmq = window.matchMedia('(prefers-color-scheme: dark)');
1620
var icon = document.querySelector('link[rel="icon"]');
@@ -37,13 +41,13 @@ function fillEntirePage() {
3741
dmmq.addEventListener('change', updateThemedStuff);
3842
})();
3943

44+
//--------------------------------------------------------------------------------------------------------
45+
4046
(function () {
4147
// Images click
4248
for (var image of document.querySelectorAll("img[src]")) {
43-
var a = document.createElement("a");
44-
a.setAttribute("target", "_blank");
45-
a.setAttribute("href", image.getAttribute("src"));
46-
image.parentNode.insertBefore(a, image);
47-
a.append(image);
49+
image.addEventListener('click', function() {
50+
window.open(this.getAttribute('src'), '_blank');
51+
});
4852
}
4953
})();

0 commit comments

Comments
 (0)