remove post_toast_callback
This commit is contained in:
parent
f79c6a0dcd
commit
ccebef1f06
2 changed files with 5 additions and 7 deletions
|
@ -169,10 +169,6 @@ function post_toast3(t, url, button1, button2) {
|
||||||
postToastSwitch(t, url, "POST", button1, button2, "d-md-inline-block");
|
postToastSwitch(t, url, "POST", button1, button2, "d-md-inline-block");
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_toast_callback(url, data, callback) {
|
|
||||||
postToastCallback2(null, url, "POST", data, (xhr) => callback(xhr));
|
|
||||||
}
|
|
||||||
|
|
||||||
function escapeHTML(unsafe) {
|
function escapeHTML(unsafe) {
|
||||||
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,10 @@ function transferCoins(mobile=false) {
|
||||||
let transferred = amount - Math.ceil(amount*TRANSFER_TAX);
|
let transferred = amount - Math.ceil(amount*TRANSFER_TAX);
|
||||||
let username = document.getElementById('username').innerHTML
|
let username = document.getElementById('username').innerHTML
|
||||||
|
|
||||||
post_toast_callback(`/@${username}/transfer_coins`,
|
postToastCallback2(null, `/@${username}/transfer_coins`, "POST",
|
||||||
{"amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value},
|
{
|
||||||
|
"amount": document.getElementById(mobile ? "coin-transfer-amount-mobile" : "coin-transfer-amount").value
|
||||||
|
},
|
||||||
(xhr) => {
|
(xhr) => {
|
||||||
if(xhr.status == 200) {
|
if(xhr.status == 200) {
|
||||||
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - amount;
|
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - amount;
|
||||||
|
@ -58,7 +60,7 @@ function transferBux(mobile=false) {
|
||||||
let amount = parseInt(document.getElementById("bux-transfer-amount").value);
|
let amount = parseInt(document.getElementById("bux-transfer-amount").value);
|
||||||
let username = document.getElementById('username').innerHTML
|
let username = document.getElementById('username').innerHTML
|
||||||
|
|
||||||
post_toast_callback(`/@${username}/transfer_bux`,
|
postToastCallback2(null, `/@${username}/transfer_bux`, "POST",
|
||||||
{"amount": document.getElementById(mobile ? "bux-transfer-amount-mobile" : "bux-transfer-amount").value},
|
{"amount": document.getElementById(mobile ? "bux-transfer-amount-mobile" : "bux-transfer-amount").value},
|
||||||
(xhr) => {
|
(xhr) => {
|
||||||
if(xhr.status == 200) {
|
if(xhr.status == 200) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue