diff --git a/files/assets/js/gif_modal.js b/files/assets/js/gif_modal.js index 56ad8e812..9214812ec 100644 --- a/files/assets/js/gif_modal.js +++ b/files/assets/js/gif_modal.js @@ -1,3 +1,9 @@ +document.addEventListener("DOMContentLoaded", function () { + document.querySelectorAll('[data-src]').forEach(elem => { + elem.src = elem.dataset.src; + }) +}); + async function getGif(searchTerm) { if (searchTerm !== undefined) { @@ -24,7 +30,7 @@ async function getGif(searchTerm) { container.innerHTML = ''; if (searchTerm == undefined) { - 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
' backBtn.innerHTML = null; @@ -54,10 +60,10 @@ async function getGif(searchTerm) { for (var i = 0; i < 48; i++) { gifURL[i] = "https://media.giphy.com/media/" + data[i].id + "/200w_d.webp"; if (data[i].username==''){ - container.innerHTML += ('
'); + container.innerHTML += ('
'); } else { - container.innerHTML += ('
'); + container.innerHTML += ('
'); } noGIFs.innerHTML = null; loadGIFs.innerHTML = '

Thou've reached the end of the list!

'; @@ -92,7 +98,7 @@ function insertGIF(url,form) { var cancelBtn = document.getElementById('gifs-cancel-btn'); - 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
' backBtn.innerHTML = null; diff --git a/files/templates/gif_modal.html b/files/templates/gif_modal.html index 0ba530906..6bd437826 100644 --- a/files/templates/gif_modal.html +++ b/files/templates/gif_modal.html @@ -1,4 +1,4 @@ - +