From 6ab94906d1b7269a6686885ab162d8154af07688 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 3 Jun 2024 04:55:27 +0000 Subject: [PATCH] Update content of files --- data/web/fragment.com/css/auction.css | 17 ++++++++++++---- data/web/fragment.com/js/auction.js | 28 +++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/data/web/fragment.com/css/auction.css b/data/web/fragment.com/css/auction.css index d89babd0e3..40fde12884 100644 --- a/data/web/fragment.com/css/auction.css +++ b/data/web/fragment.com/css/auction.css @@ -1300,6 +1300,19 @@ a.tm-menu-link:focus { background: var(--field-bg-color); position: relative; } +.tm-field-hint { + margin: 8px 14px; +} +.tm-field .form-control-link { + cursor: pointer; +} +.tm-field .form-control-link:hover { + text-decoration: none; +} +.tm-field .form-control-link.urgent { + color: var(--unavail-color); +} + .tm-search-field:before { position: absolute; margin: 4px 9px; @@ -2577,10 +2590,6 @@ a.tm-table-action-link:hover { filter: blur(7px); } -.tm-field-hint { - margin: 8px 14px; -} - .tm-number-form-group { margin: 36px 0 0; } diff --git a/data/web/fragment.com/js/auction.js b/data/web/fragment.com/js/auction.js index 24d42557f8..3a133e8158 100644 --- a/data/web/fragment.com/js/auction.js +++ b/data/web/fragment.com/js/auction.js @@ -1463,13 +1463,14 @@ var Random = { var LoginCodes = { init: function() { Aj.onLoad(function(state) { - $('.js-toggle-receive').on('change', LoginCodes.eToggleReceive); + var cont = Aj.ajContainer; + $(cont).on('change.curPage', '.js-toggle-receive', LoginCodes.eToggleReceive); + $(cont).on('click.curPage', '.js-terminate-sessions-btn', LoginCodes.eTerminateSessions); state.needUpdate = true; state.updLastReq = +Date.now(); state.updStateTo = setTimeout(LoginCodes.updateState, Main.UPDATE_PERIOD); }); Aj.onUnload(function(state) { - $('.js-toggle-receive').off('change', LoginCodes.eToggleReceive); clearTimeout(state.updStateTo); state.needUpdate = false; }); @@ -1508,6 +1509,29 @@ var LoginCodes = { number: Aj.state.number, can_receive: can_receive ? 1 : 0 }); + }, + eTerminateSessions: function(e) { + e.preventDefault(); + LoginCodes.terminateSessions(); + }, + terminateSessions: function(terminate_hash) { + Aj.apiRequest('terminatePhoneSessions', { + number: Aj.state.number, + terminate_hash: terminate_hash + }, function(result) { + if (result.error) { + return showAlert(result.error); + } else if (result.terminate_hash) { + showConfirm(result.confirm_message, function() { + LoginCodes.terminateSessions(result.terminate_hash); + }, result.confirm_button); + } else { + $('.js-terminate-sessions-wrap').hide(); + if (result.msg) { + showAlert(result.msg); + } + } + }); } };