From 57097a5623576583bbbd144b47ef5f10b14f040f Mon Sep 17 00:00:00 2001 From: limepotato Date: Wed, 11 Sep 2024 05:42:18 -0600 Subject: [PATCH] comments --- public/scripts/ntfy.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/scripts/ntfy.js b/public/scripts/ntfy.js index 17f3e32..78e218b 100644 --- a/public/scripts/ntfy.js +++ b/public/scripts/ntfy.js @@ -2,6 +2,7 @@ const ntfyEndpoint = "https://ntfy.ouroboros.group/beep"; const meowEndpoint = "https://ntfy.ouroboros.group/meow"; +// text fields and buttons const ntfyMessage = document.getElementById("ntfy-message"); const ntfyTitle = document.getElementById("ntfy-title"); const ntfyAttach = document.getElementById("ntfy-attach"); @@ -9,26 +10,32 @@ const ntfyClickAction = document.getElementById("ntfy-click"); const ntfyButton = document.getElementById("ntfy-button"); const meowButton = document.getElementById("meow-button"); +// options checkboxes const optionsCheck = document.getElementById("optionsCheckbox"); const titleCheck = document.getElementById("titleCheckbox"); const attachmentCheck = document.getElementById("attachmentCheckbox"); const clickCheck = document.getElementById("clickCheckbox"); +// labels const titleBoxLabel = document.getElementById("titleBoxLabel"); const attachmentBoxLabel = document.getElementById("attachBoxLabel"); const clickBoxLabel = document.getElementById("clickBoxLabel"); const justMeowed = document.getElementById("justMeowed"); +// Options storage variables const optionsEnabled = sessionStorage.getItem("optionsEnabled"); const titleEnabled = sessionStorage.getItem("optionsEnabled"); const attachmentEnabled = sessionStorage.getItem("optionsEnabled"); const clickEnabled = sessionStorage.getItem("optionsEnabled"); +// Prefixs for placeholders const titlePFX = "title: "; const msgPFX = "message: "; const attachPFX = "attachment: "; const clickPFX = "click-action: "; + +// Ctrl + Enter to send document.addEventListener("keydown", (event) => { if (event.ctrlKey && event.key == "Enter") { ntfyClick()