From 343d38b6938ec278fd16c27922383ec00675bfba Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 15 Dec 2022 22:38:33 +0000 Subject: [PATCH] extend image-viewer with modern formats --- copyparty/web/baguettebox.js | 2 +- copyparty/web/browser.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index 950ea1ab..25bcdef8 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -27,7 +27,7 @@ window.baguetteBox = (function () { isOverlayVisible = false, touch = {}, // start-pos touchFlag = false, // busy - re_i = /.+\.(gif|jpe?g|png|webp)(\?|$)/i, + re_i = /.+\.(a?png|avif|bmp|gif|heif|jpe?g|jfif|svg|webp)(\?|$)/i, re_v = /.+\.(webm|mkv|mp4)(\?|$)/i, anims = ['slideIn', 'fadeIn', 'none'], data = {}, // all galleries diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 1cd2e5b1..9dbbf60c 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4068,7 +4068,7 @@ var thegrid = (function () { var oth = ebi(this.getAttribute('ref')), href = noq_href(this), aplay = ebi('a' + oth.getAttribute('id')), - is_img = /\.(gif|jpe?g|png|webp|webm|mkv|mp4)(\?|$)/i.test(href), + is_img = /\.(a?png|avif|bmp|gif|heif|jpe?g|jfif|svg|webp|webm|mkv|mp4)(\?|$)/i.test(href), is_dir = href.endsWith('/'), in_tree = is_dir && treectl.find(oth.textContent.slice(0, -1)), have_sel = QS('#files tr.sel'),