forked from MarseyWorld/MarseyWorld
Fix /shop purchase confirmation buttons.
parent
484788bbc1
commit
f2030077f0
|
@ -5274,6 +5274,10 @@ li > .sidebar {
|
||||||
width: 13rem;
|
width: 13rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shop-table-actions a {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
.userbanner {
|
.userbanner {
|
||||||
object-fit: cover !important;
|
object-fit: cover !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,9 @@ if (document.readyState === "complete" ||
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_toast(t, url, button1, button2, classname) {
|
function post_toast(t, url, button1, button2, classname) {
|
||||||
if (t.id != "buy1-go" && t.id != "buy2-go")
|
let isShopConfirm = t.id.startsWith('buy1-go') || t.id.startsWith('buy2-go');
|
||||||
|
|
||||||
|
if (!isShopConfirm)
|
||||||
{
|
{
|
||||||
t.disabled = true;
|
t.disabled = true;
|
||||||
t.classList.add("disabled");
|
t.classList.add("disabled");
|
||||||
|
@ -212,7 +214,7 @@ function post_toast(t, url, button1, button2, classname) {
|
||||||
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
if (data && data["error"]) document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
|
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
|
||||||
}
|
}
|
||||||
if (t.id != "buy1-go" && t.id != "buy2-go")
|
if (!isShopConfirm)
|
||||||
{
|
{
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
t.disabled = false;
|
t.disabled = false;
|
||||||
|
|
|
@ -27,12 +27,6 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<style>
|
|
||||||
#buy1, #buy1-go, #buy2, #buy2-go {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
{% if error %}
|
{% if error %}
|
||||||
<div class="alert alert-danger alert-dismissible fade show my-3" role="alert">
|
<div class="alert alert-danger alert-dismissible fade show my-3" role="alert">
|
||||||
<i class="fas fa-exclamation-circle my-auto"></i>
|
<i class="fas fa-exclamation-circle my-auto"></i>
|
||||||
|
@ -85,14 +79,14 @@
|
||||||
<td class="shop-table-owned">{{a['owned']}}</td>
|
<td class="shop-table-owned">{{a['owned']}}</td>
|
||||||
{% set kind = a['kind'] %}
|
{% set kind = a['kind'] %}
|
||||||
<td class="shop-table-actions">
|
<td class="shop-table-actions">
|
||||||
{% if a['kind'] != "benefactor" %}
|
{% if kind != "benefactor" %}
|
||||||
<a id="buy1" class="btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy1-go').classList.remove('d-none')"><span class="m-auto">Buy</span></a>
|
<a id="buy1-{{loop.index}}" class="btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy1-go-{{loop.index}}').classList.remove('d-none')"><span class="m-auto">Buy</span></a>
|
||||||
<a id="buy1-go" class="d-none btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" role="button" onclick="post_toast(this,'/buy/{{kind}}')"><span class="m-auto">Are you sure?</span></a>
|
<a id="buy1-go-{{loop.index}}" class="d-none btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" role="button" onclick="post_toast(this,'/buy/{{kind}}')"><span class="m-auto">Are you sure?</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if FEATURES['PROCOINS'] %}
|
{% if FEATURES['PROCOINS'] %}
|
||||||
{% if a['kind'] != "grass" %}
|
{% if kind != "grass" %}
|
||||||
<a id="buy2" class="marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy2-go').classList.remove('d-none')""><span class="m-auto">Buy with MBux</span></a>
|
<a id="buy2-{{loop.index}}" class="marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy2-go-{{loop.index}}').classList.remove('d-none')"><span class="m-auto">Buy with MBux</span></a>
|
||||||
<a id="buy2-go" class="d-none marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" role="button" onclick="post_toast(this,'/buy/{{kind}}?mb=true')"><span class="m-auto">Are you sure?</span></a>
|
<a id="buy2-go-{{loop.index}}" class="d-none marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" role="button" onclick="post_toast(this,'/buy/{{kind}}?mb=true')"><span class="m-auto">Are you sure?</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{%-
|
{%-
|
||||||
set CACHE_VER = {
|
set CACHE_VER = {
|
||||||
'css/main.css': 440,
|
'css/main.css': 441,
|
||||||
'css/catalog.css': 2,
|
'css/catalog.css': 2,
|
||||||
|
|
||||||
'css/4chan.css': 61,
|
'css/4chan.css': 61,
|
||||||
|
@ -17,7 +17,7 @@ set CACHE_VER = {
|
||||||
'css/win98.css': 63,
|
'css/win98.css': 63,
|
||||||
|
|
||||||
'js/award_modal.js': 254,
|
'js/award_modal.js': 254,
|
||||||
'js/bootstrap.js': 276,
|
'js/bootstrap.js': 277,
|
||||||
'js/category_modal.js': 200,
|
'js/category_modal.js': 200,
|
||||||
'js/comments+submission_listing.js': 265,
|
'js/comments+submission_listing.js': 265,
|
||||||
'js/submission_listing.js': 261,
|
'js/submission_listing.js': 261,
|
||||||
|
|
Loading…
Reference in New Issue