aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_fullscreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/script/core_fullscreen.js')
-rw-r--r--views/script/core_fullscreen.js43
1 files changed, 37 insertions, 6 deletions
diff --git a/views/script/core_fullscreen.js b/views/script/core_fullscreen.js
index 69f9e45..f2c540d 100644
--- a/views/script/core_fullscreen.js
+++ b/views/script/core_fullscreen.js
@@ -1,9 +1,40 @@
-$(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);
+window.addEventListener("load", () => {
+ require('@electron/remote').getCurrentWindow().show();
+
+ 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) {
+ 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");
+ }
+ }
+ })
+
+ 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