mirror of
https://github.com/zoriya/EAU.git
synced 2025-12-05 22:26:14 +00:00
Saving dark-mode into the config json.
This commit is contained in:
14
dist/html/fragments/settings.html
vendored
14
dist/html/fragments/settings.html
vendored
@@ -48,18 +48,4 @@
|
||||
|
||||
shell.openExternal(event.currentTarget.href);
|
||||
});
|
||||
|
||||
if($("#body").hasClass("dark-mode"))
|
||||
{
|
||||
$(".switch").find("input[type=checkbox]").prop("checked", true);
|
||||
}
|
||||
|
||||
$(".switch").find("input[type=checkbox]").on("change",function() {
|
||||
var checked = $(this).prop("checked");
|
||||
|
||||
if(checked)
|
||||
$("#body").addClass("dark-mode");
|
||||
else
|
||||
$("#body").removeClass("dark-mode");
|
||||
});
|
||||
</script>
|
||||
|
||||
1
dist/html/index.html
vendored
1
dist/html/index.html
vendored
@@ -13,6 +13,7 @@
|
||||
|
||||
<script src="../js/electron-specific.js"></script> <!--Using this script because electrons scripts cant be compiled-->
|
||||
<script src="../js/index.js"></script>
|
||||
|
||||
</head>
|
||||
<body id="body">
|
||||
<header style="height: 56px;">
|
||||
|
||||
4
dist/js/index.js
vendored
4
dist/js/index.js
vendored
File diff suppressed because one or more lines are too long
2
main.js
2
main.js
@@ -67,7 +67,7 @@ function handleArgs(arg)
|
||||
{
|
||||
var token = arg.substring(arg.lastIndexOf("id/") + 3);
|
||||
log.log("Token: " + token);
|
||||
var store = new Store("account");
|
||||
var store = new Store("config");
|
||||
store.set("steam", token);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Game, launcher } from "./Game";
|
||||
|
||||
export function LoadGames(): Game[]
|
||||
{
|
||||
const Store = require("../js/store");
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
var isElectron = userAgent.indexOf(" electron/") > -1;
|
||||
if (isElectron)
|
||||
|
||||
@@ -6,7 +6,7 @@ export function getSteamToken(): string
|
||||
if (isElectron)
|
||||
{
|
||||
const Store = require("../js/store");
|
||||
const tknStore = new Store("account");
|
||||
const tknStore = new Store("config");
|
||||
const tkn = tknStore.get("steam");
|
||||
return tkn != null ? tkn : "76561198196430655";
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
// import $ from "jquery"; //Using global scope jquery instead beacause it make a huge file if we use this.
|
||||
import { setup } from "./Carousel";
|
||||
import { populateGrid } from "./Library"
|
||||
const Store = require("../js/store");
|
||||
|
||||
|
||||
$(function ()
|
||||
{
|
||||
const config = new Store("config");
|
||||
if(config.get("dark-mode"))
|
||||
{
|
||||
$("#body").addClass("dark-mode");
|
||||
}
|
||||
|
||||
home();
|
||||
|
||||
document.getElementById("title").onclick = () => { home() };
|
||||
@@ -32,8 +40,21 @@ function openSearch()
|
||||
function openSettings()
|
||||
{
|
||||
$("#content").load("fragments/settings.html", () =>
|
||||
{
|
||||
{
|
||||
$(".switch").find("input[type=checkbox]").on("change",function() {
|
||||
var checked = $(this).prop("checked");
|
||||
|
||||
if(checked)
|
||||
$("#body").addClass("dark-mode");
|
||||
else
|
||||
$("#body").removeClass("dark-mode");
|
||||
|
||||
const store = new Store("config");
|
||||
store.set("dark-mode", checked);
|
||||
});
|
||||
|
||||
if($("#body").hasClass("dark-mode"))
|
||||
$(".switch").find("input[type=checkbox]").prop("checked", true);
|
||||
});
|
||||
document.getElementById("title").innerHTML = "<i class='icon fas fa-arrow-left'></i> Settings";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user