aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/static/scripts.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-29 13:10:22 +0300
committerGravatar Vitaly Takmazov2016-07-29 13:19:34 +0300
commit7384f2df2406b70a7bb9c41b53023fd792e88f7c (patch)
tree828a0c9a66d7d77425d2f5eb78f2b38c6d1be169 /juick-www/src/main/static/scripts.js
parent00c59cfcb6c1b080e8d5a62853a4e5c4fcfffc4a (diff)
www: hide NSFW images
Diffstat (limited to 'juick-www/src/main/static/scripts.js')
-rw-r--r--juick-www/src/main/static/scripts.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js
index 1bfeef66..fe701208 100644
--- a/juick-www/src/main/static/scripts.js
+++ b/juick-www/src/main/static/scripts.js
@@ -701,6 +701,23 @@ ready(function () {
attachMessagePhoto(e.target);
});
}
+ document.querySelectorAll('article').forEach(function(article) {
+ article.querySelectorAll('.u a').forEach(function(l) {
+ if (l.textContent === 'NSFW') {
+ var img = article.querySelector('.ir img');
+ if (img) {
+ img.style.opacity = 0.05;
+ img.addEventListener('mouseover', function(e) {
+ e.target.style.opacity = 1;
+ });
+ img.addEventListener('mouseout', function(e) {
+ e.target.style.opacity = 0.05;
+ });
+ }
+ }
+ });
+ });
+
unfoldPostForm();
unfoldReply();
initWS();