aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_fullscreen.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-13 17:14:01 +0200
committerGitHub <noreply@github.com>2021-08-13 17:14:01 +0200
commita3104b69bc8153eed684f54e4249c84a6559182f (patch)
treee012e3c33ec9325e904fa2a1da1a018136bd1b0c /views/script/core_fullscreen.js
parent6ef10184a21592fe415a909e549f813ae53273f3 (diff)
parent2fcdada6864751ec708ace9ccd8c28d6d99aab06 (diff)
downloadkartik-client-a3104b69bc8153eed684f54e4249c84a6559182f.tar.gz
kartik-client-a3104b69bc8153eed684f54e4249c84a6559182f.tar.bz2
kartik-client-a3104b69bc8153eed684f54e4249c84a6559182f.zip
Merge pull request #6 from Minteck/testing
New loading screen
Diffstat (limited to 'views/script/core_fullscreen.js')
-rw-r--r--views/script/core_fullscreen.js60
1 files changed, 31 insertions, 29 deletions
diff --git a/views/script/core_fullscreen.js b/views/script/core_fullscreen.js
index f2c540d..d45cccf 100644
--- a/views/script/core_fullscreen.js
+++ b/views/script/core_fullscreen.js
@@ -1,40 +1,42 @@
window.addEventListener("load", () => {
require('@electron/remote').getCurrentWindow().show();
- const Nest = require("./nest/abi");
+ if (location.hash === "#ready") {
+ const Nest = require("./nest/abi");
- $(document).keydown(function(e) {
- if (e.keyCode === 122 || e.keyCode === 121 || e.keyCode === 112) { // F11/F1/F10
- if (!require('@electron/remote').getCurrentWindow().fullScreen && require('@electron/remote').getCurrentWindow().fullScreenable) {
- require('@electron/remote').getCurrentWindow().setFullScreen(true);
- } else {
- require('@electron/remote').getCurrentWindow().setFullScreen(false);
+ $(document).keydown(function(e) {
+ if (e.keyCode === 122 || e.keyCode === 121 || e.keyCode === 112) { // F11/F1/F10
+ if (!require('@electron/remote').getCurrentWindow().fullScreen && require('@electron/remote').getCurrentWindow().fullScreenable) {
+ require('@electron/remote').getCurrentWindow().setFullScreen(true);
+ } else {
+ require('@electron/remote').getCurrentWindow().setFullScreen(false);
+ }
}
- }
- })
+ })
- $(document).keydown(function(e) {
- currentNest = Nest.load(homedir + "/.kartik/current.kfn");
+ $(document).keydown(function(e) {
+ currentNest = Nest.load(homedir + "/.kartik/current.kfn");
- if (e.keyCode === 122 || e.keyCode === 121 || e.keyCode === 112) {
- if (currentNest.config.fullscreen) {
- currentNest.config.fullscreen = false;
- Nest.export(homedir + "/.kartik/current.kfn", currentNest);
- require('electron').ipcRenderer.send("reloadNest")
- } else {
- currentNest.config.fullscreen = true;
- Nest.export(homedir + "/.kartik/current.kfn", currentNest);
- require('electron').ipcRenderer.send("reloadNest");
+ if (e.keyCode === 122 || e.keyCode === 121 || e.keyCode === 112) {
+ if (currentNest.config.fullscreen) {
+ currentNest.config.fullscreen = false;
+ Nest.export(homedir + "/.kartik/current.kfn", currentNest);
+ require('electron').ipcRenderer.send("reloadNest")
+ } else {
+ currentNest.config.fullscreen = true;
+ Nest.export(homedir + "/.kartik/current.kfn", currentNest);
+ require('electron').ipcRenderer.send("reloadNest");
+ }
}
- }
- })
+ })
- currentNest = Nest.load(homedir + "/.kartik/current.kfn");
- if (currentNest.config.fullscreen) {
- require('@electron/remote').getCurrentWindow().setFullScreen(true);
- } else {
- currentNest.config.fullscreen = false;
- Nest.export(homedir + "/.kartik/current.kfn", currentNest);
- require('electron').ipcRenderer.send("reloadNest")
+ currentNest = Nest.load(homedir + "/.kartik/current.kfn");
+ if (currentNest.config.fullscreen) {
+ require('@electron/remote').getCurrentWindow().setFullScreen(true);
+ } else {
+ currentNest.config.fullscreen = false;
+ Nest.export(homedir + "/.kartik/current.kfn", currentNest);
+ require('electron').ipcRenderer.send("reloadNest")
+ }
}
}) \ No newline at end of file