diff --git a/css/tooltip.css b/css/tooltip.css
index fc92a1d..c6a193c 100644
--- a/css/tooltip.css
+++ b/css/tooltip.css
@@ -22,15 +22,17 @@
}
.tooltip.below .content {
- top: 2.5rem;
- left: 0;
+ top: calc(100% + 0.125rem);
+ left: 50%;
right: 0;
+ transform: translateX(-50%);
}
.tooltip.above .content {
- bottom: 2.5rem;
- left: 0;
+ bottom: calc(100% + 0.125rem);
+ left: 50%;
right: 0;
+ transform: translateX(-50%);
}
.tooltip.darker .content {
diff --git a/html/admin.html b/html/admin.html
index fddb5c8..c8869a6 100644
--- a/html/admin.html
+++ b/html/admin.html
@@ -921,7 +921,6 @@
-
{{ .strings.aboutProgram }}
{{ .strings.wiki }}
diff --git a/lang/admin/en-us.json b/lang/admin/en-us.json
index 65e0244..30fc673 100644
--- a/lang/admin/en-us.json
+++ b/lang/admin/en-us.json
@@ -209,7 +209,9 @@
"backupCanBeFound": "The backup can be found on the server at {filepath}.",
"backupCanDownload": "Alternatively, click below to download the backup.",
"wikiPage": "Wiki Page",
- "wiki": "Wiki"
+ "wiki": "Wiki",
+ "restartRequired": "Restart required",
+ "required": "Required"
},
"notifications": {
"pathCopied": "Full path copied to clipboard.",
diff --git a/ts/modules/settings.ts b/ts/modules/settings.ts
index 2370a68..ea53477 100644
--- a/ts/modules/settings.ts
+++ b/ts/modules/settings.ts
@@ -74,6 +74,9 @@ const splitDependant = (section: string, dep: string): string[] => {
return parts
};
+let RestartRequiredBadge: HTMLElement;
+let RequiredBadge: HTMLElement;
+
class DOMSetting {
protected _hideEl: HTMLElement;
protected _input: HTMLInputElement;
@@ -133,12 +136,10 @@ class DOMSetting {
set required(state: boolean) {
if (state) {
this._required.classList.remove("unfocused");
- this._required.classList.add("badge", "~critical");
- this._required.textContent = "*";
+ this._required.innerHTML = RequiredBadge.outerHTML;
} else {
this._required.classList.add("unfocused");
- this._required.classList.remove("badge", "~critical");
- this._required.textContent = "";
+ this._required.textContent = ``;
}
}
@@ -146,12 +147,10 @@ class DOMSetting {
set requires_restart(state: boolean) {
if (state) {
this._restart.classList.remove("unfocused");
- this._restart.classList.add("badge", "~info", "dark:~d_warning");
- this._restart.textContent = "R";
+ this._restart.innerHTML = RestartRequiredBadge.outerHTML;
} else {
this._restart.classList.add("unfocused");
- this._restart.classList.remove("badge", "~info", "dark:~d_warning");
- this._restart.textContent = "";
+ this._restart.textContent = ``;
}
}
@@ -619,7 +618,7 @@ class groupButton {
this._button.innerHTML = `
`;
@@ -1072,14 +1071,28 @@ export class settingsList {
this._searchbox.oninput(null);
};
};
+
+ // Create (restart)required badges (can't do on load as window.lang is unset)
+ RestartRequiredBadge = (() => {
+ const rr = document.createElement("span");
+ rr.classList.add("tooltip", "below");
+ rr.innerHTML = `
+
+
${window.lang.strings("restartRequired")}
+ `;
- // What possessed me to put this in the DOMSelect constructor originally? like what????????
- const message = document.getElementById("settings-message") as HTMLElement;
- message.innerHTML = window.lang.var("strings",
- "settingsRequiredOrRestartMessage",
- `
*`,
- `
R`
- );
+ return rr;
+ })();
+ RequiredBadge = (() => {
+ const r = document.createElement("span");
+ r.classList.add("tooltip", "below");
+ r.innerHTML = `
+
+
${window.lang.strings("required")}
+ `;
+
+ return r;
+ })();
}
private _addMatrix = () => {