From 377317a26b386da3d898efd67650c17f637859fd Mon Sep 17 00:00:00 2001 From: Eliot Partridge Date: Sun, 5 May 2024 17:38:22 -0400 Subject: [PATCH] Add local setting to enable audio on videos by default (#252) * Add local setting to enable audio on videos by default * Update copy * Use ternary over `let`+`if` --- assets/js/image_expansion.js | 6 ++++-- lib/philomena_web/controllers/setting_controller.ex | 1 + lib/philomena_web/templates/setting/edit.html.slime | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/js/image_expansion.js b/assets/js/image_expansion.js index d7bab189..66cc379e 100644 --- a/assets/js/image_expansion.js +++ b/assets/js/image_expansion.js @@ -86,10 +86,12 @@ function pickAndResize(elem) { clearEl(elem); } + const muted = store.get('unmute_videos') ? '' : 'muted'; + if (imageFormat === 'mp4') { elem.classList.add('full-height'); elem.insertAdjacentHTML('afterbegin', - `