You can now go back to config by typeing cnf

This commit is contained in:
2021-04-05 17:29:25 +02:00
parent 866436fa82
commit 9135090e73
5 changed files with 56 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
<script>
import { apikey, api_endpoint, lang, page } from "./store.js";
import { apikey, api_endpoint, lang, page, clear } from "./store.js";
import { addMessages, init } from "svelte-i18n";
import en from "./locales/en.json";
import de from "./locales/de.json";
@@ -17,6 +17,37 @@
fallbackLocale: "en-US",
initialLocale: $lang,
});
$: command = "";
(() => {
document.onkeydown = (e) => {
e = e || window.event;
if (e.key === "Escape") {
modal_open = false;
}
if (e.keyCode === 13) {
if (createbtnenabled === true) {
createbtnenabled = false;
submit();
}
}
if(command ==="" && e.key === "c")
{
command="c";
}
else if(command ==="c" && e.key === "n"){
command+="n";
}
else if(command ==="cn" && e.key === "f"){
clear();
settings_open = true;
is_configured = true;
command = ""
}
else{
command="";
}
};
})();
console.log("app started with base url " + $api_endpoint);
</script>

View File

@@ -42,7 +42,7 @@
<div class="flex justify-center md:justify-start pt-12 md:pl-12 md:-mb-24">
<div class="bg-black text-white font-bold text-xl p-4">
<img src="./favicon.png" alt="" style="height: 3rem;display: inline;" />
LfK!Beamershow
LfK! Beamershow
</div>
</div>

View File

@@ -25,3 +25,9 @@ export const lang = writable(stored_lang);
lang.subscribe((value) => {
localStorage.setItem('lang', value);
});
export function clear(){
api_endpoint.set(null)
apikey.set(null);
localStorage.clear();
}