forked from MarseyWorld/MarseyWorld
add postToastReload
parent
a4f004806d
commit
995d3cbc98
|
@ -78,6 +78,16 @@ function postToast(t, url, data, callback) {
|
|||
}
|
||||
}
|
||||
|
||||
function postToastReload(t, url) {
|
||||
postToast(t, url,
|
||||
{
|
||||
},
|
||||
() => {
|
||||
location.reload()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function postToastSwitch(t, url, button1, button2, cls, callback) {
|
||||
postToast(t, url,
|
||||
{
|
||||
|
|
|
@ -323,7 +323,7 @@ class Submission(Base):
|
|||
body += " - <b>WINNER!</b>"
|
||||
|
||||
if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']:
|
||||
body += f'''<button class="btn btn-primary distribute" data-click="postToastSwitch(this,'/distribute/{o.id}',true)" onclick="areyousure(this)">Declare winner</button>'''
|
||||
body += f'''<button class="btn btn-primary distribute" data-click="postToastReload(this,'/distribute/{o.id}')" onclick="areyousure(this)">Declare winner</button>'''
|
||||
body += "</div>"
|
||||
else:
|
||||
input_type = 'radio' if o.exclusive else 'checkbox'
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
<div class="d-flex">
|
||||
{% if not app.client_id%}
|
||||
|
||||
<button type="button" class="btn btn-primary ml-auto mr-2" onclick="postToastSwitch(this,'/admin/app/approve/{{app.id}}',true)">Approve</button>
|
||||
<button type="button" class="btn btn-secondary mr-0" onclick="postToastSwitch(this,'/admin/app/reject/{{app.id}}',true)">Reject</button>
|
||||
<button type="button" class="btn btn-primary ml-auto mr-2" onclick="postToastReload(this,'/admin/app/approve/{{app.id}}')">Approve</button>
|
||||
<button type="button" class="btn btn-secondary mr-0" onclick="postToastReload(this,'/admin/app/reject/{{app.id}}')">Reject</button>
|
||||
|
||||
{% else %}
|
||||
|
||||
<button type="button" class="btn btn-primary ml-auto" onclick="postToastSwitch(this,'/admin/app/revoke/{{app.id}}'),true">Revoke</button>
|
||||
<button type="button" class="btn btn-primary ml-auto" onclick="postToastReload(this,'/admin/app/revoke/{{app.id}}')">Revoke</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -40,12 +40,12 @@
|
|||
<div class="d-flex">
|
||||
{% if not app.client_id %}
|
||||
|
||||
<button type="button" class="btn btn-primary ml-auto mr-2" onclick="postToastSwitch(this,'/admin/app/approve/{{app.id}}',true)">Approve</button>
|
||||
<button type="button" class="btn btn-secondary mr-0" onclick="postToastSwitch(this,'/admin/app/reject/{{app.id}}',true)">Reject</button>
|
||||
<button type="button" class="btn btn-primary ml-auto mr-2" onclick="postToastReload(this,'/admin/app/approve/{{app.id}}')">Approve</button>
|
||||
<button type="button" class="btn btn-secondary mr-0" onclick="postToastReload(this,'/admin/app/reject/{{app.id}}')">Reject</button>
|
||||
|
||||
{% else %}
|
||||
|
||||
<button type="button" class="btn btn-primary ml-auto" onclick="postToastSwitch(this,'/admin/app/revoke/{{app.id}}',true)">Revoke</button>
|
||||
<button type="button" class="btn btn-primary ml-auto" onclick="postToastReload(this,'/admin/app/revoke/{{app.id}}')">Revoke</button>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
|
||||
<button type="button" class="dropdown-item" onclick="postToastSwitch(this,'/logout', true)"><i class="fas fa-sign-out fa-fw mr-3"></i>Log out</button>
|
||||
<button type="button" class="dropdown-item" onclick="postToastReload(this,'/logout')"><i class="fas fa-sign-out fa-fw mr-3"></i>Log out</button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -332,7 +332,7 @@
|
|||
<a class="nav-item nav-link" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
|
||||
|
||||
<li class="nav-item border-top border-bottom mt-2 pt-2">
|
||||
<button type="button" class="nav-link" onclick="postToastSwitch(this,'/logout', true)"><i class="fas fa-sign-out fa-fw mr-3 text-danger"></i>Log out</button>
|
||||
<button type="button" class="nav-link" onclick="postToastReload(this,'/logout')"><i class="fas fa-sign-out fa-fw mr-3 text-danger"></i>Log out</button>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item d-flex align-items-center justify-content-center pb-3">
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-primary btn-rainbow ml-3 mt-4" onclick="postToastSwitch(this,'/clear', true)">Mark all notifications as read</button>
|
||||
<button type="button" class="btn btn-primary btn-rainbow ml-3 mt-4" onclick="postToastReload(this,'/clear')">Mark all notifications as read</button>
|
||||
|
||||
<div class="notifs px-3 p-md-0">
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
<div class="footer">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="btn btn-secondary ml-auto" onclick="postToastSwitch(this,'/reroll/{{app.id}}', true)">Reroll Client ID</button>
|
||||
<button type="button" class="btn btn-secondary ml-auto" onclick="postToastReload(this,'/reroll/{{app.id}}')">Reroll Client ID</button>
|
||||
<input type="submit" onclick="disable(this)" class="btn btn-primary ml-2" value="Save Changes">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -107,7 +107,7 @@
|
|||
</div>
|
||||
<div class="footer">
|
||||
<div class="d-flex">
|
||||
<button type="button" class="btn btn-primary ml-auto text-white" onclick="postToastSwitch(this,'/rescind/{{auth.application.id}}',true)">Revoke</button>
|
||||
<button type="button" class="btn btn-primary ml-auto text-white" onclick="postToastReload(this,'/rescind/{{auth.application.id}}')">Revoke</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<p>Join a house (cost: {{cost}} coins or marseybux).</p>
|
||||
{% endif %}
|
||||
<div class="input-group mb2">
|
||||
<select {% if v.coins < cost and v.procoins < cost or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control" form="profile-settings" name="house" onchange="postToastSwitch(this,'/settings/profile?house='+document.getElementById('house').value, true)">
|
||||
<select {% if v.coins < cost and v.procoins < cost or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control" form="profile-settings" name="house" onchange="postToastReload(this,'/settings/profile?house='+document.getElementById('house').value)">
|
||||
{% for entry in ("None","Furry","Femboy","Vampire","Racist") %}
|
||||
<option value="{{entry}}" {% if v.house==entry %} selected {% endif %}>
|
||||
{{entry}}
|
||||
|
@ -127,7 +127,7 @@
|
|||
<div class="body w-lg-100">
|
||||
<p>Change the theme for the website.</p>
|
||||
<div class="input-group mb2">
|
||||
<select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="postToastSwitch(this,'/settings/profile?theme='+document.getElementById('theme').value, true)">
|
||||
<select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="postToastReload(this,'/settings/profile?theme='+document.getElementById('theme').value)">
|
||||
|
||||
{% set themes = ["4chan","classic","classic_dark","coffee","dark","dramblr","light","midnight","transparent","tron","win98"] %}
|
||||
|
||||
|
@ -196,7 +196,7 @@
|
|||
</div>
|
||||
{% if v.background %}
|
||||
<div class="d-flex mt-2">
|
||||
<button type="button" class="btn btn-primary ml-auto mb-1" onclick="postToastSwitch(this,'/settings/removebackground', true)">Remove Background</button>
|
||||
<button type="button" class="btn btn-primary ml-auto mb-1" onclick="postToastReload(this,'/settings/removebackground')">Remove Background</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="bgcontainer"></div>
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
<button type="button" class="btn btn-primary" onclick="toggleElement('bux-transfer', 'bux-transfer-amount')">Gift Marseybux</button>
|
||||
{%- endif %}
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="postToastSwitch(this,'/settings/block?username={{u.username}}',true)">Block</button>
|
||||
<button type="button" class="btn btn-primary" onclick="postToastReload(this,'/settings/block?username={{u.username}}')">Block</button>
|
||||
</div>
|
||||
</div>
|
||||
<form class="d-none toggleable" id="message" action="/@{{u.username}}/message" onsubmit="submitFormAjax(event)">
|
||||
|
@ -428,7 +428,7 @@
|
|||
<button type="button" class="btn btn-primary" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</button>
|
||||
{%- endif %}
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="postToastSwitch(this,'/settings/block?username={{u.username}}',true)">Block</button>
|
||||
<button type="button" class="btn btn-primary" onclick="postToastReload(this,'/settings/block?username={{u.username}}')">Block</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</span>
|
||||
<h5>You are blocking @{{u.username}}.</h5>
|
||||
<p class="text-muted">So we aren't going to show you their profile.</p>
|
||||
<button type="button" class="btn btn-success text-success mt-2" onclick="postToastSwitch(this,'/settings/unblock?username={{u.username}}', true)"><i class="fas fa-eye text-success mr-2"></i>Unblock user</a>
|
||||
<button type="button" class="btn btn-success text-success mt-2" onclick="postToastReload(this,'/settings/unblock?username={{u.username}}')"><i class="fas fa-eye text-success mr-2"></i>Unblock user</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue