Improve ntfy
This commit is contained in:
parent
f2cfca2f1b
commit
487b026a06
2 changed files with 4 additions and 2 deletions
|
@ -5,13 +5,13 @@
|
||||||
|
|
||||||
const pages = getPages();
|
const pages = getPages();
|
||||||
|
|
||||||
function sendNtfyMessage() {
|
async function sendNtfyMessage() {
|
||||||
const message = document.getElementById("ntfy-message").value;
|
const message = document.getElementById("ntfy-message").value;
|
||||||
if (message.length < 15)
|
if (message.length < 15)
|
||||||
return alert(
|
return alert(
|
||||||
`Message must be 15 to 128 characters. Current length is ${message.length}`,
|
`Message must be 15 to 128 characters. Current length is ${message.length}`,
|
||||||
);
|
);
|
||||||
fetch("https://ntfy.meow.company/pancakes", {
|
var resp = await fetch("https://ntfy.meow.company/pancakes", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: message,
|
body: message,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
Tags: "black_cat",
|
Tags: "black_cat",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (resp.ok) alert(`Sent: ${message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNtfyCharCount(_) {
|
function updateNtfyCharCount(_) {
|
||||||
|
|
|
@ -406,6 +406,7 @@ input[type="submit"] {
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
|
|
Loading…
Reference in a new issue