From a7ba94ca29b6e340e4639377fb88715b540fe107 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 19 Nov 2022 14:10:43 +0000 Subject: [PATCH] Update content of files --- data/web/fragment.com/css/auction.css | 3 ++ data/web/fragment.com/js/auction.js | 58 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/data/web/fragment.com/css/auction.css b/data/web/fragment.com/css/auction.css index 7d26562658..a778c42446 100644 --- a/data/web/fragment.com/css/auction.css +++ b/data/web/fragment.com/css/auction.css @@ -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; } diff --git a/data/web/fragment.com/js/auction.js b/data/web/fragment.com/js/auction.js index f524a4febd..5e51703f62 100644 --- a/data/web/fragment.com/js/auction.js +++ b/data/web/fragment.com/js/auction.js @@ -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) {