const gifSearchBar = document.getElementById('gifSearch') const loadGIFs = document.getElementById('gifs-load-more'); const noGIFs = document.getElementById('no-gifs-found'); const container = document.getElementById('GIFs'); const backBtn = document.getElementById('gifs-back-btn'); const cancelBtn = document.getElementById('gifs-cancel-btn'); let commentFormID; function insertGIF(url) { const commentBox = document.getElementById(commentFormID); const old = commentBox.value; if (old) commentBox.value = `${old}\n${url}`; else commentBox.value = url if (typeof checkForRequired === "function") checkForRequired(); } document.getElementById('gifModal').addEventListener('shown.bs.modal', function () { gifSearchBar.focus(); setTimeout(() => { gifSearchBar.focus(); }, 200); setTimeout(() => { gifSearchBar.focus(); }, 1000); }); document.getElementById('gifModal').addEventListener('shown.bs.modal', function () { gifSearchBar.focus(); setTimeout(() => { gifSearchBar.focus(); }, 200); setTimeout(() => { gifSearchBar.focus(); }, 1000); }); async function getGifs(form) { commentFormID = form; gifSearchBar.value = null; backBtn.innerHTML = null; cancelBtn.innerHTML = null; noGIFs.innerHTML = null; loadGIFs.innerHTML = null; container.innerHTML = '
Aw shucks. No GIFs found...
Thou've reached the end of the list!