Compare commits
2 commits
2237dff647
...
7d1da74ad7
Author | SHA1 | Date | |
---|---|---|---|
7d1da74ad7 | |||
50b40ad09f |
3 changed files with 61 additions and 9 deletions
|
@ -49,19 +49,20 @@ function getPlaceholder() {
|
|||
function send(message, title, attachment, click) {
|
||||
const r = new XMLHttpRequest();
|
||||
r.open("POST", "https://ntfy.ouroboros.group/beep", true);
|
||||
r.setRequestHeader("Content-Type", "text/plain");
|
||||
r.setRequestHeader("Content-Type", "text/plain");/*
|
||||
r.setRequestHeader("Title", title);
|
||||
r.setRequestHeader("Attach", attachment);
|
||||
r.setRequestHeader("Click", click);
|
||||
r.setRequestHeader("Click", click);*/
|
||||
r.send(message);
|
||||
}
|
||||
|
||||
// send notification
|
||||
function sendNotification() {
|
||||
function sendNotification() {/*
|
||||
send(ntfyTitle.value, ntfyMessage.value, ntfyAttach.value, ntfyClickAction.value);
|
||||
ntfyTitle.value = "";
|
||||
ntfyAttach.value = "";
|
||||
ntfyClickAction.value = "";
|
||||
ntfyClickAction.value = "";*/
|
||||
send(ntfyMessage.value);
|
||||
ntfyMessage.value = "";
|
||||
}
|
||||
|
||||
|
@ -81,3 +82,30 @@ async function ntfyClick() {
|
|||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleTitle() {
|
||||
if (ntfyTitle.style.display === "none") {
|
||||
ntfyTitle.style.display = "internal"
|
||||
}
|
||||
if (ntfyTitle.style.display === "internal") {
|
||||
ntfyTitle.style.display = "none"
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAttach() {
|
||||
if (ntfyAttach.style.display === "none") {
|
||||
ntfyAttach.style.display = "internal"
|
||||
}
|
||||
if (ntfyAttach.style.display === "internal") {
|
||||
ntfyAttach.style.display = "none"
|
||||
}
|
||||
}
|
||||
|
||||
function toggleClick() {
|
||||
if (ntfyClickAction.style.display === "none") {
|
||||
ntfyClickAction.style.display = "internal"
|
||||
}
|
||||
if (ntfyAttach.style.display === "internal") {
|
||||
ntfyAttach.style.display = "none"
|
||||
}
|
||||
}
|
|
@ -113,4 +113,13 @@ hr {
|
|||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
-webkit-box-shadow: 0 0 20px var(--accent-color);
|
||||
-moz-box-shadow: 0 0 20px var(--accent-color);
|
||||
box-shadow: 0 0 20px var(--accent-color);
|
||||
border: 2.5px solid var(--accent);
|
||||
border-radius: 3px;
|
||||
display: inherit;
|
||||
}
|
|
@ -20,12 +20,26 @@
|
|||
</small>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<textarea id="ntfy-title" placeholder="title" rows=1 style="resize: none;"></textarea>
|
||||
<fieldset style="margin-left: 35%; margin-right: 35%; margin-bottom: 2%; display: none;">
|
||||
<div>
|
||||
<input type="checkbox" id="title" name="title" onchange="toggleTitle()" />
|
||||
<label for="title">Add Title?</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="attachment" name="attachment" onchange="toggleAttach()" />
|
||||
<label for="attachment">Add Attachment?</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="click" name="click" onchange="toggleClick()" />
|
||||
<label for="click">Add Click Action?</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<textarea id="ntfy-title" placeholder="title" rows=1 style="resize: none; display: none;"></textarea>
|
||||
<textarea id="ntfy-message" placeholder="message" rows=2></textarea>
|
||||
<textarea id="ntfy-attach" placeholder="attachment link" rows=1 style="resize: none;"></textarea>
|
||||
<textarea id="ntfy-click" placeholder="click link" rows=1 style="resize: none;"></textarea>
|
||||
<br>
|
||||
<textarea id="ntfy-attach" placeholder="attachment link" rows=1 style="resize: none;display: none;"></textarea>
|
||||
<textarea id="ntfy-click" placeholder="click link" rows=1 style="resize: none; display: none;"></textarea>
|
||||
<br>
|
||||
<br>
|
||||
<button
|
||||
class="custom-btn btn-1"
|
||||
style="width: 42%;"
|
||||
|
@ -34,6 +48,7 @@
|
|||
<span>Send</span>
|
||||
</button>
|
||||
<br>
|
||||
<br>s
|
||||
<small>if it doesnt seem to be working, or you have javascript disabled, <br>you can POST to <span class="glitch">https://ntfy.ouroboros.group/beep</span>.</small>
|
||||
</div>
|
||||
</section>
|
Loading…
Reference in a new issue