mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-23 15:58:27 +01:00
Update content of files
This commit is contained in:
parent
7531073410
commit
b8b34b3205
3 changed files with 13 additions and 3 deletions
|
@ -284,6 +284,7 @@
|
|||
var webAppInitData = '', webAppInitDataUnsafe = {};
|
||||
var themeParams = {}, colorScheme = 'light';
|
||||
var webAppVersion = '6.0';
|
||||
var webAppPlatform = 'unknown';
|
||||
|
||||
if (initParams.tgWebAppData && initParams.tgWebAppData.length) {
|
||||
webAppInitData = initParams.tgWebAppData;
|
||||
|
@ -314,6 +315,9 @@
|
|||
if (initParams.tgWebAppVersion) {
|
||||
webAppVersion = initParams.tgWebAppVersion;
|
||||
}
|
||||
if (initParams.tgWebAppPlatform) {
|
||||
webAppPlatform = initParams.tgWebAppPlatform;
|
||||
}
|
||||
|
||||
function onThemeChanged(eventType, eventData) {
|
||||
if (eventData.theme_params) {
|
||||
|
@ -986,6 +990,10 @@
|
|||
get: function(){ return webAppVersion; },
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(WebApp, 'platform', {
|
||||
get: function(){ return webAppPlatform; },
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(WebApp, 'colorScheme', {
|
||||
get: function(){ return colorScheme; },
|
||||
enumerable: true
|
||||
|
|
|
@ -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?24"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?25"></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?24"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?25"></script>
|
||||
<script>
|
||||
function setThemeClass() {
|
||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||
|
@ -92,7 +92,8 @@
|
|||
Theme params
|
||||
</div>
|
||||
<div class="hint">
|
||||
Version: <span id="ver"></span>
|
||||
Version: <span id="ver"></span>,
|
||||
platform: <span id="platform"></span>
|
||||
</div>
|
||||
</section>
|
||||
<div class="viewport-border"></div>
|
||||
|
@ -114,6 +115,7 @@ $('#regular_link').attr('href', $('#regular_link').attr('href') + location.hash)
|
|||
$('#text_field').focus();
|
||||
|
||||
$('#ver').text(Telegram.WebApp.version);
|
||||
$('#platform').text(Telegram.WebApp.platform);
|
||||
|
||||
if (DemoApp.initDataUnsafe.receiver) {
|
||||
$('#peer_wrap').show();
|
||||
|
|
Loading…
Reference in a new issue