From 6afb792b7703e4dc601b65b39b8c3382ac26c656 Mon Sep 17 00:00:00 2001 From: Reimar Date: Mon, 4 Dec 2023 18:16:46 +0100 Subject: [PATCH] Initial commit --- example.html | 23 +++++++++++++++++++++++ window-status.js | 27 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 example.html create mode 100644 window-status.js 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; +});