Added idle status message
This commit is contained in:
@@ -11,9 +11,19 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
#message{
|
||||||
|
margin: 20px;
|
||||||
|
padding: 5px;
|
||||||
|
width: fit-content;
|
||||||
|
background-color: gainsboro;
|
||||||
|
font-size: 16pt;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="message">
|
||||||
|
No Disc
|
||||||
|
</div>
|
||||||
<script src="/js/neutralino.js"></script>
|
<script src="/js/neutralino.js"></script>
|
||||||
<script src="/js/main.js"></script>
|
<script src="/js/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,41 +1,12 @@
|
|||||||
// This is just a sample app. You can structure your Neutralinojs app code as you wish.
|
function setIdleMessage(message){
|
||||||
// This example app is written with vanilla JavaScript and HTML.
|
document.getElementById('message').innerHTML = message;
|
||||||
// Feel free to use any frontend framework you like :)
|
|
||||||
// See more details: https://neutralino.js.org/docs/how-to/use-a-frontend-library
|
|
||||||
|
|
||||||
/*
|
|
||||||
Function to display information about the Neutralino app.
|
|
||||||
This function updates the content of the 'info' element in the HTML
|
|
||||||
with details regarding the running Neutralino application, including
|
|
||||||
its ID, port, operating system, and version information.
|
|
||||||
*/
|
|
||||||
function showInfo() {
|
|
||||||
document.getElementById('info').innerHTML = `
|
|
||||||
${NL_APPID} is running on port ${NL_PORT} inside ${NL_OS}
|
|
||||||
<br/><br/>
|
|
||||||
<span>server: v${NL_VERSION} . client: v${NL_CVERSION}</span>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Function to open the official Neutralino documentation in the default web browser.
|
|
||||||
*/
|
|
||||||
function openDocs() {
|
|
||||||
Neutralino.os.open("https://neutralino.js.org/docs");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Function to open a tutorial video on Neutralino's official YouTube channel in the default web browser.
|
|
||||||
*/
|
|
||||||
function openTutorial() {
|
|
||||||
Neutralino.os.open("https://www.youtube.com/c/CodeZri");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function to set up a system tray menu with options specific to the window mode.
|
Function to set up a system tray menu with options specific to the window mode.
|
||||||
This function checks if the application is running in window mode, and if so,
|
This function checks if the application is running in window mode, and if so,
|
||||||
it defines the tray menu items and sets up the tray accordingly.
|
it defines the tray menu items and sets up the tray accordingly.
|
||||||
*/
|
|
||||||
function setTray() {
|
function setTray() {
|
||||||
// Tray menu is only available in window mode
|
// Tray menu is only available in window mode
|
||||||
if(NL_MODE != "window") {
|
if(NL_MODE != "window") {
|
||||||
@@ -56,12 +27,13 @@ function setTray() {
|
|||||||
// Set the tray menu
|
// Set the tray menu
|
||||||
Neutralino.os.setTray(tray);
|
Neutralino.os.setTray(tray);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function to handle click events on the tray menu items.
|
Function to handle click events on the tray menu items.
|
||||||
This function performs different actions based on the clicked item's ID,
|
This function performs different actions based on the clicked item's ID,
|
||||||
such as displaying version information or exiting the application.
|
such as displaying version information or exiting the application.
|
||||||
*/
|
|
||||||
function onTrayMenuItemClicked(event) {
|
function onTrayMenuItemClicked(event) {
|
||||||
switch(event.detail.id) {
|
switch(event.detail.id) {
|
||||||
case "VERSION":
|
case "VERSION":
|
||||||
@@ -75,6 +47,7 @@ function onTrayMenuItemClicked(event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function to handle the window close event by gracefully exiting the Neutralino application.
|
Function to handle the window close event by gracefully exiting the Neutralino application.
|
||||||
@@ -87,13 +60,15 @@ function onWindowClose() {
|
|||||||
Neutralino.init();
|
Neutralino.init();
|
||||||
|
|
||||||
// Register event listeners
|
// Register event listeners
|
||||||
Neutralino.events.on("trayMenuItemClicked", onTrayMenuItemClicked);
|
//Neutralino.events.on("trayMenuItemClicked", onTrayMenuItemClicked);
|
||||||
Neutralino.events.on("windowClose", onWindowClose);
|
Neutralino.events.on("windowClose", onWindowClose);
|
||||||
|
|
||||||
|
/*
|
||||||
// Conditional initialization: Set up system tray if not running on macOS
|
// Conditional initialization: Set up system tray if not running on macOS
|
||||||
if(NL_OS != "Darwin") { // TODO: Fix https://github.com/neutralinojs/neutralinojs/issues/615
|
if(NL_OS != "Darwin") { // TODO: Fix https://github.com/neutralinojs/neutralinojs/issues/615
|
||||||
setTray();
|
setTray();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Display app information
|
// Display app information
|
||||||
showInfo();
|
showInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user