Skip to content

Commit

Permalink
change: include datetime format in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Jul 20, 2024
1 parent 1546217 commit b19a987
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ let statusMessage;
*/

const _Instance = 'https://ntfy.sh/app';
const _Datetime = 'YYYY-MM-DD hh:mm a';
const _Interval = 5;

/*
Expand All @@ -64,7 +65,8 @@ const store = new Store({
bHotkeys: 0,
bDevTools: 0,
bQuitOnClose: 0,
bPersistentNoti: 0
bPersistentNoti: 0,
datetime: _Datetime
}
});

Expand Down Expand Up @@ -97,7 +99,7 @@ const menu_Main = [
submenu: [
{
label: 'Quit',
accelerator: 'CTRL+Q',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+Q' : '',
click: function () {
app.isQuiting = true;
app.quit();
Expand All @@ -111,7 +113,7 @@ const menu_Main = [
submenu: [
{
label: 'General',
accelerator: 'CTRL+G',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+G' : '',
click: function () {
prompt(
{
Expand Down Expand Up @@ -171,7 +173,7 @@ const menu_Main = [
},
{
label: 'URL',
accelerator: 'CTRL+U',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+U' : '',
click: function () {
prompt(
{
Expand Down Expand Up @@ -210,7 +212,7 @@ const menu_Main = [
},
{
label: 'API Token',
accelerator: 'CTRL+T',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+T' : '',
click: function () {
prompt(
{
Expand Down Expand Up @@ -241,7 +243,7 @@ const menu_Main = [
},
{
label: 'Topics',
accelerator: 'CTRL+SHIFT+T',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+SHIFT+T' : '',
click: function () {
prompt(
{
Expand Down Expand Up @@ -272,25 +274,34 @@ const menu_Main = [
},
{
label: 'Notifications',
accelerator: 'CTRL+SHIFT+N',
accelerator: (bHotkeysEnabled == 1 || store.get('bHotkeys') == 1) ? 'CTRL+N' : '',
click: function () {
prompt(
{
title: 'Notifications',
label: '<div class="label-desc">Determines how notifications will behave</div>',
label: 'Notifications Settings<div class="label-desc">Determines how notifications will behave</div>',
useHtmlLabel: true,
alwaysOnTop: true,
type: 'multiInput',
resizable: false,
customStylesheet: path.join(__dirname, `pages`, `css`, `prompt.css`),
height: 230,
height: 300,
icon: app.getAppPath() + '/ntfy.png',
multiInputOptions:
[
{
label: 'Stay on screen until dismissed',
selectOptions: { 0: 'Disabled', 1: 'Enabled' },
value: store.get('bPersistentNoti'),
},
{
label: 'Datetime format for notification title',
value: store.get('datetime') || _Datetime,
inputAttrs:
{
placeholder: 'YYYY-MM-DD hh:mm a',
required: true
}
}
]
},
Expand All @@ -305,6 +316,12 @@ const menu_Main = [
console.error
})

/*
setTimeout(function (){
BrowserWindow.getFocusedWindow().webContents.openDevTools();
}, 3000);
*/

}
}
]
Expand Down Expand Up @@ -368,12 +385,6 @@ const menu_Main = [
]
}];

/*
Main Menu > Build
*/

const header_menu = Menu.buildFromTemplate(menu_Main);

/*
Main Menu > Developer Tools
slides in top position of 'App' menu
Expand Down Expand Up @@ -409,6 +420,7 @@ function activeDevTools() {
Main Menu > Set
*/

const header_menu = Menu.buildFromTemplate(menu_Main);
Menu.setApplicationMenu(header_menu);

/*
Expand Down Expand Up @@ -716,7 +728,6 @@ function ready() {
*/

const msgHistory = [];

async function GetMessages() {

const cfgTopics = store.get('topics');
Expand Down

0 comments on commit b19a987

Please sign in to comment.