From ea35dfd5e95ed1bf8d4cff6b955cfbd6f3cf01ed Mon Sep 17 00:00:00 2001
From: GitHub Action Used by clients to reply to Params: a JSON object with the following fields: Emitted by clients if a new QR code was scanned by the native QR code scanner opened with a Params: Emitted by clients if the QR code scanner popup opened with a Schema: Note that user interactions must have a TTL of 10 seconds: events of this type must be ignored and a clipboard_text_received event » with the correct Note that this method can be called only in response to a user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main or settings button). A clipboard_text_received event » with the correct Event data: a JSON object with the following fields: Emitted by bot mini apps to prompt the client to open the native QR code scanner and start continuously scanning for QR codes. A Closing the popup should emit a Event data: Emitted by bot mini apps to prompt the client to close the native QR code scanner opened using web_app_open_scan_qr_popup. If the popup is currently open and was closed by this event or in any other way, a Event data: a JSON object with a boolean If equal to Used to trigger haptic feedback for a user interaction in a webapp. Event data: a JSON object with a string Event data: a JSON object with the following fields: Used to open a link in an external browser (or in a new tab for browser clients). The Mini App will not be closed. Note that this method can be called only in response to the user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main button). Note that this method can be called only in response to a user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main or settings button).failed
event if the
data
- A string with the clipboard contents (optional, if not provided consider the request failed)web_app_read_text_from_clipboard
events ».
+qr_text_received
+
+data
- string with the contents of a scanned QR code.web_app_open_scan_qr_popup
event ».
+scan_qr_popup_closed
null
or an empty objectweb_app_open_scan_qr_popup
event » was closed by the user, by the mini app with a web_app_close_scan_qr_popup
event » or failed to open altogether due to permission issues. Keyboard Button Mini Apps
replyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;
diff --git a/data/web/corefork.telegram.org/api/web-events.html b/data/web/corefork.telegram.org/api/web-events.html
index 7bc6113a9c..39f385b064 100644
--- a/data/web/corefork.telegram.org/api/web-events.html
+++ b/data/web/corefork.telegram.org/api/web-events.html
@@ -128,8 +128,21 @@ Otherwise, if the user refuses or the bo
req_id
- The req_id
from the web_app_read_text_from_clipboard
requestdata
- A string with the clipboard contentsreq_id
and no data
field must be sent if the last Mini App user interaction happened more than 10 seconds ago.
+Note that user interactions must have a TTL of 10 seconds: events of this type must be ignored and a clipboard_text_received event » with the correct req_id
and no data
field must be sent if the last Mini App user interaction (as described above) happened more than 10 seconds ago. req_id
and no data
field must also be sent if the bot is not installed in the attachment menu.
+web_app_open_scan_qr_popup
+
+text
- Optional string, containing the text to be displayed under the 'Scan QR' heading, 0-64 characters. qr_text_received
event » should be emitted every time a new QR code is scanned, until the user closes the popup via the UI or the Mini App closes the popup with a web_app_close_scan_qr_popup event.scan_qr_popup_closed
event »; the same event should be emitted if the scan QR code popup cannot be opened due to permission issues.
+web_app_close_scan_qr_popup
null
scan_qr_popup_closed
event » event should be emitted. web_app_setup_closing_behavior
need_confirmation
.true
, the client should require user confirmation with a "Changes that you made may not be saved." popup with "Cancel"/"Close anyway" buttons before closing the webview, to avoid accidentally aborting a sensitive operation; otherwise no confirmation should be requested.
-web_app_open_link
url
field.
+
url
- The URL to opentry_instant_view
- Optional boolean, if set, equal to true
and the scheme of the URL is either http
or https
, the link should be opened in Instant View mode if possible.
+
After opening the URL, further events of this type should be ignored until the user interacts again with the Mini App interface (as above).
-Note that user interactions must have a TTL of 10 seconds: events of this type must be ignored if the last Mini App user interaction happened more than 10 seconds ago.
web_app_open_tg_link
Event data: a JSON object with a string path_full
field, containing the path+query component of a t.me deep link (url = 'https://t.me' + path_full
).
Used to open a t.me deep link. The Mini App must be closed.
diff --git a/data/web/fragment.com/js/auction.js b/data/web/fragment.com/js/auction.js index a0ed386e46..a5cb43cd86 100644 --- a/data/web/fragment.com/js/auction.js +++ b/data/web/fragment.com/js/auction.js @@ -1302,11 +1302,13 @@ var Random = { var LoginCodes = { init: function() { Aj.onLoad(function(state) { + $('.js-toggle-receive').on('change', LoginCodes.eToggleReceive); 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; }); @@ -1337,6 +1339,14 @@ var LoginCodes = { } } + }, + eToggleReceive: function() { + var can_receive = $(this).prop('checked'); + $('.js-codes-main').toggleClass('codes-disabled', !can_receive); + Aj.apiRequest('toggleLoginCodes', { + number: Aj.state.number, + can_receive: can_receive ? 1 : 0 + }); } };