Add files via upload

This commit is contained in:
nuttylmao
2025-03-23 22:04:07 +11:00
committed by GitHub
parent f133722899
commit 6c53d973f7
97 changed files with 15625 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
let settingsContainer = document.getElementById('settings-container');
settingsContainer.src = `https://nuttylmao.github.io/widget-customizer?settingsJson=${window.location.href}/settings.json`
console.log(settingsContainer.src);
function reloadWidget(data) {
let widget = document.getElementById("widget");
widget.src = `${getParentUrl()}?${data}`;
}
function getParentUrl() {
const currentUrl = window.location.href;
const urlParts = currentUrl.split('/');
// Remove the last part of the URL (the current page/file)
urlParts.pop();
// Remove the last part again to go one directory up
urlParts.pop();
// Reconstruct the URL
const parentUrl = urlParts.join('/');
// Ensure there's a trailing slash if necessary (if it was a directory)
if (urlParts.length > 2 && !parentUrl.endsWith('/')) {
return parentUrl + '/';
}
return parentUrl;
}