mirror of
https://github.com/khairul169/honey.git
synced 2026-10-04 18:03:54 +07:00
More overall improvements
This commit is contained in:
@@ -63,7 +63,7 @@ function get_bool(key) {
|
||||
}
|
||||
|
||||
function load_config(conf) {
|
||||
CONFIG = JSON.parse(conf);
|
||||
if (conf) CONFIG = JSON.parse(conf);
|
||||
let ui = CONFIG.ui;
|
||||
set("app-name", ui.name);
|
||||
set("app-desc", ui.desc);
|
||||
@@ -71,4 +71,13 @@ function load_config(conf) {
|
||||
if (ui.hosted_by) set("app-hostedby", ui.hosted_by);
|
||||
else get("app-hostedby").parentNode.style.display = "none";
|
||||
load_apps();
|
||||
switch_theme(get_bool("dark_mode"));
|
||||
new_tab_toggle(get_bool("open_new_tab"));
|
||||
}
|
||||
|
||||
function is_secure(uri) {
|
||||
if (uri.includes("tp://")) return false;
|
||||
if (!uri.startsWith("https://")) {
|
||||
uri = location.href;
|
||||
}
|
||||
}
|
||||
+9
-4
@@ -6,7 +6,6 @@ function onload() {
|
||||
for_all("back", (btn) => {
|
||||
btn.onclick = show;
|
||||
});
|
||||
switch_theme(config("dark_mode") == "true");
|
||||
setTimeout(() => {
|
||||
show();
|
||||
document.body.classList.remove("init");
|
||||
@@ -59,14 +58,20 @@ function load_apps() {
|
||||
get("applist").innerHTML = final;
|
||||
}
|
||||
|
||||
function new_tab_toggle(setting) {
|
||||
let v = !get_bool("open_new_tab");
|
||||
function new_tab_toggle(value) {
|
||||
let v = get_bool("open_new_tab");
|
||||
if (value === undefined) v = !v;
|
||||
config("open_new_tab", v);
|
||||
setting = setting.classList;
|
||||
setting = get("setting-newtab").classList;
|
||||
v ? setting.add("checked") : setting.remove("checked");
|
||||
load_apps();
|
||||
}
|
||||
|
||||
function reset_all_settings() {
|
||||
localStorage.clear();
|
||||
load_config();
|
||||
}
|
||||
|
||||
let S_TAP_LOCK;
|
||||
function open_screen(button) {
|
||||
if (S_TAP_LOCK) return;
|
||||
|
||||
Reference in New Issue
Block a user