main #8

Closed
nelle wants to merge 183 commits from main into blog-drafts
Showing only changes of commit dd38879204 - Show all commits

View file

@ -1,5 +1,6 @@
// i deeply apologize for the horrors within...
const ntfyEndpoint = "https://ntfy.ouroboros.group/beep";
const meowEndpoint = "https://ntfy.ouroboros.group/meow";
const ntfyMessage = document.getElementById("ntfy-message");
const ntfyTitle = document.getElementById("ntfy-title");
@ -149,7 +150,7 @@ function toggleClick() {
async function meowClick() { meowButton.disabled=true;
setTimeout('meowButton.disabled=false;',11000);
meowButton.innerHTML = "<span>Sent! :3</span>";
sendNone("meow");
sendNone(meowEndpoint, "meow");
setTimeout(() => {
meowButton.innerHTML = "<span>cooldown 10s</span>";
setTimeout(() => {
@ -203,9 +204,9 @@ async function ntfyClick() {
}
// only message
function sendNone(message) {
function sendNone(endpoint, message) {
const r = new XMLHttpRequest();
r.open("POST", ntfyEndpoint, true);
r.open("POST", endpoint, true);
r.setRequestHeader("Content-Type", "text/plain");
r.send(message);
}
@ -327,7 +328,7 @@ function sendNotification() {
}
// none
else {
sendNone(ntfyMessage.value);
sendNone(ntfyEndpoint, ntfyMessage.value);
ntfyMessage.value = "";
}
}