Added empty <div> and set stylesheet on Setup(),

Added an empty <div> to mitigate merge conflicts. Running GetSettings in Setup so that the webpage CSS is set up whenever the website runs for the first time and not just when the settings get opened. This shouldn't cause any issues even though setup is called a few times throughout the code.
This commit is contained in:
db-2001 2023-10-27 10:48:08 -04:00
parent 5abebcf3b5
commit 15d20a236b
2 changed files with 17 additions and 0 deletions

View File

@ -90,6 +90,9 @@
<span class="title">LunaSea</span>
<div>Configured: <span id="lunaseaConfigured">✅❌</span></div>
<label for="lunaseaWebhook"></label><input placeholder="device/:id or user/:id" id="lunaseaWebhook" type="text">
</div>
<div>
</div>
<div>
<input type="checkbox" id="mangaHoverCheckbox" name="css-style" value="style_mangahover.css">

View File

@ -78,6 +78,19 @@ function Setup(){
ResetContent();
UpdateJobs();
GetSettings().then((json) => {
console.log(json);
settingDownloadLocation.innerText = json.downloadLocation;
settingApiUri.placeholder = apiUri;
console.log(json.styleSheet);
if (json.styleSheet == 'default') {
settingMangaHoverCheckbox.checked = false;
document.getElementById('pagestyle').setAttribute('href', 'styles/style_default.css');
} else {
settingMangaHoverCheckbox.checked = true;
document.getElementById('pagestyle').setAttribute('href', 'styles/style_mangahover.css');
}
});
setInterval(() => {
UpdateJobs();
}, 1000);
@ -278,6 +291,7 @@ function OpenSettings(){
//console.log(json);
settingDownloadLocation.innerText = json.downloadLocation;
settingApiUri.placeholder = apiUri;
console.log(json.styleSheet);
if (json.styleSheet == 'default') {
settingMangaHoverCheckbox.checked = false;
document.getElementById('pagestyle').setAttribute('href', 'styles/style_default.css');