mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-11 12:41:37 +01:00
Update content of files
This commit is contained in:
parent
167d13ce14
commit
2b143b5bf6
16 changed files with 120 additions and 23 deletions
|
@ -57,7 +57,7 @@
|
|||
</div>
|
||||
<pre class="page_scheme"><code><a href="/constructor/photos.photo" >photos.photo</a>#20212ca8 photo:<a href="/type/Photo" >Photo</a> users:<a href="/type/Vector%20t" >Vector</a><<a href="/type/User" >User</a>> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
---functions---
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -1796,7 +1796,7 @@ See also TL-Schema…">
|
|||
<a href="/method/updates.getChannelDifference" >updates.getChannelDifference</a>#3173d78 flags:<a href="/type/%23" >#</a> force:flags.0?true channel:<a href="/type/InputChannel" >InputChannel</a> filter:<a href="/type/ChannelMessagesFilter" >ChannelMessagesFilter</a> pts:<a href="/type/int" >int</a> limit:<a href="/type/int" >int</a> = <a href="/type/updates.ChannelDifference" >updates.ChannelDifference</a>;
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.deletePhotos" >photos.deletePhotos</a>#87cf7f2f id:<a href="/type/Vector%20t" >Vector</a><<a href="/type/InputPhoto" >InputPhoto</a>> = <a href="/type/Vector%20t" >Vector</a><<a href="/type/long" >long</a>>;
|
||||
<a href="/method/photos.getUserPhotos" >photos.getUserPhotos</a>#91cd32a8 user_id:<a href="/type/InputUser" >InputUser</a> offset:<a href="/type/int" >int</a> max_id:<a href="/type/long" >long</a> limit:<a href="/type/int" >int</a> = <a href="/type/photos.Photos" >photos.Photos</a>;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@
|
|||
---functions---
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</div>
|
||||
<pre class="page_scheme"><code><a href="/constructor/photos.photo" >photos.photo</a>#20212ca8 photo:<a href="/type/Photo" >Photo</a> users:<a href="/type/Vector%20t" >Vector</a><<a href="/type/User" >User</a>> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
---functions---
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -1796,7 +1796,7 @@ See also TL-Schema…">
|
|||
<a href="/method/updates.getChannelDifference" >updates.getChannelDifference</a>#3173d78 flags:<a href="/type/%23" >#</a> force:flags.0?true channel:<a href="/type/InputChannel" >InputChannel</a> filter:<a href="/type/ChannelMessagesFilter" >ChannelMessagesFilter</a> pts:<a href="/type/int" >int</a> limit:<a href="/type/int" >int</a> = <a href="/type/updates.ChannelDifference" >updates.ChannelDifference</a>;
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.deletePhotos" >photos.deletePhotos</a>#87cf7f2f id:<a href="/type/Vector%20t" >Vector</a><<a href="/type/InputPhoto" >InputPhoto</a>> = <a href="/type/Vector%20t" >Vector</a><<a href="/type/long" >long</a>>;
|
||||
<a href="/method/photos.getUserPhotos" >photos.getUserPhotos</a>#91cd32a8 user_id:<a href="/type/InputUser" >InputUser</a> offset:<a href="/type/int" >int</a> max_id:<a href="/type/long" >long</a> limit:<a href="/type/int" >int</a> = <a href="/type/photos.Photos" >photos.Photos</a>;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@
|
|||
---functions---
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</div>
|
||||
<pre class="page_scheme"><code><a href="/constructor/photos.photo" >photos.photo</a>#20212ca8 photo:<a href="/type/Photo" >Photo</a> users:<a href="/type/Vector%20t" >Vector</a><<a href="/type/User" >User</a>> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
---functions---
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" class="current_page_link" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -1796,7 +1796,7 @@ See also TL-Schema…">
|
|||
<a href="/method/updates.getChannelDifference" >updates.getChannelDifference</a>#3173d78 flags:<a href="/type/%23" >#</a> force:flags.0?true channel:<a href="/type/InputChannel" >InputChannel</a> filter:<a href="/type/ChannelMessagesFilter" >ChannelMessagesFilter</a> pts:<a href="/type/int" >int</a> limit:<a href="/type/int" >int</a> = <a href="/type/updates.ChannelDifference" >updates.ChannelDifference</a>;
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" >photos.Photo</a>;
|
||||
<a href="/method/photos.deletePhotos" >photos.deletePhotos</a>#87cf7f2f id:<a href="/type/Vector%20t" >Vector</a><<a href="/type/InputPhoto" >InputPhoto</a>> = <a href="/type/Vector%20t" >Vector</a><<a href="/type/long" >long</a>>;
|
||||
<a href="/method/photos.getUserPhotos" >photos.getUserPhotos</a>#91cd32a8 user_id:<a href="/type/InputUser" >InputUser</a> offset:<a href="/type/int" >int</a> max_id:<a href="/type/long" >long</a> limit:<a href="/type/int" >int</a> = <a href="/type/photos.Photos" >photos.Photos</a>;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@
|
|||
---functions---
|
||||
|
||||
<a href="/method/photos.updateProfilePhoto" >photos.updateProfilePhoto</a>#72d4742c id:<a href="/type/InputPhoto" >InputPhoto</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<a href="/method/photos.uploadProfilePhoto" >photos.uploadProfilePhoto</a>#89f30f69 flags:<a href="/type/%23" >#</a> fallback:flags.3?true file:flags.0?<a href="/type/InputFile" >InputFile</a> video:flags.1?<a href="/type/InputFile" >InputFile</a> video_start_ts:flags.2?<a href="/type/double" >double</a> = <a href="/type/photos.Photo" class="current_page_link" >photos.Photo</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -408,6 +408,14 @@
|
|||
Utils.sessionStorageSet('themeParams', themeParams);
|
||||
}
|
||||
|
||||
function generateId(len) {
|
||||
var id = '', chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', chars_len = chars.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
id += chars[Math.floor(Math.random() * chars_len)];
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
var viewportHeight = false, viewportStableHeight = false, isExpanded = true;
|
||||
function setViewportHeight(data) {
|
||||
if (typeof data !== 'undefined') {
|
||||
|
@ -974,6 +982,42 @@
|
|||
}
|
||||
}
|
||||
|
||||
var webAppScanQrPopupOpened = false;
|
||||
function onScanQrPopupClosed(eventType, eventData) {
|
||||
if (webAppScanQrPopupOpened) {
|
||||
var popupData = webAppScanQrPopupOpened;
|
||||
webAppScanQrPopupOpened = false;
|
||||
var data = null;
|
||||
if (typeof eventData.data !== 'undefined') {
|
||||
data = eventData.data;
|
||||
}
|
||||
if (popupData.callback) {
|
||||
popupData.callback(data);
|
||||
}
|
||||
receiveWebViewEvent('scanQrPopupClosed', {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var webAppClipboardRequests = {};
|
||||
function onClipboardTextReceived(eventType, eventData) {
|
||||
if (eventData.req_id && webAppClipboardRequests[eventData.req_id]) {
|
||||
var requestData = webAppClipboardRequests[eventData.req_id];
|
||||
delete webAppClipboardRequests[eventData.req_id];
|
||||
var data = null;
|
||||
if (typeof eventData.data !== 'undefined') {
|
||||
data = eventData.data;
|
||||
}
|
||||
if (requestData.callback) {
|
||||
requestData.callback(data);
|
||||
}
|
||||
receiveWebViewEvent('clipboardTextReceived', {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!window.Telegram) {
|
||||
window.Telegram = {};
|
||||
}
|
||||
|
@ -1072,7 +1116,7 @@
|
|||
}
|
||||
WebView.postEvent('web_app_data_send', false, {data: data});
|
||||
};
|
||||
WebApp.openLink = function (url) {
|
||||
WebApp.openLink = function (url, options) {
|
||||
var a = document.createElement('A');
|
||||
a.href = url;
|
||||
if (a.protocol != 'http:' &&
|
||||
|
@ -1081,8 +1125,9 @@
|
|||
throw Error('WebAppTgUrlInvalid');
|
||||
}
|
||||
var url = a.href;
|
||||
options = options || {};
|
||||
if (versionAtLeast('6.1')) {
|
||||
WebView.postEvent('web_app_open_link', false, {url: url});
|
||||
WebView.postEvent('web_app_open_link', false, {url: url, try_instant_view: versionAtLeast('6.4') && !!options.try_instant_view});
|
||||
} else {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
|
@ -1248,6 +1293,45 @@
|
|||
callback(button_id == 'ok');
|
||||
} : null);
|
||||
};
|
||||
WebApp.showScanQrPopup = function (params, callback) {
|
||||
if (!versionAtLeast('6.4')) {
|
||||
console.error('[Telegram.WebApp] Method showScanQrPopup is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
if (webAppScanQrPopupOpened) {
|
||||
console.error('[Telegram.WebApp] Popup is already opened');
|
||||
throw Error('WebAppScanQrPopupOpened');
|
||||
}
|
||||
var text = '';
|
||||
var popup_params = {};
|
||||
if (typeof params.text !== 'undefined') {
|
||||
text = strTrim(params.text);
|
||||
if (text.length > 64) {
|
||||
console.error('[Telegram.WebApp] Scan QR popup text is too long', text);
|
||||
throw Error('WebAppScanQrPopupParamInvalid');
|
||||
}
|
||||
if (text.length > 0) {
|
||||
popup_params.text = text;
|
||||
}
|
||||
}
|
||||
|
||||
webAppScanQrPopupOpened = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_open_scan_qr_popup', false, popup_params);
|
||||
};
|
||||
WebApp.readTextFromClipboard = function () {
|
||||
if (!versionAtLeast('6.4')) {
|
||||
console.error('[Telegram.WebApp] Method readTextFromClipboard is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
var req_id = generateId(16);
|
||||
var req_params = {req_id: req_id};
|
||||
webAppClipboardRequests[req_id] = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_read_text_from_clipboard', false, req_params);
|
||||
};
|
||||
WebApp.ready = function () {
|
||||
WebView.postEvent('web_app_ready');
|
||||
};
|
||||
|
@ -1272,6 +1356,8 @@
|
|||
WebView.onEvent('viewport_changed', onViewportChanged);
|
||||
WebView.onEvent('invoice_closed', onInvoiceClosed);
|
||||
WebView.onEvent('popup_closed', onPopupClosed);
|
||||
WebView.onEvent('scan_qr_popup_closed', onScanQrPopupClosed);
|
||||
WebView.onEvent('clipboard_text_received', onClipboardTextReceived);
|
||||
WebView.postEvent('web_app_request_theme');
|
||||
WebView.postEvent('web_app_request_viewport');
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<meta name="MobileOptimized" content="176" />
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?25"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?26"></script>
|
||||
<script>
|
||||
function setThemeClass() {
|
||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<meta name="MobileOptimized" content="176" />
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?25"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?26"></script>
|
||||
<script>
|
||||
function setThemeClass() {
|
||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||
|
@ -56,6 +56,7 @@
|
|||
<li><a href="javascript:Telegram.WebApp.openTelegramLink('https://t.me/vote');">web_app_open_tg_link()</a> (opens inside Telegram app)</li>
|
||||
<li><a href="javascript:Telegram.WebApp.openLink('https://google.com/');">web_app_open_link()</a> (opens outside webview)</li>
|
||||
<li><a href="tg://resolve?domain=vote">VoteBot tg:// link</a> (does not open)</li>
|
||||
<li><a href="javascript:Telegram.WebApp.openLink('https://telegra.ph/api',{try_instant_view:true});">web_app_open_link({try_instant_view:true})</a> (opens IV inside Telegram app)</li>
|
||||
</ul>
|
||||
<p>Test permissions:</p>
|
||||
<ul>
|
||||
|
@ -76,6 +77,7 @@
|
|||
<li><a href="javascript:;" onclick="DemoApp.showAlert('Hello!');">showAlert</a></li>
|
||||
<li><a href="javascript:;" onclick="DemoApp.showConfirm('Are you sure?');">showConfirm</a></li>
|
||||
<li><a href="javascript:;" onclick="DemoApp.showPopup();">showPopup</a></li>
|
||||
<li><a href="javascript:;" onclick="DemoApp.showScanQrPopup();">showScanQrPopup</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>Haptics:</p>
|
||||
|
@ -102,7 +104,7 @@
|
|||
<div class="viewport-stable_border"></div>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="https://tg.dev/js/bootstrap.min.js"></script>
|
||||
<script src="/js/webappdemo.js?6"></script>
|
||||
<script src="/js/webappdemo.js?7"></script>
|
||||
<script>
|
||||
Telegram.WebApp.onEvent('themeChanged', function() {
|
||||
$('#theme_data').html(JSON.stringify(Telegram.WebApp.themeParams, null, 2));
|
||||
|
|
|
@ -147,13 +147,13 @@ var DemoApp = {
|
|||
return false;
|
||||
},
|
||||
testClipboard: function(el) {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.readText().then(function(clipText) {
|
||||
Telegram.WebApp.readTextFromClipboard(function(clipText) {
|
||||
if (clipText === null) {
|
||||
$(el).next('span').html('Clipboard text unavailable.').attr('class', 'err');
|
||||
} else {
|
||||
$(el).next('span').text('(Read from clipboard: «' + clipText + '»)').attr('class', 'ok');
|
||||
});
|
||||
} else {
|
||||
$(el).next('span').html('Clipboard is not available in this browser.').attr('class', 'err');
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
toggleMainButton: function(el) {
|
||||
|
@ -188,6 +188,15 @@ var DemoApp = {
|
|||
}
|
||||
});
|
||||
},
|
||||
showScanQrPopup: function() {
|
||||
Telegram.WebApp.showScanQrPopup({
|
||||
text: 'for test purposes'
|
||||
}, function(text) {
|
||||
if (text !== null) {
|
||||
DemoApp.showAlert(text);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
apiRequest: function(method, data, onCallback) {
|
||||
var authData = DemoApp.initData || '';
|
||||
|
|
Loading…
Reference in a new issue