summaryrefslogtreecommitdiff
path: root/includes/components/emergency.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/components/emergency.inc')
-rw-r--r--includes/components/emergency.inc31
1 files changed, 19 insertions, 12 deletions
diff --git a/includes/components/emergency.inc b/includes/components/emergency.inc
index 5490985..ffa19d6 100644
--- a/includes/components/emergency.inc
+++ b/includes/components/emergency.inc
@@ -22,9 +22,14 @@
.btn-close {
filter: invert(1);
}
+
+ #btn-on.disabled, #btn-off.disabled {
+ opacity: .5;
+ pointer-events: none;
+ }
</style>
-<div class="modal fade" id="turn-on">
+<div class="modal" id="turn-on">
<div class="modal-dialog">
<div class="modal-content">
@@ -50,7 +55,7 @@
</div>
<div class="alert alert-warning">
- This emergency alert system is designed to make sure a loved one can get in touch with you as soon as possible. Therefore, it will emit sudden alerts, and may surprise somecreature if e.g. they are sleeping. Keep that in mind.
+ This emergency alert system is designed to make sure a loved one can get in touch with you as soon as possible. Therefore, it will emit sudden alerts, and may surprise somepony if e.g. they are sleeping. Keep that in mind.
</div>
<p>
@@ -64,7 +69,7 @@
</div>
</div>
-<div class="modal fade" id="turn-off">
+<div class="modal" id="turn-off">
<div class="modal-dialog">
<div class="modal-content">
@@ -103,10 +108,12 @@
<script>
window.alertInterval = null;
- window.alertIntervalCounter = 15;
window.alertDisablerCounter = 9;
window.alertDisablerEnabled = false;
window.alertDisablerCounterInterval = null;
+ window.alertInterval = null;
+ window.alertIntervalAmount = 15;
+ window.alertIntervalCounter = window.alertIntervalAmount;
setInterval(() => {
if (document.getElementById("turn-off").offsetWidth > 0 || document.getElementById("turn-off").offsetHeight > 0) {
@@ -142,23 +149,23 @@
if (document.getElementById("test-mode").checked) {
document.getElementById("next-notification").innerText = "now";
if (document.getElementById("fake-requests").checked) {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
+ window.alertIntervalCounter = window.alertIntervalAmount;
+ document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds";
} else {
window.fetch("/api/emergency").then(() => {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
+ window.alertIntervalCounter = window.alertIntervalAmount;
+ document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds";
})
}
} else {
document.getElementById("next-notification").innerText = "now";
if (document.getElementById("fake-requests").checked) {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
+ window.alertIntervalCounter = window.alertIntervalAmount;
+ document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds";
} else {
window.fetch("/api/emergency-real").then(() => {
- window.alertIntervalCounter = 15;
- document.getElementById("next-notification").innerText = "15 seconds";
+ window.alertIntervalCounter = window.alertIntervalAmount;
+ document.getElementById("next-notification").innerText = window.alertIntervalAmount + " seconds";
})
}
}