From 027d4ce3f0d2eef4acb991c3c74dd638db18c9be Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sun, 8 Jan 2023 12:52:05 +0200 Subject: [PATCH] Added variations for testing `xml_logo_ascii` `xml_logo_icons` `xml_logo_icons_notext` `xml_hero` `xml_banner_bottom` `xml_banner_top_custom` `xml_banner_centered_bottom` `xml_banner_centered_top` --- index.js | 2 +- plugins/notifications/interactive.js | 231 ++++++++++++++++++++++----- 2 files changed, 196 insertions(+), 37 deletions(-) diff --git a/index.js b/index.js index 353980b4..7b414352 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ autoUpdater.autoDownload = false; const gotTheLock = app.requestSingleInstanceLock(); -if (!gotTheLock) app.quit(); +if (!gotTheLock) app.exit(); app.commandLine.appendSwitch( "js-flags", diff --git a/plugins/notifications/interactive.js b/plugins/notifications/interactive.js index 381f3fe9..1b3d434f 100644 --- a/plugins/notifications/interactive.js +++ b/plugins/notifications/interactive.js @@ -55,25 +55,10 @@ function sendXML(songInfo) { icon: imgSrc, silent: true, // https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/schema-root + // https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/toast-schema // https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/adaptive-interactive-toasts?tabs=xml // https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.toasttemplatetype - toastXml: ` - - `, + toastXml: get_xml_custom(), }); savedNotification.on("close", (_) => { @@ -94,24 +79,198 @@ const getButton = (kind) => const display = (kind) => config.smallInteractive ? `content="${icons[kind]}"` : - `content="" imageUri="file:///${path.resolve(__dirname, iconLocation, `${kind}.png`)}"`; + `content="${kind.charAt(0).toUpperCase() + kind.slice(1)}" imageUri="file:///${path.resolve(__dirname, iconLocation, `${kind}.png`)}"`; -// TODO MAKE DIFFERENT TEMPLATES -const xml = (songInfo, options) => { - const xml = ` - - - - Header Text - Body Text - Body 2 Text - Attribution Text - - - - - - - `; -} +const get_xml = (songInfo, options, imgSrc) => ` + + ` + +// **************************************************** // +// PREMADE TEMPLATES FOR TESTING +// DELETE AFTER TESTING +// **************************************************** // + +const get_xml_custom = () => xml_banner_centered_top; + +const xml_logo_ascii = ` + + +`; + + +const xml_logo_icons_notext =` + + +`; + +const buttons_icons = ` + + + + + +`; + +const xml_logo_icons = ` + + +`; + +const xml_hero = ` + + +`; + +const xml_banner_bottom = ` + + +`; + +const xml_banner_top_custom = ` + + +`; + +const xml_banner_centered_bottom = ` + + +`; + +const xml_banner_centered_top = ` + + +`;