less_retarded_wiki/pimp_my_lrs.html

68 lines
1.8 KiB
HTML
Raw Permalink Normal View History

2024-01-29 23:38:34 +01:00
<!-- Fancy consoomer JavaScript version of LRS wiki, allows changing CSS. -->
<html>
<head>
<script>
let thisPage = "pimp_my_lrs.html";
let page = null;
let style = null;
function placeCSS(name, file)
{
var link = document.createElement("a");
link.href = thisPage + "?p=" + page + "&s=" + file;
2024-01-31 00:35:22 +01:00
link.innerHTML = "_" + name + "_";
2024-01-29 23:38:34 +01:00
var elem = document.getElementsByTagName("body")[0];
elem.prepend(link);
}
function load()
{
var url = new URL(window.location.href);
style = url.searchParams.get("s");
page = url.searchParams.get("p");
2024-01-30 07:54:47 +01:00
document.body.innerHTML = "";
2024-01-29 23:38:34 +01:00
var req = new XMLHttpRequest();
req.open("get",page);
req.send();
req.onload = function()
{
document.body.innerHTML =
req.response.toString().replaceAll(
/(<a[^>]*href=\")([^\"]*\.html)\"/g,"$1" + thisPage + "?p=$2&s=" + style + "\"");
2024-01-30 00:32:40 +01:00
var cl = document.getElementsByTagName('link')[0];
cl.parentNode.removeChild(cl);
2024-01-29 23:38:34 +01:00
2024-01-30 00:32:40 +01:00
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.media = "all";
link.href = style;
document.getElementsByTagName("head")[0].prepend(link);
var fl = document.getElementById("fancylink");
2024-01-29 23:38:34 +01:00
fl.href = "index.html";
fl.innerHTML = "chad version";
2024-01-30 19:43:23 +01:00
placeCSS("$$$","style_gold.css");
2024-01-30 07:54:47 +01:00
placeCSS("gay","style_gay.css");
2024-01-31 00:35:22 +01:00
placeCSS("lol","style_lol.css");
2024-01-30 09:10:10 +01:00
placeCSS("90s","style_90s.css");
2024-01-30 00:32:40 +01:00
placeCSS("unix","style_unix.css");
2024-02-17 23:25:58 +01:00
placeCSS("txt","style_txt.css");
2024-01-30 07:54:47 +01:00
placeCSS("dark","style_dark.css");
2024-01-29 23:38:34 +01:00
placeCSS("fancy","style_fancy.css");
placeCSS("plain","style.css");
};
}
</script>
</head>
<body onload="load()">
<p> u need javascript to consoom this site, wanna go <a href="index.html">back</a>? </p>
</body>
</html>