From d4a99c05e9dfc8dbca7f03fc9416673f3f485758 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 3 Nov 2022 21:08:22 +0200 Subject: [PATCH] rename postToast -> postToastSwitch and postToastCallback -> postToast for clarity --- files/assets/js/award_modal.js | 2 +- files/assets/js/comments_admin.js | 4 +- files/assets/js/core.js | 6 +- files/assets/js/followers.js | 2 +- files/assets/js/following.js | 2 +- files/assets/js/pinpost.js | 4 +- files/assets/js/submission_admin.js | 4 +- files/assets/js/userpage_v.js | 4 +- files/classes/submission.py | 2 +- files/templates/admin/admin_home.html | 20 +++--- files/templates/admin/app.html | 6 +- files/templates/admin/apps.html | 6 +- files/templates/admin/banned_domains.html | 2 +- files/templates/comments.html | 70 +++++++++---------- files/templates/hats.html | 8 +-- files/templates/header.html | 4 +- files/templates/home.html | 12 ++-- files/templates/notifications.html | 2 +- files/templates/post_actions.html | 42 +++++------ files/templates/post_actions_mobile.html | 36 +++++----- .../templates/post_admin_actions_mobile.html | 14 ++-- files/templates/settings_apps.html | 4 +- files/templates/settings_blocks.html | 2 +- files/templates/settings_filters.html | 30 ++++---- files/templates/settings_profile.html | 16 ++--- files/templates/settings_security.html | 6 +- files/templates/shop.html | 4 +- files/templates/sub/settings.html | 2 +- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/submit_hats.html | 4 +- files/templates/submit_marseys.html | 4 +- files/templates/user_listing.html | 4 +- files/templates/userpage.html | 16 ++--- files/templates/userpage_admintools.html | 16 ++--- files/templates/userpage_blocking.html | 2 +- 36 files changed, 183 insertions(+), 183 deletions(-) diff --git a/files/assets/js/award_modal.js b/files/assets/js/award_modal.js index b59926ee2..490946c79 100644 --- a/files/assets/js/award_modal.js +++ b/files/assets/js/award_modal.js @@ -153,7 +153,7 @@ function buy(mb) { function giveaward(t) { const kind = document.getElementById('kind').value; - postToastCallback(t, t.dataset.action, + postToast(t, t.dataset.action, { "kind": kind, "note": document.getElementById('note').value diff --git a/files/assets/js/comments_admin.js b/files/assets/js/comments_admin.js index 4608a866c..738d97a6e 100644 --- a/files/assets/js/comments_admin.js +++ b/files/assets/js/comments_admin.js @@ -1,7 +1,7 @@ function removeComment(t,comment_id,button1,button2,cls) { url="/remove_comment/"+comment_id - postToast(t, url, + postToastSwitch(t, url, button1, button2, cls, @@ -26,7 +26,7 @@ function removeComment(t,comment_id,button1,button2,cls) { function approveComment(t,comment_id,button1,button2,cls) { url="/approve_comment/"+comment_id - postToast(t, url, + postToastSwitch(t, url, button1, button2, cls, diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 778f0f5ae..da96e53e3 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -32,7 +32,7 @@ function createXhrWithFormKey(url, method="POST", form=new FormData()) { return [xhr, form]; // hacky but less stupid than what we were doing before } -function postToastCallback(t, url, data, callback) { +function postToast(t, url, data, callback) { const isShopConfirm = t.id.startsWith('buy1-') || t.id.startsWith('buy2-') if (!isShopConfirm) @@ -78,8 +78,8 @@ function postToastCallback(t, url, data, callback) { } } -function postToast(t, url, button1, button2, cls, callback) { - postToastCallback(t, url, +function postToastSwitch(t, url, button1, button2, cls, callback) { + postToast(t, url, { }, (xhr) => { diff --git a/files/assets/js/followers.js b/files/assets/js/followers.js index 9f10ade66..dd63a9201 100644 --- a/files/assets/js/followers.js +++ b/files/assets/js/followers.js @@ -1,4 +1,4 @@ function removeFollower(t, username) { - postToast(t,'/remove_follow/' + username); + postToastSwitch(t,'/remove_follow/' + username); t.parentElement.parentElement.remove(); } diff --git a/files/assets/js/following.js b/files/assets/js/following.js index 883dc714b..b6b1d2cf1 100644 --- a/files/assets/js/following.js +++ b/files/assets/js/following.js @@ -1,4 +1,4 @@ function removeFollowing(t, username) { - postToast(t,'/unfollow/' + username); + postToastSwitch(t,'/unfollow/' + username); t.parentElement.parentElement.remove(); } diff --git a/files/assets/js/pinpost.js b/files/assets/js/pinpost.js index 1217e13fd..9e02b15be 100644 --- a/files/assets/js/pinpost.js +++ b/files/assets/js/pinpost.js @@ -1,5 +1,5 @@ function pinPost(t, id) { - postToastCallback(t, `/sticky/${id}`, + postToast(t, `/sticky/${id}`, { }, (xhr) => { @@ -17,7 +17,7 @@ function pinPost(t, id) { } function unpinPost(t, id) { - postToastCallback(t, `/unsticky/${id}`, + postToast(t, `/unsticky/${id}`, { }, () => { diff --git a/files/assets/js/submission_admin.js b/files/assets/js/submission_admin.js index 7c885a367..b0817bd61 100644 --- a/files/assets/js/submission_admin.js +++ b/files/assets/js/submission_admin.js @@ -1,7 +1,7 @@ function removePost(t,post_id,button1,button2,cls) { url="/remove_post/"+post_id - postToast(t, url, + postToastSwitch(t, url, button1, button2, cls, @@ -23,7 +23,7 @@ function removePost(t,post_id,button1,button2,cls) { function approvePost(t,post_id,button1,button2,cls) { url="/approve_post/"+post_id - postToast(t, url, + postToastSwitch(t, url, button1, button2, cls, diff --git a/files/assets/js/userpage_v.js b/files/assets/js/userpage_v.js index 8ac738df9..7250fcfa1 100644 --- a/files/assets/js/userpage_v.js +++ b/files/assets/js/userpage_v.js @@ -35,7 +35,7 @@ function transferCoins(t, mobile=false) { let transferred = amount - Math.ceil(amount*TRANSFER_TAX); let username = document.getElementById('username').innerHTML; - postToastCallback(t, `/@${username}/transfer_coins`, + postToast(t, `/@${username}/transfer_coins`, { "amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value, "reason": document.getElementById(mobile ? "coin-transfer-reason-mobile" : "coin-transfer-reason").value @@ -60,7 +60,7 @@ function transferBux(t, mobile=false) { let amount = parseInt(document.getElementById(mobile ? "bux-transfer-amount-mobile" : "bux-transfer-amount").value); let username = document.getElementById('username').innerHTML - postToastCallback(t, `/@${username}/transfer_bux`, + postToast(t, `/@${username}/transfer_bux`, { "amount": document.getElementById(mobile ? "bux-transfer-amount-mobile" : "bux-transfer-amount").value, "reason": document.getElementById(mobile ? "bux-transfer-reason-mobile" : "bux-transfer-reason").value diff --git a/files/classes/submission.py b/files/classes/submission.py index 24615ecf5..a2952f6f8 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -323,7 +323,7 @@ class Submission(Base): body += " - WINNER!" if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']: - body += f'''''' + body += f'''''' body += "" else: input_type = 'radio' if o.exclusive else 'checkbox' diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index af44cfaf9..2e62b188e 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -86,7 +86,7 @@

Casino

{%- endif %} @@ -109,48 +109,48 @@ {% if v.admin_level >= PERMS['SITE_SETTINGS'] %}
- +
- +
- +
- +
- +
{% if v.admin_level >= PERMS['SITE_SETTINGS_UNDER_ATTACK'] %}
- +
{% endif %}
{% if SITE_NAME == 'PCM' and v.admin_level >= PERMS['PRINT_MARSEYBUX_FOR_KIPPY_ON_PCMEMES'] %} - + {% endif %} {% endif %} {% if v.admin_level >= PERMS['SITE_CACHE_PURGE_CDN'] or v.admin_level >= PERMS['SITE_CACHE_DUMP_INTERNAL'] %}

Caching

{% if v.admin_level >= PERMS['SITE_CACHE_PURGE_CDN'] %} - + {% endif %} {% if v.admin_level >= PERMS['SITE_CACHE_DUMP_INTERNAL'] %} - + {% endif %} {% endif %} diff --git a/files/templates/admin/app.html b/files/templates/admin/app.html index 6349c757a..717a4f11c 100644 --- a/files/templates/admin/app.html +++ b/files/templates/admin/app.html @@ -34,12 +34,12 @@
{% if not app.client_id%} - - + + {% else %} - + {% endif %}
diff --git a/files/templates/admin/apps.html b/files/templates/admin/apps.html index c7a9ed188..04ed595ae 100644 --- a/files/templates/admin/apps.html +++ b/files/templates/admin/apps.html @@ -40,12 +40,12 @@
{% if not app.client_id %} - - + + {% else %} - + {% endif %}
diff --git a/files/templates/admin/banned_domains.html b/files/templates/admin/banned_domains.html index 675002289..59da58645 100644 --- a/files/templates/admin/banned_domains.html +++ b/files/templates/admin/banned_domains.html @@ -8,7 +8,7 @@ diff --git a/files/templates/comments.html b/files/templates/comments.html index 921a3d68f..a5a0dfa87 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -222,7 +222,7 @@ Reported by: @@ -412,16 +412,16 @@ {%- endif %} - + - + {% endif %} {% if c.parent_submission %} {% if v and c.author_id == v.id %} - + {% elif v and c.body %} @@ -434,14 +434,14 @@