diff --git a/files/assets/js/core.js b/files/assets/js/core.js index b5b3b0d38..e9b30ff54 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -215,8 +215,8 @@ function expandImage(url) { url = e.target.dataset.src if (!url) url = e.target.src } - document.getElementById("desktop-expanded-image").src = url; - document.getElementById("desktop-expanded-image-wrap-link").href = url; + 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 f8e1291f2..844c18c5c 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -46,75 +46,75 @@ async function getGifs(form) { container.innerHTML = `
Agree
- +
Laugh
- +
Confused
- +
Sad
- +
Happy
- +
Awesome
- +
Yes
- +
No
- +
Love
- +
Please
- +
Scared
- +
Angry
- +
Awkward
- +
Cringe
- +
OMG
- +
Why
- +
Gross
- +
Meh
- +
` } @@ -142,7 +142,7 @@ async function searchGifs(searchTerm) { } else { for (let i = 0; i < 48; i++) { - gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/giphy.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 1250a92fd..d8a2907be 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -476,7 +476,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", "/giphy.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)