Update content of files

This commit is contained in:
GitHub Action 2022-11-19 14:10:43 +00:00
parent a49609c181
commit a7ba94ca29
2 changed files with 61 additions and 0 deletions

View file

@ -1330,6 +1330,9 @@ a.tm-menu-link:focus {
.tm-table .tm-wallet {
width: 300px;
}
.popup-text .tm-wallet {
max-width: 100px;
}
a.tm-wallet:hover {
text-decoration: none;
}

View file

@ -876,14 +876,20 @@ var Account = {
Aj.onLoad(function(state) {
var cont = Aj.ajContainer;
$(cont).on('click.curPage', '.js-convert-btn', Account.eConvertInit);
$(cont).on('click.curPage', '.js-revert-btn', Account.eConvertRevert);
$(cont).on('submit.curPage', '.js-convert-bid-form', Account.eConvertBidSubmit);
$(cont).on('submit.curPage', '.js-new-convert-bid-form', Account.eConvertBidSubmit);
state.$convertBidPopup = $('.js-convert-bid-popup');
state.$newConvertBidPopup = $('.js-new-convert-bid-popup');
state.$convertBidForm = $('.js-convert-bid-form');
state.$newConvertBidForm = $('.js-new-convert-bid-form');
Main.initForm(state.$convertBidForm);
Main.initForm(state.$newConvertBidForm);
state.$convertConfirmPopup = $('.js-convert-confirm-popup');
});
Aj.onUnload(function(state) {
Main.destroyForm(state.$convertBidForm);
Main.destroyForm(state.$newConvertBidForm);
clearTimeout(state.convertTimeout);
});
},
@ -900,6 +906,19 @@ var Account = {
Account.processConverting(result);
});
},
eConvertRevert: function(e) {
e.stopImmediatePropagation();
e.preventDefault();
var $actions = $(this).closest('.js-actions');
var username = $actions.attr('data-username');
Aj.state.curPopup = null;
Aj.state.curPopupState = null;
Aj.apiRequest('revertConverting', {
username: username
}, function(result) {
Account.processConverting(result);
});
},
processConverting: function(result) {
var $popup = Aj.state.curPopup;
if (result.error) {
@ -951,6 +970,45 @@ var Account = {
});
}
}
else if (result.state == 'min_bid_request') {
Aj.state.curPopup = Aj.state.$newConvertBidPopup;
if (Aj.state.curPopupState != result.state) {
if ($popup) {
closePopup($popup);
}
$('.js-username', Aj.state.curPopup).html('@' + result.username);
$('.js-address', Aj.state.curPopup).html(result.address);
Aj.state.$newConvertBidForm.field('id').value(result.req_id);
Aj.state.curPopupState = result.state;
openPopup(Aj.state.curPopup, {
onClose: function() {
Aj.state.curPopupState = null;
}
});
}
}
else if (result.state == 'created') {
$(Aj.ajContainer).one('page:load', function() {
showAlert(result.message);
});
Aj.location('/username/' + result.username);
}
else if (result.state == 'revert_confirm') {
showConfirm(result.message, function() {
Aj.apiRequest('revertConverting', {
username: result.username,
confirmed: 1
}, function(result) {
Account.processConverting(result);
});
}, result.button);
}
else if (result.state == 'reverted') {
$(Aj.ajContainer).one('page:load', function() {
showAlert(result.message);
});
Aj.reload();
}
else if (result.state == 'qr') {
Aj.state.curPopupState = result.state;
if ($popup) {