diff --git a/files/assets/js/general35.js b/files/assets/js/general36.js similarity index 91% rename from files/assets/js/general35.js rename to files/assets/js/general36.js index af424bae0..cd03f5e23 100644 --- a/files/assets/js/general35.js +++ b/files/assets/js/general36.js @@ -160,55 +160,49 @@ function getGif(searchTerm) { cancelBtn.innerHTML = ''; - $.ajax({ - url: "/giphy?searchTerm=" + searchTerm + "&limit=48", - type: "GET", - success: function(response) { - var max = response.data.length - 1 //length of response, minus 1 (cuz array starts at index 0) - var randomNumber = Math.round(Math.random() * 6) //random number between 0 and max -1 - // GIF array - var gifURL = []; - // loop for fetching mutliple GIFs and creating the card divs - if (max < 48 && max > 0) { - for (var i = 0; i <= max; i++) { - gifURL[i] = "https://media.giphy.com/media/" + response.data[i].id + "/200w_d.webp"; - if (response.data[i].username==''){ - container.innerHTML += ('
'); + fetch("/giphy?searchTerm=" + searchTerm + "&limit=48") + .then(response => { + var max = response.data.length - 1 //length of response, minus 1 (cuz array starts at index 0) + var randomNumber = Math.round(Math.random() * 6) //random number between 0 and max -1 + // GIF array + var gifURL = []; + + // loop for fetching mutliple GIFs and creating the card divs + if (max < 48 && max > 0) { + for (var i = 0; i <= max; i++) { + gifURL[i] = "https://media.giphy.com/media/" + response.data[i].id + "/200w_d.webp"; + if (response.data[i].username==''){ + container.innerHTML += (' '); + } + else { + container.innerHTML += (' '); + } + noGIFs.innerHTML = null; + loadGIFs.innerHTML = 'Thou've reached the end of the list!
Aw shucks. No GIFs found...
Thou've reached the end of the list!
Thou've reached the end of the list!
Aw shucks. No GIFs found...
Thou've reached the end of the list!
diff --git a/files/templates/settings.html b/files/templates/settings.html index 731a309e5..63aa7f5f2 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -258,7 +258,7 @@ - + {% block onload %}{% endblock %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index e27fa8bfa..9f4a2bf09 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -205,7 +205,7 @@ - + {% block scripts %} {% endblock %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 792b3ade7..f6045cadc 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -235,7 +235,7 @@ - +diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 3f3a20fb7..d397b244e 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -124,7 +124,7 @@ - +diff --git a/files/templates/submit.html b/files/templates/submit.html index 648a311e1..d7ec1a0b1 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -5,7 +5,7 @@ - +