From 8eac76d8813a6adfc31cb3ba0838bd1f5b5309a3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 26 Sep 2021 11:06:17 +0200 Subject: [PATCH] fds --- files/templates/award_modal.html | 8 +-- files/templates/ban_modal.html | 4 +- files/templates/comments.html | 76 ++++++++++++------------- files/templates/default.html | 6 +- files/templates/gif_modal.html | 2 +- files/templates/log.html | 4 +- files/templates/report_post_modal.html | 2 +- files/templates/settings.html | 8 +-- files/templates/settings_blocks.html | 4 +- files/templates/settings_security.html | 2 +- files/templates/sign_up.html | 4 +- files/templates/submission_listing.html | 4 +- files/templates/submit.html | 18 +++--- files/templates/userpage.html | 12 ++-- 14 files changed, 77 insertions(+), 77 deletions(-) diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 025c02f089..b1d552c33b 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 498638727a..b47cd3924d 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 40c127c7ab..92d3557492 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 dfde5079c0..bb8d1e3737 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 902d8ae2a9..6a785d5010 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 a9bf1f806d..79b57319cc 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 8d41253a68..95ce776c43 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 17d4939e07..fc5752b0c1 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 d37fccf95d..4a0fe97278 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 6ecaf200f4..0d6c6dd988 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 dcea440a77..3516edffd0 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 a16d9c3fa9..718435bffc 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 317b668c36..28d44730be 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 6e28033472..acaca002b7 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") {