From 829ffa18a6c7b3d8875f26d970a93aecb8bebbfa Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 26 May 2024 10:39:36 +0200 Subject: [PATCH] Added exit btn - Updated credits - Updated version - Removed log file - Updated app key --- neutralino.config.json | 18 +++++++++--------- src/index.js | 12 ++++++++---- src/views/about/about.html | 2 ++ src/views/home/home.html | 5 +++++ src/views/home/home.js | 4 ++++ 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/neutralino.config.json b/neutralino.config.json index 5f18858..09f81b0 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json", - "applicationId": "js.neutralino.sample", - "version": "1.0.0", + "applicationId": "de.walzen665.clearapp", + "version": "1.0.1", "defaultMode": "window", "port": 0, "documentRoot": "/src/", @@ -10,8 +10,8 @@ "enableNativeAPI": true, "tokenSecurity": "one-time", "logging": { - "enabled": true, - "writeToLogFile": true + "enabled": false, + "writeToLogFile": false }, "nativeAllowList": [ "app.*", @@ -34,18 +34,18 @@ }, "modes": { "window": { - "title": "clearapp", - "width": 800, - "height": 500, + "title": "Cooperate Cleaner", + "width": 1920, + "height": 1080, "minWidth": 400, "minHeight": 200, "center": true, "fullScreen": false, "alwaysOnTop": false, "icon": "/src/icons/appIcon.png", - "enableInspector": true, + "enableInspector": false, "borderless": false, - "maximize": false, + "maximize": true, "hidden": false, "resizable": true, "exitProcessOnClose": false diff --git a/src/index.js b/src/index.js index e2c7ad9..7bc4026 100644 --- a/src/index.js +++ b/src/index.js @@ -20,15 +20,19 @@ $(document).ready(async function() { // Enable window close event await Neutralino.events.on('windowClose', async () => { - console.log('Window close event received.') - let data = window.localStorage.getItem('config'); - await Neutralino.storage.setData('config', data); - Neutralino.app.exit(); + quit(); }); await initStorage(); }); +async function quit() { + console.log('Window close event received.') + let data = window.localStorage.getItem('config'); + await Neutralino.storage.setData('config', data); + Neutralino.app.exit(); +} + function loadView(view) { $("#content").fadeOut(200, function() { const viewPath = `views/${view}/${view}`; diff --git a/src/views/about/about.html b/src/views/about/about.html index 38b319c..7cc2fd1 100644 --- a/src/views/about/about.html +++ b/src/views/about/about.html @@ -15,6 +15,8 @@

Using jQuery

Using animate.css

Build with NeutralinoJS

+

Using Bootstrap icons

+

All visible images/graphics are generated using DALL-E3 by OpenAI

MIT License

diff --git a/src/views/home/home.html b/src/views/home/home.html index e63af0d..09bfba8 100644 --- a/src/views/home/home.html +++ b/src/views/home/home.html @@ -34,6 +34,11 @@ +

+
+ +
+
diff --git a/src/views/home/home.js b/src/views/home/home.js index 3ae6f6a..c3748b9 100644 --- a/src/views/home/home.js +++ b/src/views/home/home.js @@ -16,4 +16,8 @@ function init(){ console.log("About button clicked"); loadView("about"); }); + $("#exit-btn").click(function(){ + console.log("Quit button clicked"); + quit(); + }); } \ No newline at end of file