Update content of files

This commit is contained in:
GitHub Action 2023-04-14 14:06:02 +00:00
parent 0024e7392d
commit fe31240ebd
2 changed files with 107 additions and 7 deletions

View file

@ -2777,6 +2777,20 @@ a.tm-table-action-link:hover {
opacity: 0; opacity: 0;
} }
.bot-username-popup-container .popup {
text-align: center;
}
.bot-username-popup-container .popup section {
padding-bottom: 0;
}
.bot-username-popup-container .popup .popup-text {
color: var(--text-color);
}
.bot-username-popup-container form {
text-align: center;
padding: 0;
}
.gift-premium-popup-container .popup { .gift-premium-popup-container .popup {
text-align: center; text-align: center;
} }
@ -2942,6 +2956,41 @@ a.tm-table-action-link:hover {
margin-top: 10px; margin-top: 10px;
} }
.processing-popup-container .popup-body {
width: 348px;
max-width: 100%;
border-radius: 16px;
padding: 30px 50px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.tm-popup-processing .tm-logo-progress {
padding: 0 0 20px;
}
.tm-popup-processing-error .icon-error:before {
width: 50px;
height: 50px;
background-image: var(--image-url-main-search-error);
}
.tm-popup-processing-error .tm-popup-processing-head {
color: var(--unavail-color);
}
.tm-popup-processing-head {
font-size: 17px;
line-height: 24px;
font-weight: bold;
color: var(--field-color);
}
.tm-popup-processing-text {
font-size: 14px;
line-height: 20px;
margin-top: 10px;
color: var(--text-color);
}
.toast-container { .toast-container {
position: fixed; position: fixed;
top: var(--header-height); top: var(--header-height);

View file

@ -866,6 +866,7 @@ var Assets = {
Aj.onLoad(function(state) { Aj.onLoad(function(state) {
$(document).on('click.curPage', '.js-assign-btn', Assets.eAssignToTelegram); $(document).on('click.curPage', '.js-assign-btn', Assets.eAssignToTelegram);
$(document).on('submit.curPage', '.js-assign-form', Assets.eAssignSubmit); $(document).on('submit.curPage', '.js-assign-form', Assets.eAssignSubmit);
$(document).on('submit.curPage', '.js-bot-username-form', Assets.eBotUsernameSubmit);
$(document).on('click.curPage', '.js-get-code-btn', Assets.eGetCode); $(document).on('click.curPage', '.js-get-code-btn', Assets.eGetCode);
$(document).on('click.curPage', '.js-put-to-auction-btn', Assets.ePutToAuction); $(document).on('click.curPage', '.js-put-to-auction-btn', Assets.ePutToAuction);
$(document).on('submit.curPage', '.js-put-to-auction-form', Assets.ePutToAuctionSubmit); $(document).on('submit.curPage', '.js-put-to-auction-form', Assets.ePutToAuctionSubmit);
@ -875,6 +876,9 @@ var Assets = {
$('.table-selectable-in-row').on('mouseover mouseout', Assets.eTableRowSelHovered); $('.table-selectable-in-row').on('mouseover mouseout', Assets.eTableRowSelHovered);
state.$assignPopup = $('.js-assign-popup'); state.$assignPopup = $('.js-assign-popup');
state.$assignForm = $('.js-assign-form'); state.$assignForm = $('.js-assign-form');
state.$botUsernamePopup = $('.js-bot-username-popup');
state.$botUsernameForm = $('.js-bot-username-form');
state.$botUsernameWaitingPopup = $('.js-bot-username-waiting-popup');
state.$putToAuctionPopup = $('.js-put-to-auction-popup'); state.$putToAuctionPopup = $('.js-put-to-auction-popup');
state.$putToAuctionForm = $('.js-put-to-auction-form'); state.$putToAuctionForm = $('.js-put-to-auction-form');
@ -887,6 +891,7 @@ var Assets = {
$('.table-selectable-in-row').off('mouseover mouseout', Assets.eTableRowSelHovered); $('.table-selectable-in-row').off('mouseover mouseout', Assets.eTableRowSelHovered);
Main.destroyForm(state.$putToAuctionForm); Main.destroyForm(state.$putToAuctionForm);
Main.destroyForm(state.$sellUsernameForm); Main.destroyForm(state.$sellUsernameForm);
clearTimeout(Aj.state.waitingTo);
}); });
}, },
eTableRowSelHovered: function(e) { eTableRowSelHovered: function(e) {
@ -934,6 +939,9 @@ var Assets = {
var $form = $(this); var $form = $(this);
var username = $form.field('username').value(); var username = $form.field('username').value();
var assign_to = $form.field('assign_to').value(); var assign_to = $form.field('assign_to').value();
Assets.assignToTelegram(username, assign_to);
},
assignToTelegram: function(username, assign_to) {
Aj.apiRequest('assignToTgAccount', { Aj.apiRequest('assignToTgAccount', {
username: username, username: username,
assign_to: assign_to assign_to: assign_to
@ -941,14 +949,57 @@ var Assets = {
if (result.error) { if (result.error) {
return showAlert(result.error); return showAlert(result.error);
} }
closePopup(); clearTimeout(Aj.state.waitingTo);
$('.js-actions', Aj.ajContainer).each(function() { if (result.waiting) {
if ($(this).attr('data-username') == username) { closePopup(Aj.state.$assignPopup);
$(this).attr('data-assigned-to', assign_to); closePopup(Aj.state.$botUsernamePopup);
if (Aj.state.$botUsernameWaitingPopup.hasClass('hide')) {
openPopup(Aj.state.$botUsernameWaitingPopup);
} }
}); Aj.state.waitingTo = setTimeout(Assets.assignToTelegram, 1000, username, assign_to);
if (result.msg) { } else if (result.need_pay) {
showAlert(result.msg); closePopup();
Aj.state.botUsername = result.username;
Aj.state.botUsernameFee = result.amount;
Aj.state.botUsernameAssignTo = assign_to;
$('.js-username', Aj.state.$botUsernamePopup).html('@' + result.username);
$('.js-amount', Aj.state.$botUsernamePopup).html(Main.wrapTonAmount(result.amount));
Aj.state.$botUsernameForm.field('id').value(result.req_id);
openPopup(Aj.state.$botUsernamePopup);
} else {
closePopup();
$('.js-actions', Aj.ajContainer).each(function() {
if ($(this).attr('data-username') == username) {
$(this).attr('data-assigned-to', assign_to);
}
});
if (result.msg) {
showAlert(result.msg);
}
}
});
},
eBotUsernameSubmit: function(e) {
e.preventDefault();
var $form = $(this);
var req_id = $form.field('id').value();
closePopup(Aj.state.$botUsernamePopup);
QR.showPopup({
request: {
method: 'getBotUsernameLink',
params: {
id: req_id
}
},
title: l('WEB_POPUP_QR_BOT_USERNAME_HEADER'),
description: l('WEB_POPUP_QR_BOT_USERNAME_TEXT', {
amount: '<span class="icon-before icon-ton-text js-amount_fee">' + Main.wrapTonAmount(Aj.state.botUsernameFee) + '</span>'
}),
qr_label: '@' + Aj.state.botUsername,
tk_label: l('WEB_POPUP_QR_BOT_USERNAME_TK_BUTTON'),
terms_label: l('WEB_POPUP_QR_PROCEED_TERMS'),
onConfirm: function(by_server) {
Assets.assignToTelegram(Aj.state.botUsername, Aj.state.botUsernameAssignTo);
} }
}); });
}, },