Escape key for gallery modal + Dark Video Detector chat rule
* In the Photo Gallery lightbox modal, the Escape key will now dismiss the modal. * Add a chat rule 'nodvd' to exempt specific users from the dark video detector.
This commit is contained in:
parent
ea1c4aab18
commit
0d0cabb75d
|
@ -237,6 +237,12 @@ var (
|
||||||
Label: "No image sharing privileges ('Shy Accounts')",
|
Label: "No image sharing privileges ('Shy Accounts')",
|
||||||
Help: "The user can not share or see any image shared on chat.",
|
Help: "The user can not share or see any image shared on chat.",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Value: "nodvd",
|
||||||
|
Label: "[Support] Exempt this user from the dark video detector",
|
||||||
|
Help: "A special case if a user reaches out that the dark video detector on chat is misfiring for their camera. " +
|
||||||
|
"This will exempt the user from their camera being cut for being too dark.",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -898,10 +898,12 @@
|
||||||
});
|
});
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
// Lightbox modal controls.
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
// Get our modal to trigger it on click of a detail img.
|
// Get our modal to trigger it on click of a detail img.
|
||||||
let $modal = document.querySelector("#detail-modal"),
|
let $modal = document.querySelector("#detail-modal"),
|
||||||
$altText = $modal.getElementsByTagName("button")[0];
|
$altText = $modal.getElementsByTagName("button")[0],
|
||||||
|
cls = "is-active";
|
||||||
|
|
||||||
function setModalImage(url, altText) {
|
function setModalImage(url, altText) {
|
||||||
let $modalImg = document.querySelector("#detailImg"),
|
let $modalImg = document.querySelector("#detailImg"),
|
||||||
|
@ -964,7 +966,7 @@
|
||||||
node.addEventListener("click", (e) => {
|
node.addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setModalImage(node.dataset.url, altText);
|
setModalImage(node.dataset.url, altText);
|
||||||
$modal.classList.add("is-active");
|
$modal.classList.add(cls);
|
||||||
|
|
||||||
// Log a view of this photo.
|
// Log a view of this photo.
|
||||||
markImageViewed(photoID);
|
markImageViewed(photoID);
|
||||||
|
@ -976,6 +978,15 @@
|
||||||
markImageViewed(photoID);
|
markImageViewed(photoID);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Key bindings to control the modal.
|
||||||
|
window.addEventListener('keydown', (e) => {
|
||||||
|
if ($modal.classList.contains(cls)) {
|
||||||
|
if (e.key == 'Escape') {
|
||||||
|
$modal.classList.remove(cls);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user