vc
This commit is contained in:
parent
1a17faf9b1
commit
d5d719a42f
4 changed files with 6 additions and 6 deletions
|
@ -70,7 +70,7 @@ let TRANSFER_TAX = document.getElementById('tax').innerHTML
|
|||
|
||||
function updateTax(mobile=false) {
|
||||
let suf = mobile ? "-mobile" : "";
|
||||
let amount = parseInt(document.getElementById("coins-transfer-amount" + suf).value);
|
||||
let amount = parseInt(document.getElementById("coin-transfer-amount" + suf).value);
|
||||
if(amount > 0) document.getElementById("coins-transfer-taxed" + suf).innerText = amount - Math.ceil(amount*TRANSFER_TAX);
|
||||
}
|
||||
|
||||
|
@ -84,12 +84,12 @@ function transferCoins(mobile=false) {
|
|||
let t = event.target;
|
||||
t.disabled = true;
|
||||
|
||||
let amount = parseInt(document.getElementById("coins-transfer-amount").value);
|
||||
let amount = parseInt(document.getElementById("coin-transfer-amount").value);
|
||||
let transferred = amount - Math.ceil(amount*TRANSFER_TAX);
|
||||
let username = document.getElementById('username').innerHTML
|
||||
|
||||
post_toast_callback(`/@${username}/transfer_coins`,
|
||||
{"amount": document.getElementById(mobile ? "coins-transfer-amount-mobile" : "coins-transfer-amount").value},
|
||||
{"amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value},
|
||||
(xhr) => {
|
||||
if(xhr.status == 200) {
|
||||
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - amount;
|
||||
|
|
|
@ -690,7 +690,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=221"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=222"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=221"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=222"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
{% if v %}
|
||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||
<script src="/static/assets/js/userpage_v.js?a=221"></script>
|
||||
<script src="/static/assets/js/userpage_v.js?a=222"></script>
|
||||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue