mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-03-18 21:50:33 +01:00
settings: remove badge note, add tooltips to them
change required and restart required badges to icons with tooltips, and removed the note at the top of settings. As a result, the sidebar is much thinner.
This commit is contained in:
@@ -22,15 +22,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.below .content {
|
.tooltip.below .content {
|
||||||
top: 2.5rem;
|
top: calc(100% + 0.125rem);
|
||||||
left: 0;
|
left: 50%;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.above .content {
|
.tooltip.above .content {
|
||||||
bottom: 2.5rem;
|
bottom: calc(100% + 0.125rem);
|
||||||
left: 0;
|
left: 50%;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip.darker .content {
|
.tooltip.darker .content {
|
||||||
|
|||||||
@@ -921,7 +921,6 @@
|
|||||||
<input type="search" class="field ~neutral @low input settings-section-button justify-between" id="settings-search" placeholder="{{ .strings.search }}">
|
<input type="search" class="field ~neutral @low input settings-section-button justify-between" id="settings-search" placeholder="{{ .strings.search }}">
|
||||||
<button class="button ~neutral @low center -ml-10 rounded-s-none settings-search-clear" aria-label="{{ .strings.clearSearch }}" text="{{ .strings.clearSearch }}"><i class="ri-close-line"></i></button>
|
<button class="button ~neutral @low center -ml-10 rounded-s-none settings-search-clear" aria-label="{{ .strings.clearSearch }}" text="{{ .strings.clearSearch }}"><i class="ri-close-line"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<aside class="aside sm ~urge dark:~d_info @low" id="settings-message">Note: <span class="badge ~critical">*</span> indicates a required field, <span class="badge ~info dark:~d_warning">R</span> indicates changes require a restart.</aside>
|
|
||||||
<div id="settings-loader" class="flex flex-row flex-wrap gap-2">
|
<div id="settings-loader" class="flex flex-row flex-wrap gap-2">
|
||||||
<span class="button ~neutral @low justify-center grow" id="setting-about"><span class="flex">{{ .strings.aboutProgram }} <i class="ri-information-line ml-2"></i></span></span>
|
<span class="button ~neutral @low justify-center grow" id="setting-about"><span class="flex">{{ .strings.aboutProgram }} <i class="ri-information-line ml-2"></i></span></span>
|
||||||
<a class="button ~urge dark:~d_info @low justify-center grow" target="_blank" href="https://wiki.jfa-go.com"><span class="flex">{{ .strings.wiki }} <i class="ri-book-shelf-line ml-2"></i></a>
|
<a class="button ~urge dark:~d_info @low justify-center grow" target="_blank" href="https://wiki.jfa-go.com"><span class="flex">{{ .strings.wiki }} <i class="ri-book-shelf-line ml-2"></i></a>
|
||||||
|
|||||||
@@ -209,7 +209,9 @@
|
|||||||
"backupCanBeFound": "The backup can be found on the server at {filepath}.",
|
"backupCanBeFound": "The backup can be found on the server at {filepath}.",
|
||||||
"backupCanDownload": "Alternatively, click below to download the backup.",
|
"backupCanDownload": "Alternatively, click below to download the backup.",
|
||||||
"wikiPage": "Wiki Page",
|
"wikiPage": "Wiki Page",
|
||||||
"wiki": "Wiki"
|
"wiki": "Wiki",
|
||||||
|
"restartRequired": "Restart required",
|
||||||
|
"required": "Required"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"pathCopied": "Full path copied to clipboard.",
|
"pathCopied": "Full path copied to clipboard.",
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ const splitDependant = (section: string, dep: string): string[] => {
|
|||||||
return parts
|
return parts
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let RestartRequiredBadge: HTMLElement;
|
||||||
|
let RequiredBadge: HTMLElement;
|
||||||
|
|
||||||
class DOMSetting {
|
class DOMSetting {
|
||||||
protected _hideEl: HTMLElement;
|
protected _hideEl: HTMLElement;
|
||||||
protected _input: HTMLInputElement;
|
protected _input: HTMLInputElement;
|
||||||
@@ -133,12 +136,10 @@ class DOMSetting {
|
|||||||
set required(state: boolean) {
|
set required(state: boolean) {
|
||||||
if (state) {
|
if (state) {
|
||||||
this._required.classList.remove("unfocused");
|
this._required.classList.remove("unfocused");
|
||||||
this._required.classList.add("badge", "~critical");
|
this._required.innerHTML = RequiredBadge.outerHTML;
|
||||||
this._required.textContent = "*";
|
|
||||||
} else {
|
} else {
|
||||||
this._required.classList.add("unfocused");
|
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) {
|
set requires_restart(state: boolean) {
|
||||||
if (state) {
|
if (state) {
|
||||||
this._restart.classList.remove("unfocused");
|
this._restart.classList.remove("unfocused");
|
||||||
this._restart.classList.add("badge", "~info", "dark:~d_warning");
|
this._restart.innerHTML = RestartRequiredBadge.outerHTML;
|
||||||
this._restart.textContent = "R";
|
|
||||||
} else {
|
} else {
|
||||||
this._restart.classList.add("unfocused");
|
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 = `
|
this._button.innerHTML = `
|
||||||
<span class="group-button-name"></span>
|
<span class="group-button-name"></span>
|
||||||
<label>
|
<label>
|
||||||
<i class="icon ri-arrow-down-s-line"></i>
|
<i class="icon ri-arrow-down-s-line text-xl"></i>
|
||||||
<input class="unfocused" type="checkbox">
|
<input class="unfocused" type="checkbox">
|
||||||
</label>
|
</label>
|
||||||
`;
|
`;
|
||||||
@@ -1072,14 +1071,28 @@ export class settingsList {
|
|||||||
this._searchbox.oninput(null);
|
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 = `
|
||||||
|
<span class="badge ~info dark:~d_warning"><i class="icon ri-refresh-line align-baseline h-full"></i></span>
|
||||||
|
<span class="content sm">${window.lang.strings("restartRequired")}</span>
|
||||||
|
`;
|
||||||
|
|
||||||
// What possessed me to put this in the DOMSelect constructor originally? like what????????
|
return rr;
|
||||||
const message = document.getElementById("settings-message") as HTMLElement;
|
})();
|
||||||
message.innerHTML = window.lang.var("strings",
|
RequiredBadge = (() => {
|
||||||
"settingsRequiredOrRestartMessage",
|
const r = document.createElement("span");
|
||||||
`<span class="badge ~critical">*</span>`,
|
r.classList.add("tooltip", "below");
|
||||||
`<span class="badge ~info dark:~d_warning">R</span>`
|
r.innerHTML = `
|
||||||
);
|
<span class="badge ~critical"><i class="icon ri-asterisk align-baseline h-full"></i></span>
|
||||||
|
<span class="content sm">${window.lang.strings("required")}</span>
|
||||||
|
`;
|
||||||
|
|
||||||
|
return r;
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _addMatrix = () => {
|
private _addMatrix = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user