From 8c8f134968fe86fa201983c59cacdac619b729d6 Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Sat, 17 May 2025 06:48:58 +1000 Subject: [PATCH] Added a basic settings page to many widgets --- clock-widget/settings/index.html | 29 +++++++++++++++++++ clock-widget/settings/script.js | 23 +++++++++++++++ clock-widget/settings/settings.json | 20 +++++++++++++ obs-info-hud/settings/index.html | 29 +++++++++++++++++++ obs-info-hud/settings/script.js | 23 +++++++++++++++ obs-info-hud/settings/settings.json | 20 +++++++++++++ scumbag-sub-goal-widget/settings/index.html | 29 +++++++++++++++++++ scumbag-sub-goal-widget/settings/script.js | 23 +++++++++++++++ .../settings/settings.json | 20 +++++++++++++ simple-twitch-metrics/settings/index.html | 29 +++++++++++++++++++ simple-twitch-metrics/settings/script.js | 23 +++++++++++++++ simple-twitch-metrics/settings/settings.json | 20 +++++++++++++ twitch-ad-timer/settings/index.html | 29 +++++++++++++++++++ twitch-ad-timer/settings/script.js | 23 +++++++++++++++ twitch-ad-timer/settings/settings.json | 20 +++++++++++++ twitch-uptime-widget/settings/index.html | 29 +++++++++++++++++++ twitch-uptime-widget/settings/script.js | 23 +++++++++++++++ twitch-uptime-widget/settings/settings.json | 20 +++++++++++++ 18 files changed, 432 insertions(+) create mode 100644 clock-widget/settings/index.html create mode 100644 clock-widget/settings/script.js create mode 100644 clock-widget/settings/settings.json create mode 100644 obs-info-hud/settings/index.html create mode 100644 obs-info-hud/settings/script.js create mode 100644 obs-info-hud/settings/settings.json create mode 100644 scumbag-sub-goal-widget/settings/index.html create mode 100644 scumbag-sub-goal-widget/settings/script.js create mode 100644 scumbag-sub-goal-widget/settings/settings.json create mode 100644 simple-twitch-metrics/settings/index.html create mode 100644 simple-twitch-metrics/settings/script.js create mode 100644 simple-twitch-metrics/settings/settings.json create mode 100644 twitch-ad-timer/settings/index.html create mode 100644 twitch-ad-timer/settings/script.js create mode 100644 twitch-ad-timer/settings/settings.json create mode 100644 twitch-uptime-widget/settings/index.html create mode 100644 twitch-uptime-widget/settings/script.js create mode 100644 twitch-uptime-widget/settings/settings.json diff --git a/clock-widget/settings/index.html b/clock-widget/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/clock-widget/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/clock-widget/settings/script.js b/clock-widget/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/clock-widget/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/clock-widget/settings/settings.json b/clock-widget/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/clock-widget/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file diff --git a/obs-info-hud/settings/index.html b/obs-info-hud/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/obs-info-hud/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/obs-info-hud/settings/script.js b/obs-info-hud/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/obs-info-hud/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/obs-info-hud/settings/settings.json b/obs-info-hud/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/obs-info-hud/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file diff --git a/scumbag-sub-goal-widget/settings/index.html b/scumbag-sub-goal-widget/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/scumbag-sub-goal-widget/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/scumbag-sub-goal-widget/settings/script.js b/scumbag-sub-goal-widget/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/scumbag-sub-goal-widget/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/scumbag-sub-goal-widget/settings/settings.json b/scumbag-sub-goal-widget/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/scumbag-sub-goal-widget/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file diff --git a/simple-twitch-metrics/settings/index.html b/simple-twitch-metrics/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/simple-twitch-metrics/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/simple-twitch-metrics/settings/script.js b/simple-twitch-metrics/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/simple-twitch-metrics/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/simple-twitch-metrics/settings/settings.json b/simple-twitch-metrics/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/simple-twitch-metrics/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file diff --git a/twitch-ad-timer/settings/index.html b/twitch-ad-timer/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/twitch-ad-timer/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/twitch-ad-timer/settings/script.js b/twitch-ad-timer/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/twitch-ad-timer/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/twitch-ad-timer/settings/settings.json b/twitch-ad-timer/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/twitch-ad-timer/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file diff --git a/twitch-uptime-widget/settings/index.html b/twitch-uptime-widget/settings/index.html new file mode 100644 index 0000000..43a257f --- /dev/null +++ b/twitch-uptime-widget/settings/index.html @@ -0,0 +1,29 @@ + + + + + + + + nutty + + + + + + + + + \ No newline at end of file diff --git a/twitch-uptime-widget/settings/script.js b/twitch-uptime-widget/settings/script.js new file mode 100644 index 0000000..5372060 --- /dev/null +++ b/twitch-uptime-widget/settings/script.js @@ -0,0 +1,23 @@ +const widgetContainer = document.getElementById('widgetContainer'); + +const settingsPageURL = '../../.utilities/settings-page-builder'; + +const currentURL = window.location.href; + +let settingsJSON; +let baseURL = currentURL; + +if (baseURL.endsWith("index.html")) + baseURL = baseURL.replace("index.html", ""); + +settingsJSON = "?settingsJson=" + baseURL + "settings.json"; + +const lastSlashIndex = baseURL.lastIndexOf("/"); +let widgetURL = "&widgetURL=" + baseURL.replace("/settings", ""); + +console.debug("Window Ref: " + window.location.href); +console.debug("Base URL: " + baseURL); +console.debug("Settings JSON: " + settingsJSON); +console.debug("Widget URL: " + widgetURL); + +widgetContainer.src = settingsPageURL + settingsJSON + widgetURL; \ No newline at end of file diff --git a/twitch-uptime-widget/settings/settings.json b/twitch-uptime-widget/settings/settings.json new file mode 100644 index 0000000..888bd57 --- /dev/null +++ b/twitch-uptime-widget/settings/settings.json @@ -0,0 +1,20 @@ +{ + "settings": [ + { + "id": "address", + "label": "Address", + "description": "Streamer.bot Websocket Server Address", + "type": "text", + "defaultValue": "127.0.0.1", + "group": "Advanced" + }, + { + "id": "port", + "label": "Port", + "description": "Streamer.bot Websocket Server Port", + "type": "text", + "defaultValue": "8080", + "group": "Advanced" + } + ] +} \ No newline at end of file