From ad52c497823037b67aa77eda0bfc7beac25f17b7 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 12 Oct 2022 01:25:32 -0700 Subject: [PATCH] put details EVERYWHERE why are there 25 of these... --- files/assets/js/award_modal.js | 1 + files/assets/js/ban_modal.js | 1 + files/assets/js/comments_admin.js | 1 + files/assets/js/comments_v.js | 6 ++++++ files/assets/js/delete_post_modal.js | 1 + files/assets/js/report_post_modal.js | 1 + files/assets/js/userpage_v.js | 1 + 7 files changed, 12 insertions(+) diff --git a/files/assets/js/award_modal.js b/files/assets/js/award_modal.js index a597d0a21..48c2307d1 100644 --- a/files/assets/js/award_modal.js +++ b/files/assets/js/award_modal.js @@ -157,6 +157,7 @@ function buy(mb) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text2').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text2').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error2')).show(); } }; diff --git a/files/assets/js/ban_modal.js b/files/assets/js/ban_modal.js index 6be925fff..fbc49a1e5 100644 --- a/files/assets/js/ban_modal.js +++ b/files/assets/js/ban_modal.js @@ -21,6 +21,7 @@ function banModal(link, id, name) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; diff --git a/files/assets/js/comments_admin.js b/files/assets/js/comments_admin.js index 4de331e8b..230463842 100644 --- a/files/assets/js/comments_admin.js +++ b/files/assets/js/comments_admin.js @@ -91,6 +91,7 @@ function adminMuteUser(userId, muteStatus, buttonId) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 6daf15851..d0b2ebeb7 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -46,6 +46,7 @@ function report_commentModal(id, author) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; @@ -121,6 +122,7 @@ function delete_commentModal(id) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; @@ -169,6 +171,7 @@ function post_reply(id){ else { if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; else document.getElementById('toast-post-error-text').innerText = "Error, please try again later." + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } setTimeout(() => { @@ -212,6 +215,7 @@ function comment_edit(id){ else { if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; else document.getElementById('toast-post-error-text').innerText = "Error, please try again later." + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } setTimeout(() => { @@ -271,6 +275,7 @@ function post_comment(fullname, hide){ else { if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; else document.getElementById('toast-post-error-text').innerText = "Error, please try again later." + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); setTimeout(() => { btn.disabled = false; @@ -360,6 +365,7 @@ function handle_action(type, cid, thing) { else { if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; else document.getElementById('toast-post-error-text').innerText = "Error, please try again later." + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } setTimeout(() => { diff --git a/files/assets/js/delete_post_modal.js b/files/assets/js/delete_post_modal.js index 4d6d7ee26..5b7b9c006 100644 --- a/files/assets/js/delete_post_modal.js +++ b/files/assets/js/delete_post_modal.js @@ -20,6 +20,7 @@ function delete_postModal(id) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; diff --git a/files/assets/js/report_post_modal.js b/files/assets/js/report_post_modal.js index 555599e74..18958f1d4 100644 --- a/files/assets/js/report_post_modal.js +++ b/files/assets/js/report_post_modal.js @@ -45,6 +45,7 @@ function report_postModal(id) { } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show(); } }; diff --git a/files/assets/js/userpage_v.js b/files/assets/js/userpage_v.js index 13623ce92..02aa3bf99 100644 --- a/files/assets/js/userpage_v.js +++ b/files/assets/js/userpage_v.js @@ -120,6 +120,7 @@ function submitFormAjax(e) { var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')); myToast.show(); document.getElementById('toast-post-error-text').innerText = data["error"]; + if (data && data["details"]) document.getElementById('toast-post-error-text').innerText = data["details"]; } catch(e) { var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success')); myToast.hide();