separate endpoint
This commit is contained in:
parent
a147f28723
commit
dd38879204
1 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
// i deeply apologize for the horrors within...
|
// i deeply apologize for the horrors within...
|
||||||
const ntfyEndpoint = "https://ntfy.ouroboros.group/beep";
|
const ntfyEndpoint = "https://ntfy.ouroboros.group/beep";
|
||||||
|
const meowEndpoint = "https://ntfy.ouroboros.group/meow";
|
||||||
|
|
||||||
const ntfyMessage = document.getElementById("ntfy-message");
|
const ntfyMessage = document.getElementById("ntfy-message");
|
||||||
const ntfyTitle = document.getElementById("ntfy-title");
|
const ntfyTitle = document.getElementById("ntfy-title");
|
||||||
|
@ -149,7 +150,7 @@ function toggleClick() {
|
||||||
async function meowClick() { meowButton.disabled=true;
|
async function meowClick() { meowButton.disabled=true;
|
||||||
setTimeout('meowButton.disabled=false;',11000);
|
setTimeout('meowButton.disabled=false;',11000);
|
||||||
meowButton.innerHTML = "<span>Sent! :3</span>";
|
meowButton.innerHTML = "<span>Sent! :3</span>";
|
||||||
sendNone("meow");
|
sendNone(meowEndpoint, "meow");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
meowButton.innerHTML = "<span>cooldown 10s</span>";
|
meowButton.innerHTML = "<span>cooldown 10s</span>";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -203,9 +204,9 @@ async function ntfyClick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// only message
|
// only message
|
||||||
function sendNone(message) {
|
function sendNone(endpoint, message) {
|
||||||
const r = new XMLHttpRequest();
|
const r = new XMLHttpRequest();
|
||||||
r.open("POST", ntfyEndpoint, true);
|
r.open("POST", endpoint, true);
|
||||||
r.setRequestHeader("Content-Type", "text/plain");
|
r.setRequestHeader("Content-Type", "text/plain");
|
||||||
r.send(message);
|
r.send(message);
|
||||||
}
|
}
|
||||||
|
@ -327,7 +328,7 @@ function sendNotification() {
|
||||||
}
|
}
|
||||||
// none
|
// none
|
||||||
else {
|
else {
|
||||||
sendNone(ntfyMessage.value);
|
sendNone(ntfyEndpoint, ntfyMessage.value);
|
||||||
ntfyMessage.value = "";
|
ntfyMessage.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue