commit 6afb792b7703e4dc601b65b39b8c3382ac26c656 Author: Reimar Date: Mon Dec 4 18:16:46 2023 +0100 Initial commit diff --git a/example.html b/example.html new file mode 100644 index 0000000..98a6c02 --- /dev/null +++ b/example.html @@ -0,0 +1,23 @@ + + + + + diff --git a/window-status.js b/window-status.js new file mode 100644 index 0000000..a60d838 --- /dev/null +++ b/window-status.js @@ -0,0 +1,27 @@ +var statusLink = document.createElement("a"); +with (statusLink) { + style.position = "fixed"; + style.top = "0"; + style.bottom = "0"; + style.left = "0"; + style.right = "0"; + style.cursor = "inherit"; + style.zIndex = "-100"; + + onclick = ondragstart = function(e) { + e.preventDefault(); + return false; + }; +} + +window.addEventListener("load", function() { + document.body.appendChild(statusLink); +}); + +window.__defineSetter__("status", function(value) { + // If value contains uppercase or special characters, it needs to be specified as the path in the URL or it won't show + if (value.match(/^[a-z]+$/)) + statusLink.href = "http://" + value; + else + statusLink.href = "http://./ " + value; +});