fdsfds
parent
d0ff33ba63
commit
8db4d1abc8
|
@ -17,11 +17,8 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<script src="/assets/js/userpage.js?v=61"></script>
|
<script src="/assets/js/userpage.js?v=61"></script>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if v and not v.patron %}
|
|
||||||
<script>
|
<script>
|
||||||
const TRANSFER_TAX = 0.03;
|
const TRANSFER_TAX = {% if v.patron}0{% else %}0.03{% endif %};
|
||||||
|
|
||||||
function updateTax(mobile=false) {
|
function updateTax(mobile=false) {
|
||||||
let suf = mobile ? "-mobile" : "";
|
let suf = mobile ? "-mobile" : "";
|
||||||
|
@ -31,9 +28,30 @@
|
||||||
}
|
}
|
||||||
document.getElementById("coins-transfer-taxed" + suf).innerText = amount - Math.ceil(amount*TRANSFER_TAX);
|
document.getElementById("coins-transfer-taxed" + suf).innerText = amount - Math.ceil(amount*TRANSFER_TAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<title>{{u.username}}'s profile - {{'SITE_NAME' | app_config}}</title>
|
<title>{{u.username}}'s profile - {{'SITE_NAME' | app_config}}</title>
|
||||||
{% if u.is_private %}
|
{% if u.is_private %}
|
||||||
<meta name="robots" content="noindex">
|
<meta name="robots" content="noindex">
|
||||||
|
@ -60,27 +78,6 @@
|
||||||
{% block desktopUserBanner %}
|
{% block desktopUserBanner %}
|
||||||
|
|
||||||
<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);
|
|
||||||
}
|
|
||||||
|
|
||||||
{% if u.song %}
|
{% if u.song %}
|
||||||
var audio = new Audio('/songs/{{u.id}}');
|
var audio = new Audio('/songs/{{u.id}}');
|
||||||
audio.loop=true;
|
audio.loop=true;
|
||||||
|
|
Loading…
Reference in New Issue