forked from rDrama/rDrama
sfdsfd
parent
e40cdbcec6
commit
48b8534db7
|
@ -43,7 +43,31 @@
|
||||||
|
|
||||||
{% block desktopUserBanner %}
|
{% block desktopUserBanner %}
|
||||||
<!-- Desktop -->
|
<!-- Desktop -->
|
||||||
<script src="/assets/js/userpage.js"></script>>
|
|
||||||
|
<script src="/assets/js/userpage2.js"></script>>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function transferCoins(mobile=false) {
|
||||||
|
let t = event.target;
|
||||||
|
t.disabled = true;
|
||||||
|
|
||||||
|
let amount = parseInt(document.getElementById("coins-transfer-amount").value);
|
||||||
|
let transferred = amount - Math.ceil(amount*TRANSFER_TAX);
|
||||||
|
|
||||||
|
post_toast_callback("/@{{u.username}}/transfer_coins",
|
||||||
|
{"amount": document.getElementById(mobile ? "coins-transfer-amount-mobile" : "coins-transfer-amount").value},
|
||||||
|
(xhr) => {
|
||||||
|
if(xhr.status == 200) {
|
||||||
|
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - amount;
|
||||||
|
document.getElementById("profile-coins-amount-mobile").innerText = parseInt(document.getElementById("profile-coins-amount-mobile").innerText) + transferred;
|
||||||
|
document.getElementById("profile-coins-amount").innerText = parseInt(document.getElementById("profile-coins-amount").innerText) + transferred;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
setTimeout(_ => t.disabled = false, 2000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<textarea id="userid" style="display: none;">{% if u.song %}{{u.id}}{% else %}nosong{% endif %}</textarea>
|
<textarea id="userid" style="display: none;">{% if u.song %}{{u.id}}{% else %}nosong{% endif %}</textarea>
|
||||||
<div class="row d-none d-md-block">
|
<div class="row d-none d-md-block">
|
||||||
|
|
Loading…
Reference in New Issue