diff --git a/files/assets/js/general39.js b/files/assets/js/general39.js index 4e186a5c5..4aee69ef8 100644 --- a/files/assets/js/general39.js +++ b/files/assets/js/general39.js @@ -34,8 +34,8 @@ function post_toast(url, reload, data) { xhr.onload = function() { if (xhr.status >= 200 && xhr.status < 300) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); try { document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"]; } catch(e) { @@ -51,14 +51,14 @@ function post_toast(url, reload, data) { try { data=JSON.parse(xhr.response); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = data["error"]; return false } catch(e) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = "Error. Try again later."; return false } @@ -87,8 +87,8 @@ function post_toast2(url, button1, button2) { xhr.onload = function() { if (xhr.status >= 200 && xhr.status < 300) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); try { document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"]; } catch(e) { @@ -102,14 +102,14 @@ function post_toast2(url, button1, button2) { try { data=JSON.parse(xhr.response); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = data["error"]; return false } catch(e) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = "Error. Try again later."; return false } diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 025c02f08..b1d552c33 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -11,8 +11,8 @@ xhr.onload = function() { if (xhr.status==204) {} else if (xhr.status >= 200 && xhr.status < 300) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"]; callback(xhr) return true @@ -22,8 +22,8 @@ } else { data=JSON.parse(xhr.response); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = data["error"]; return false diff --git a/files/templates/ban_modal.html b/files/templates/ban_modal.html index 498638727..b47cd3924 100644 --- a/files/templates/ban_modal.html +++ b/files/templates/ban_modal.html @@ -14,8 +14,8 @@ xhr.withCredentials = true; xhr.onload = function(){ - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`; } diff --git a/files/templates/comments.html b/files/templates/comments.html index 40c127c7a..92d355749 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -20,8 +20,8 @@ xhr.onload = function() { if (xhr.status >= 200 && xhr.status < 300) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); try { document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"]; } catch(e) { @@ -35,14 +35,14 @@ try { data=JSON.parse(xhr.response); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = data["error"]; return false } catch(e) { - $('#toast-post-success').toast('dispose'); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); document.getElementById('toast-post-error-text').innerText = "Error. Try again later."; return false } @@ -87,7 +87,7 @@ }; - $('#reportCommentModal').on('hidden.bs.modal', function () { + document.getElementById('reportCommentModal').on('hidden.bs.modal', function () { var button = document.getElementById("reportCommentButton"); @@ -200,15 +200,15 @@ if (xhr.status==200) { commentForm=document.getElementById('comment-form-space-'+fullname); commentForm.innerHTML=JSON.parse(xhr.response)["html"]; - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-success').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-success').toast('show'); } else { var commentError = document.getElementById("comment-error-text"); - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-error').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-error').toast('show'); commentError.textContent = JSON.parse(xhr.response)["error"]; } } @@ -232,15 +232,15 @@ if (xhr.status==200) { commentForm=document.getElementById('comment-form-space-'+id); commentForm.innerHTML=JSON.parse(xhr.response)["html"]; - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-success').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-success').toast('show'); } else { var commentError = document.getElementById("comment-error-text"); - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-error').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-error').toast('show'); commentError.textContent = JSON.parse(xhr.response)["error"]; } } @@ -268,14 +268,14 @@ commentForm=document.getElementById('comment-text-'+id); commentForm.innerHTML=JSON.parse(xhr.response)["html"]; document.getElementById('cancel-edit-'+id).click() - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-success').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-success').toast('show'); } else { - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-error').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-error').toast('show'); commentError.textContent = JSON.parse(xhr.response)["error"]; } } @@ -385,9 +385,9 @@ } else { var commentError = document.getElementById("comment-error-text"); - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-error').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-error').toast('show'); commentError.textContent = JSON.parse(xhr.response)["error"]; } } @@ -396,8 +396,8 @@ document.getElementById(button1).classList.toggle("d-md-inline-block"); document.getElementById(button2).classList.toggle("d-md-inline-block"); - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); if (distinguish=='yes') { document.getElementById('toast-post-success-text').innerText = "Comment distinguished!"; } @@ -423,9 +423,9 @@ } else { var commentError = document.getElementById("comment-error-text"); - $('#toast-comment-success').toast('dispose'); - $('#toast-comment-error').toast('dispose'); - $('#toast-comment-error').toast('show'); + document.getElementById('toast-comment-success').toast('dispose'); + document.getElementById('toast-comment-error').toast('dispose'); + document.getElementById('toast-comment-error').toast('show'); commentError.textContent = JSON.parse(xhr.response)["error"]; } } @@ -434,8 +434,8 @@ document.getElementById(button1).classList.toggle("d-none"); document.getElementById(button2).classList.toggle("d-none"); - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); if (distinguish=='yes') { document.getElementById('toast-post-success-text').innerText = "Comment distinguished!"; } @@ -468,14 +468,14 @@ clipboard.on('success', function(e) { jQuery(function($) { - $('#toast-success').toast('show'); + document.getElementById('toast-success').toast('show'); }) console.log(e); }); clipboard.on('error', function(e) { jQuery(function($) { - $('#toast-error').toast('show'); + document.getElementById('toast-error').toast('show'); }) console.log(e); }); diff --git a/files/templates/default.html b/files/templates/default.html index dfde5079c..bb8d1e373 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -199,7 +199,7 @@ id=$(this).data('id'); - $('#post-text-'+id).toggleClass('d-none'); + document.getElementById('post-text-'+id).toggleClass('d-none'); $('.text-expand-icon-'+id).toggleClass('fa-expand-alt'); $('.text-expand-icon-'+id).toggleClass('fa-compress-alt'); @@ -214,11 +214,11 @@ if (!("standalone" in window.navigator && window.navigator.standalone)){ if (window.innerWidth <= 737){ try { - $('#mobile-prompt').tooltip('show') + document.getElementById('mobile-prompt').tooltip('show') $('.tooltip')[0].addEventListener( 'click', function(event){ - $('#mobile-prompt').tooltip('hide') + document.getElementById('mobile-prompt').tooltip('hide') var xhr = new XMLHttpRequest(); xhr.withCredentials=true; xhr.open("POST", '/dismiss_mobile_tip', true); diff --git a/files/templates/gif_modal.html b/files/templates/gif_modal.html index 902d8ae2a..6a785d501 100644 --- a/files/templates/gif_modal.html +++ b/files/templates/gif_modal.html @@ -98,7 +98,7 @@ // When GIF keyboard is hidden, hide all GIFs - $('#gifModal').on('hidden.bs.modal', function (e) { + document.getElementById('gifModal').on('hidden.bs.modal', function (e) { document.getElementById('gifSearch').value = null; diff --git a/files/templates/log.html b/files/templates/log.html index a9bf1f806..79b57319c 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -21,14 +21,14 @@ clipboard.on('success', function(e) { jQuery(function($) { - $('#toast-success').toast('show'); + document.getElementById('toast-success').toast('show'); }) console.log(e); }); clipboard.on('error', function(e) { jQuery(function($) { - $('#toast-error').toast('show'); + document.getElementById('toast-error').toast('show'); }) console.log(e); }); diff --git a/files/templates/report_post_modal.html b/files/templates/report_post_modal.html index 8d41253a6..95ce776c4 100644 --- a/files/templates/report_post_modal.html +++ b/files/templates/report_post_modal.html @@ -31,7 +31,7 @@ } }; - $('#reportPostModal').on('hidden.bs.modal', function () { + document.getElementById('reportPostModal').on('hidden.bs.modal', function () { var button = document.getElementById("reportPostButton"); diff --git a/files/templates/settings.html b/files/templates/settings.html index 17d4939e0..fc5752b0c 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -21,14 +21,14 @@ clipboard.on('success', function(e) { jQuery(function($) { - $('#toast-success').toast('show'); + document.getElementById('toast-success').toast('show'); }) console.log(e); }); clipboard.on('error', function(e) { jQuery(function($) { - $('#toast-error').toast('show'); + document.getElementById('toast-error').toast('show'); }) console.log(e); }); @@ -38,7 +38,7 @@ // Show confirm password field when user clicks email box - $('#new_email').on('input', function () { + document.getElementById('new_email').on('input', function () { var id = document.getElementById("email-password"); var id2 = document.getElementById("email-password-label"); @@ -52,7 +52,7 @@ // 2FA toggle modal - $('#2faModal').on('hidden.bs.modal', function () { + document.getElementById('2faModal').on('hidden.bs.modal', function () { var box = document.getElementById("2faToggle"); diff --git a/files/templates/settings_blocks.html b/files/templates/settings_blocks.html index d37fccf95..4a0fe9727 100644 --- a/files/templates/settings_blocks.html +++ b/files/templates/settings_blocks.html @@ -148,8 +148,8 @@ window.location.reload(true); } else { - $('#toast-exile-error').toast('dispose'); - $('#toast-exile-error').toast('show'); + document.getElementById('toast-exile-error').toast('dispose'); + document.getElementById('toast-exile-error').toast('show'); exileError.textContent = JSON.parse(xhr.response)["error"]; } } diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index 6ecaf200f..0d6c6dd98 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -177,7 +177,7 @@
- +
diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index dcea440a7..3516edffd 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -12,7 +12,7 @@ //Signup js // Display username and password requirements on input - $('#password-register').on('input', function () { + document.getElementById('password-register').on('input', function () { var charCount = document.getElementById("password-register").value; var id = document.getElementById("passwordHelpRegister"); @@ -31,7 +31,7 @@ // Check username length, special chars - $('#username-register').on('input', function () { + document.getElementById('username-register').on('input', function () { var charCount = document.getElementById("username-register").value; var id = document.getElementById("usernameHelpRegister"); diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index a16d9c3fa..718435bff 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -6,14 +6,14 @@ clipboard.on('success', function(e) { jQuery(function($) { - $('#toast-success').toast('show'); + document.getElementById('toast-success').toast('show'); }) console.log(e); }); clipboard.on('error', function(e) { jQuery(function($) { - $('#toast-error').toast('show'); + document.getElementById('toast-error').toast('show'); }) console.log(e); }); diff --git a/files/templates/submit.html b/files/templates/submit.html index 317b668c3..28d44730b 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -11,7 +11,7 @@ diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 6e2803347..acaca002b 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -62,9 +62,9 @@ let result = callback(xhr); if (xhr.status >= 200 && xhr.status < 300) { - $('#toast-post-error').toast('dispose'); - $('#toast-post-success').toast('dispose'); - $('#toast-post-success').toast('show'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-success').toast('show'); try { if(typeof result == "string") { @@ -78,9 +78,9 @@ return true; } else { - $('#toast-post-success').toast('dispose'); - $('#toast-post-error').toast('dispose'); - $('#toast-post-error').toast('show'); + document.getElementById('toast-post-success').toast('dispose'); + document.getElementById('toast-post-error').toast('dispose'); + document.getElementById('toast-post-error').toast('show'); try { if(typeof result == "string") {