Update
[less_retarded_wiki.git] / pimp_my_lrs.html
blob3c4cb346eb45b9482ca516c9545f9880a56488a6
1 <!-- Fancy consoomer JavaScript version of LRS wiki, allows changing CSS. -->
2 <html>
3 <head>
4 <script>
5 let thisPage = "pimp_my_lrs.html";
6 let page = null;
7 let style = null;
9 function placeCSS(name, file)
11 var link = document.createElement("a");
12 link.href = thisPage + "?p=" + page + "&s=" + file;
13 link.innerHTML = "_" + name + "_";
14 var elem = document.getElementsByTagName("body")[0];
15 elem.prepend(link);
18 function load()
20 var url = new URL(window.location.href);
21 style = url.searchParams.get("s");
22 page = url.searchParams.get("p");
24 document.body.innerHTML = "";
26 var req = new XMLHttpRequest();
27 req.open("get",page);
28 req.send();
29 req.onload = function()
31 document.body.innerHTML =
32 req.response.toString().replaceAll(
33 /(<a[^>]*href=\")([^\"]*\.html)\"/g,"$1" + thisPage + "?p=$2&s=" + style + "\"");
35 var cl = document.getElementsByTagName('link')[0];
36 cl.parentNode.removeChild(cl);
38 var link = document.createElement("link");
39 link.rel = "stylesheet";
40 link.type = "text/css";
41 link.media = "all";
42 link.href = style;
43 document.getElementsByTagName("head")[0].prepend(link);
45 var fl = document.getElementById("fancylink");
46 fl.href = "index.html";
47 fl.innerHTML = "chad version";
49 placeCSS("$$$","style_gold.css");
50 placeCSS("gay","style_gay.css");
51 placeCSS("lol","style_lol.css");
52 placeCSS("90s","style_90s.css");
53 placeCSS("unix","style_unix.css");
54 placeCSS("txt","style_txt.css");
55 placeCSS("dark","style_dark.css");
56 placeCSS("fancy","style_fancy.css");
57 placeCSS("plain","style.css");
60 </script>
61 </head>
63 <body onload="load()">
64 <p> u need javascript to consoom this site, wanna go <a href="index.html">back</a>? </p>
65 </body>
67 </html>