From c2104f4577e84ffbabade57a63b77035efd78e1c Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 18 Dec 2022 20:37:39 -0800 Subject: [PATCH] Hide images with a censored attribute Which will allow for a message to be hidden in the set of which images are censored by ZomboCom. --- index.html | 4 ++++ index.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b362549..27035a1 100644 --- a/index.html +++ b/index.html @@ -174,6 +174,10 @@ mute.addEventListener("click", () => { const figure = document.createElement('figure'); figure.id = "image_" + image.id; + if (image.censored) { + figure.style.display = "none"; + } + const img = document.createElement('img'); img.src = image.filename; figure.appendChild(img); diff --git a/index.js b/index.js index 7bd8a10..6f2a625 100644 --- a/index.js +++ b/index.js @@ -136,7 +136,8 @@ io.on('connection', (socket) => { const images = JSON.parse(data); images.forEach((image) => { image.id = state.images.length; - image.comments = []; + image.censored = false; + image.comments = []; io.emit('image', image); state.images.push(image); }); -- 2.43.0