mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-29 07:52:37 +01:00
Update content of files
This commit is contained in:
parent
6de52a1179
commit
930d9d355c
2 changed files with 157 additions and 21 deletions
|
@ -31,6 +31,7 @@
|
|||
--btn-primary-bg-rgb: 36, 139, 218;
|
||||
--btn-primary-bg-color: rgb(var(--btn-primary-bg-rgb));
|
||||
--btn-primary-bg-hover-color: #207cc2;
|
||||
--btn-primary-disabled-color: #a6d8ff;
|
||||
--btn-default-color: #fff;
|
||||
--btn-default-bg-color: #242e38;
|
||||
--btn-default-bg-hover-color: #293440;
|
||||
|
@ -156,6 +157,11 @@ i.icon {
|
|||
color: var(--btn-primary-color);
|
||||
background-color: var(--btn-primary-bg-hover-color);
|
||||
}
|
||||
.btn-primary[disabled] {
|
||||
color: var(--btn-primary-disabled-color);
|
||||
background-color: var(--btn-primary-bg-color);
|
||||
opacity: 1;
|
||||
}
|
||||
.btn-default {
|
||||
color: var(--btn-default-color);
|
||||
background-color: var(--btn-default-bg-color);
|
||||
|
@ -255,8 +261,14 @@ i.icon {
|
|||
margin: 0px 19px 12px;
|
||||
color: var(--header-color);
|
||||
}
|
||||
.tm-main-form-label-extra {
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
margin: 2px 19px 13px;
|
||||
float: right;
|
||||
}
|
||||
.tm-main-form-group {
|
||||
margin-bottom: 28px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.tm-form-radio-item {
|
||||
display: block;
|
||||
|
@ -538,12 +550,6 @@ i.icon {
|
|||
margin-right: 8px;
|
||||
margin-left: -1px;
|
||||
}
|
||||
.icon-telegram-premium {
|
||||
width: 22px;
|
||||
height: 30px;
|
||||
background-image: var(--image-url-telegram-premium);
|
||||
margin-left: 6px;
|
||||
}
|
||||
.icon-collectibles {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
@ -556,6 +562,29 @@ i.icon {
|
|||
background-image: var(--image-url-change-account);
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.icon-telegram-premium {
|
||||
width: 22px;
|
||||
height: 30px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
i.icon-telegram-premium {
|
||||
background-image: var(--image-url-telegram-premium);
|
||||
}
|
||||
svg.icon-telegram-premium use {
|
||||
fill: var(--header-tab-accent-color);
|
||||
scale: 0.833;
|
||||
}
|
||||
.tm-qr-code-label .icon-telegram-premium {
|
||||
margin: -4px 2px -2px;
|
||||
width: 24px;
|
||||
height: 34px;
|
||||
}
|
||||
.tm-qr-code-label svg.icon-telegram-premium use {
|
||||
fill: currentColor;
|
||||
scale: 0.9444;
|
||||
}
|
||||
|
||||
.tm-header-tabs {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
|
@ -1146,9 +1175,9 @@ a.tm-menu-link:focus {
|
|||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
margin: 9px 14px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
margin: 7px 10px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -1157,7 +1186,7 @@ a.tm-menu-link:focus {
|
|||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
margin: 17px 19px;
|
||||
margin: 11px 14px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
@ -1180,6 +1209,9 @@ a.tm-menu-link:focus {
|
|||
.found .tm-search-field-photo {
|
||||
display: inline-block;
|
||||
}
|
||||
.myself .tm-main-form-myself {
|
||||
display: none;
|
||||
}
|
||||
.tm-search-field.found .tm-search-input {
|
||||
font-weight: bold;
|
||||
background-color: transparent;
|
||||
|
@ -1605,12 +1637,15 @@ a.tm-menu-link:focus {
|
|||
background-color: var(--table-bg-color);
|
||||
}
|
||||
.tm-table > tbody > tr > td .table-cell-value.tm-value {
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tm-table > tbody > tr > td:first-child .table-cell-value.tm-value {
|
||||
font-size: 14px;
|
||||
}
|
||||
.tm-table > tbody > tr:first-child > td {
|
||||
border-top: none;
|
||||
}
|
||||
|
@ -1660,7 +1695,12 @@ a.tm-menu-link:focus {
|
|||
color: #ff9953;
|
||||
}
|
||||
|
||||
.tm-nowrap {
|
||||
.tm-inline-nowrap {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
}
|
||||
.tm-nowrap,
|
||||
.tm-inline-nowrap {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
@ -2911,6 +2951,9 @@ a.tm-table-action-link:hover {
|
|||
height: 36px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
svg.icon-telegram-premium use {
|
||||
scale: 1;
|
||||
}
|
||||
|
||||
.tm-header-search-form {
|
||||
max-width: 274px;
|
||||
|
@ -2954,10 +2997,21 @@ a.tm-table-action-link:hover {
|
|||
.tm-main-premium .tm-main-search-form .tm-search-input {
|
||||
font-size: 15px;
|
||||
}
|
||||
.tm-main-form-group {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
.tm-search-loading,
|
||||
.tm-search-clear {
|
||||
padding: 16px;
|
||||
}
|
||||
.tm-search-error-icon {
|
||||
margin: 17px 19px;
|
||||
}
|
||||
.tm-search-field-photo {
|
||||
margin: 9px 14px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.icon-ton:before {
|
||||
width: 15px;
|
||||
|
@ -3094,6 +3148,9 @@ a.tm-table-action-link:hover {
|
|||
right: 20px;
|
||||
}
|
||||
.tm-table > tbody > tr > td .table-cell-value.tm-value {
|
||||
font-size: 14px;
|
||||
}
|
||||
.tm-table > tbody > tr > td:first-child .table-cell-value.tm-value {
|
||||
font-size: 15px;
|
||||
}
|
||||
.table-cell-value-row > .table-cell-status-thin {
|
||||
|
|
|
@ -1516,6 +1516,7 @@ var Premium = {
|
|||
init: function() {
|
||||
Aj.onLoad(function(state) {
|
||||
var cont = Aj.ajContainer;
|
||||
$(cont).on('click.curPage', '.js-myself-link', Premium.eAcquireForMyself);
|
||||
$(cont).on('click.curPage', '.js-gift-premium-btn', Premium.eGiftPremium);
|
||||
state.$giftPremiumPopup = $('.js-gift-premium-popup');
|
||||
$(cont).on('submit.curPage', '.js-gift-premium-form', Premium.eGiftPremiumSubmit);
|
||||
|
@ -1526,16 +1527,57 @@ var Premium = {
|
|||
state.$premiumSearchForm.on('submit', Premium.eSearchSubmit);
|
||||
state.$premiumSearchForm.field('query').on('input', Premium.eSearchInput);
|
||||
$('.js-form-clear', state.$premiumSearchForm).on('click', Premium.eSearchClear);
|
||||
$('input.radio', state.$premiumSearchForm).on('change', Premium.eRadioChanged);
|
||||
state.$premiumSearchForm.on('change', '.js-premium-options input.radio', Premium.eRadioChanged);
|
||||
state.$giftPremiumBtn = $('.js-gift-premium-btn');
|
||||
state.updLastReq = +Date.now();
|
||||
if (state.needUpdate) {
|
||||
state.updStateTo = setTimeout(Premium.updateState, Main.UPDATE_PERIOD);
|
||||
}
|
||||
});
|
||||
Aj.onUnload(function(state) {
|
||||
clearTimeout(state.updStateTo);
|
||||
state.needUpdate = false;
|
||||
Main.destroyForm(state.$giftPremiumForm);
|
||||
state.$premiumSearchForm.off('submit', Premium.eSearchSubmit);
|
||||
state.$premiumSearchForm.field('query').off('input', Premium.eSearchInput);
|
||||
$('.js-form-clear', state.$premiumSearchForm).off('click', Premium.eSearchClear);
|
||||
$('input.radio', state.$premiumSearchForm).off('change', Premium.eRadioChanged);
|
||||
state.$premiumSearchForm.off('change', '.js-premium-options input.radio', Premium.eRadioChanged);
|
||||
});
|
||||
},
|
||||
updateState: function() {
|
||||
var now = +Date.now();
|
||||
if (document.hasFocus() ||
|
||||
Aj.state.updLastReq && (now - Aj.state.updLastReq) > Main.FORCE_UPDATE_PERIOD) {
|
||||
Aj.state.updLastReq = now;
|
||||
Aj.apiRequest('updatePremiumState', {
|
||||
lv: Aj.state.lastVer,
|
||||
dh: Aj.state.lastDh,
|
||||
}, function(result) {
|
||||
if (result.history_html) {
|
||||
Premium.updateHistory(result.history_html);
|
||||
}
|
||||
if (result.options_html) {
|
||||
Premium.updateOptions(result.options_html);
|
||||
}
|
||||
if (result.lv) {
|
||||
Aj.state.lastVer = result.lv;
|
||||
if (Aj.state.$sentPopup) {
|
||||
closePopup(Aj.state.$sentPopup);
|
||||
}
|
||||
}
|
||||
if (result.dh) {
|
||||
Aj.state.lastDh = result.dh;
|
||||
}
|
||||
if (Aj.state.needUpdate) {
|
||||
Aj.state.updStateTo = setTimeout(Premium.updateState, Main.UPDATE_PERIOD);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (Aj.state.needUpdate) {
|
||||
Aj.state.updStateTo = setTimeout(Premium.updateState, Main.CHECK_PERIOD);
|
||||
}
|
||||
}
|
||||
},
|
||||
eSearchInput: function(e) {
|
||||
var $field = Aj.state.$premiumSearchField;
|
||||
$('.js-search-field-error').html('');
|
||||
|
@ -1544,13 +1586,21 @@ var Premium = {
|
|||
eSearchClear: function(e) {
|
||||
var $form = Aj.state.$premiumSearchForm;
|
||||
var $field = Aj.state.$premiumSearchField;
|
||||
var $btn = Aj.state.$giftPremiumBtn;
|
||||
$form.field('recipient').value('');
|
||||
$form.field('query').value('').prop('disabled', false);
|
||||
$form.removeClass('myself');
|
||||
$btn.prop('disabled', true);
|
||||
$field.removeClass('found');
|
||||
Premium.searchSubmit();
|
||||
Premium.updateUrl();
|
||||
},
|
||||
eAcquireForMyself: function(e) {
|
||||
e.preventDefault();
|
||||
var result = {found: Aj.state.myselfFound};
|
||||
Premium.updateResult(result);
|
||||
},
|
||||
eRadioChanged: function() {
|
||||
Premium.searchSubmit();
|
||||
Premium.updateUrl();
|
||||
},
|
||||
eSearchSubmit: function(e) {
|
||||
e.preventDefault();
|
||||
|
@ -1575,6 +1625,7 @@ var Premium = {
|
|||
updateResult: function(result) {
|
||||
var $form = Aj.state.$premiumSearchForm;
|
||||
var $field = Aj.state.$premiumSearchField;
|
||||
var $btn = Aj.state.$giftPremiumBtn;
|
||||
if (result.error) {
|
||||
$('.js-search-field-error').html(result.error);
|
||||
$field.addClass('error').removeClass('found');
|
||||
|
@ -1590,19 +1641,46 @@ var Premium = {
|
|||
var $form = Aj.state.$premiumSearchForm;
|
||||
$form.field('query').value(result.found.name);
|
||||
}
|
||||
$form.toggleClass('myself', result.found.myself);
|
||||
$form.field('recipient').value(result.found.recipient);
|
||||
$field.addClass('found');
|
||||
$form.field('query').prop('disabled', true);
|
||||
$btn.prop('disabled', false);
|
||||
} else {
|
||||
$form.removeClass('myself');
|
||||
$form.field('recipient').value('');
|
||||
$field.removeClass('found');
|
||||
$form.field('query').prop('disabled', false);
|
||||
$btn.prop('disabled', true);
|
||||
}
|
||||
}
|
||||
if (result.url) {
|
||||
var loc = Aj.location(), path = loc.pathname + loc.search;
|
||||
Aj.setLocation(result.url, true);
|
||||
Premium.updateUrl();
|
||||
},
|
||||
updateUrl: function() {
|
||||
var new_url = '';
|
||||
var $form = Aj.state.$premiumSearchForm;
|
||||
var recipient = $form.field('recipient').value();
|
||||
var months = $form.field('months').value();
|
||||
if (recipient) {
|
||||
new_url += '&recipient=' + encodeURIComponent(recipient);
|
||||
}
|
||||
if (months) {
|
||||
new_url += '&months=' + encodeURIComponent(months);
|
||||
}
|
||||
if (new_url) {
|
||||
new_url = '?' + new_url.substr(1);
|
||||
}
|
||||
var loc = Aj.location(), path = loc.pathname + loc.search;
|
||||
Aj.setLocation(new_url, path != '/premium');
|
||||
},
|
||||
updateOptions: function(html) {
|
||||
var $form = Aj.state.$premiumSearchForm;
|
||||
var months = $form.field('months').value();
|
||||
$('.js-premium-options').replaceWith(html);
|
||||
$form.field('months').value(months);
|
||||
},
|
||||
updateHistory: function(html) {
|
||||
$('.js-premium-history').replaceWith(html);
|
||||
},
|
||||
eGiftPremium: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
|
@ -1647,10 +1725,11 @@ var Premium = {
|
|||
terms_label: l('WEB_POPUP_QR_PROCEED_TERMS'),
|
||||
onConfirm: function(by_server) {
|
||||
if (by_server) {
|
||||
showAlert(l('WEB_GIFT_PREMIUM_SENT'));
|
||||
Aj.state.$sentPopup = showAlert(l('WEB_GIFT_PREMIUM_SENT'));
|
||||
}
|
||||
}
|
||||
});
|
||||
Aj.state.needUpdate = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue