From a122986111013fcd9f678fdcdb8cc1aa3f8dddbc Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 25 Dec 2022 06:10:54 +0200 Subject: [PATCH] fix giphy framerate --- files/assets/js/core.js | 4 ++-- files/assets/js/gif_modal.js | 4 ++-- files/helpers/sanitize.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 886ad8216c..cf4b603f17 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -234,8 +234,8 @@ function expandImage(url) { url = e.target.dataset.src if (!url) url = e.target.src } - document.getElementById("desktop-expanded-image").src = url.replace("200w_d.webp", "giphy.webp"); - document.getElementById("desktop-expanded-image-wrap-link").href = url.replace("200w_d.webp", "giphy.webp"); + document.getElementById("desktop-expanded-image").src = url.replace("200w.webp", "giphy.webp"); + document.getElementById("desktop-expanded-image-wrap-link").href = url.replace("200w.webp", "giphy.webp"); bootstrap.Modal.getOrCreateInstance(document.getElementById('expandImageModal')).show(); }; diff --git a/files/assets/js/gif_modal.js b/files/assets/js/gif_modal.js index f9f6a3f235..478560ca65 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -47,7 +47,7 @@ async function getGifs(form) { noGIFs.innerHTML = null; loadGIFs.innerHTML = null; - container.innerHTML = '
Agree
Laugh
Confused
Sad
Happy
Awesome
Yes
No
Love
Please
Scared
Angry
Awkward
Cringe
OMG
Why
Gross
Meh
' + container.innerHTML = '
Agree
Laugh
Confused
Sad
Happy
Awesome
Yes
No
Love
Please
Scared
Angry
Awkward
Cringe
OMG
Why
Gross
Meh
' } async function searchGifs(searchTerm) { @@ -78,7 +78,7 @@ async function searchGifs(searchTerm) { } else { for (let i = 0; i < 48; i++) { - gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/200w_d.webp"; + gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/200w.webp"; const insert = `` container.insertAdjacentHTML('beforeend', insert); noGIFs.innerHTML = null; diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 8af572be01..f81266dca7 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -472,8 +472,8 @@ def normalize_url(url): .replace("https://nitter.net/", "https://twitter.com/") \ .replace("https://nitter.42l.fr/", "https://twitter.com/") \ .replace("https://nitter.lacontrevoie.fr/", "https://twitter.com/") \ - .replace("/giphy.gif", "/200w_d.webp") \ - .replace("/giphy.webp", "/200w_d.webp") \ + .replace("/giphy.gif", "/200w.webp") \ + .replace("/giphy.webp", "/200w.webp") \ url = imgur_regex.sub(r'\1_d.webp?maxwidth=9999&fidelity=grand', url) url = giphy_regex.sub(r'\1.webp', url)