From: Carl Worth Date: Mon, 19 Dec 2022 04:37:39 +0000 (-0800) Subject: Hide images with a censored attribute X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=c2104f4577e84ffbabade57a63b77035efd78e1c;hp=9d2bc6a7958c0f794bc700638e9513e25b08a039;p=zombocom-ai 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. --- 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); });