Skip to content

Commit e2162e9

Browse files
committed
update structures
1 parent e6eb6b2 commit e2162e9

File tree

17 files changed

+269
-14
lines changed

17 files changed

+269
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/dist
1010

1111
# Neutralinojs client (minified)
12-
neutralino.js
12+
# neutralino.js
1313

1414
# Neutralinojs related files
1515
.storage

.tmp/auth_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"accessToken":"qZCvEnoqQDtNvTW0WU--IZj5eVrq51gycutshhi7xbXs43uc","port":33777}
1+
{"accessToken":"r9lvxokg_jWKc_qaaNjsCvMBDveRDq240q_zelfgVB07Csjo","port":33043}
File renamed without changes.

desktop-init/.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: shalithasuranga
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

desktop-init/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Developer tools' files
2+
.lite_workspace.lua
3+
4+
# Neutralinojs binaries and builds
5+
/bin
6+
/dist
7+
8+
# Neutralinojs client (minified)
9+
# neutralino.js
10+
11+
# Neutralinojs related files
12+
.storage
13+
*.log

desktop-init/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Neutralinojs and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

desktop-init/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# neutralinojs-minimal
2+
3+
The default template for a Neutralinojs app. It's possible to use your favorite frontend framework by using [these steps](https://neutralino.js.org/docs/how-to/use-a-frontend-library).
4+
5+
## Contributors
6+
7+
<a href="https://github.com/neutralinojs/neutralinojs-minimal/graphs/contributors">
8+
<img src="https://contrib.rocks/image?repo=neutralinojs/neutralinojs-minimal" />
9+
</a>
10+
11+
## License
12+
13+
[MIT](LICENSE)
14+
15+
## Icon credits
16+
17+
- `trayIcon.png` - Made by [Freepik](https://www.freepik.com) and downloaded from [Flaticon](https://www.flaticon.com)
16 KB
Loading
965 Bytes
Loading

desktop-init/resources/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>NeutralinoJs sample app</title>
6+
<link rel="stylesheet" href="styles.css">
7+
</head>
8+
<body>
9+
<div id="neutralinoapp">
10+
<h1>NeutralinoJs</h1>
11+
<div id="info"></div>
12+
<br/>
13+
<div>
14+
<a href="#" onclick="openDocs();">Docs</a> &middot;
15+
<a href="#" onclick="openTutorial();">Tutorial</a>
16+
</div>
17+
</div>
18+
<!-- Neutralino.js client. This file is gitignored,
19+
because `neu update` typically downloads it.
20+
Avoid copy-pasting it.
21+
-->
22+
<script src="js/neutralino.js"></script>
23+
<!-- Your app's source files -->
24+
<script src="js/main.js"></script>
25+
</body>
26+
</html>

desktop-init/resources/js/main.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// This is just a sample app. You can structure your Neutralinojs app code as you wish.
2+
// This example app is written with vanilla JavaScript and HTML.
3+
// Feel free to use any frontend framework you like :)
4+
// See more details: https://neutralino.js.org/docs/how-to/use-a-frontend-library
5+
6+
function showInfo() {
7+
document.getElementById('info').innerHTML = `
8+
${NL_APPID} is running on port ${NL_PORT} inside ${NL_OS}
9+
<br/><br/>
10+
<span>server: v${NL_VERSION} . client: v${NL_CVERSION}</span>
11+
`;
12+
}
13+
14+
function openDocs() {
15+
Neutralino.os.open("https://neutralino.js.org/docs");
16+
}
17+
18+
function openTutorial() {
19+
Neutralino.os.open("https://www.youtube.com/watch?v=txDlNNsgSh8&list=PLvTbqpiPhQRb2xNQlwMs0uVV0IN8N-pKj");
20+
}
21+
22+
function setTray() {
23+
if(NL_MODE != "window") {
24+
console.log("INFO: Tray menu is only available in the window mode.");
25+
return;
26+
}
27+
let tray = {
28+
icon: "/resources/icons/trayIcon.png",
29+
menuItems: [
30+
{id: "VERSION", text: "Get version"},
31+
{id: "SEP", text: "-"},
32+
{id: "QUIT", text: "Quit"}
33+
]
34+
};
35+
Neutralino.os.setTray(tray);
36+
}
37+
38+
function onTrayMenuItemClicked(event) {
39+
switch(event.detail.id) {
40+
case "VERSION":
41+
Neutralino.os.showMessageBox("Version information",
42+
`Neutralinojs server: v${NL_VERSION} | Neutralinojs client: v${NL_CVERSION}`);
43+
break;
44+
case "QUIT":
45+
Neutralino.app.exit();
46+
break;
47+
}
48+
}
49+
50+
function onWindowClose() {
51+
Neutralino.app.exit();
52+
}
53+
54+
Neutralino.init();
55+
56+
Neutralino.events.on("trayMenuItemClicked", onTrayMenuItemClicked);
57+
Neutralino.events.on("windowClose", onWindowClose);
58+
59+
if(NL_OS != "Darwin") { // TODO: Fix https://github.com/neutralinojs/neutralinojs/issues/615
60+
setTray();
61+
}
62+
63+
showInfo();

desktop-init/resources/js/neutralino.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop-init/resources/styles.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#neutralinoapp {
2+
text-align: center;
3+
-webkit-user-select: none;
4+
user-select: none;
5+
cursor: default;
6+
}
7+
8+
#neutralinoapp h1{
9+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
10+
font-size: 20px;
11+
}
12+
13+
#neutralinoapp > div {
14+
font-size: 16px;
15+
font-weight: normal;
16+
}

neutralino.config.bak.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"applicationId": "js.neutralino.sample",
3+
"version": "1.0.0",
4+
"defaultMode": "window",
5+
"port": 0,
6+
"documentRoot": "/dist/",
7+
"url": "/#/login",
8+
"enableServer": true,
9+
"enableNativeAPI": true,
10+
"tokenSecurity": "one-time",
11+
"logging": {
12+
"enabled": true,
13+
"writeToLogFile": true
14+
},
15+
"nativeAllowList": [
16+
"app.*",
17+
"os.*",
18+
"debug.log"
19+
],
20+
"globalVariables": {
21+
"TEST1": "Hello",
22+
"TEST2": [
23+
2,
24+
4,
25+
5
26+
],
27+
"TEST3": {
28+
"value1": 10,
29+
"value2": {}
30+
}
31+
},
32+
"modes": {
33+
"window": {
34+
"title": "vue-desktop-app",
35+
"width": 800,
36+
"height": 500,
37+
"minWidth": 400,
38+
"minHeight": 200,
39+
"fullScreen": false,
40+
"alwaysOnTop": false,
41+
"icon": "/src/assets/logo.png",
42+
"enableInspector": true,
43+
"borderless": true,
44+
"maximize": false,
45+
"hidden": false,
46+
"center": true,
47+
"resizable": true,
48+
"exitProcessOnClose": true
49+
},
50+
"browser": {
51+
"globalVariables": {
52+
"TEST": "Test value browser"
53+
},
54+
"nativeBlockList": [
55+
"filesystem.*"
56+
]
57+
},
58+
"cloud": {
59+
"url": "/resources/#cloud",
60+
"nativeAllowList": [
61+
"app.*"
62+
]
63+
},
64+
"chrome": {
65+
"width": 800,
66+
"height": 500,
67+
"args": "--user-agent=\"Neutralinojs chrome mode\"",
68+
"nativeBlockList": [
69+
"filesystem.*",
70+
"os.*"
71+
]
72+
}
73+
},
74+
"cli": {
75+
"binaryName": "vue-desktop-app",
76+
"resourcesPath": "/dist/",
77+
"extensionsPath": "/extensions/",
78+
"clientLibrary": "/public/neutralino.js",
79+
"binaryVersion": "4.6.0",
80+
"clientVersion": "3.5.0",
81+
"frontendLibrary": {
82+
"patchFile": "/public/index.html",
83+
"devUrl": "http://localhost:8081/#/app"
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)