Update content of files

This commit is contained in:
GitHub Action 2023-03-01 20:29:41 +00:00
parent 45f59d370e
commit 52dfb9c60e
2 changed files with 17 additions and 1 deletions

View file

@ -105,7 +105,7 @@
<div class="viewport-stable_border"></div> <div class="viewport-stable_border"></div>
<script src="/js/jquery.min.js"></script> <script src="/js/jquery.min.js"></script>
<script src="https://tg.dev/js/bootstrap.min.js"></script> <script src="https://tg.dev/js/bootstrap.min.js"></script>
<script src="/js/webappdemo.js?10"></script> <script src="/js/webappdemo.js?11"></script>
<script> <script>
Telegram.WebApp.onEvent('themeChanged', function() { Telegram.WebApp.onEvent('themeChanged', function() {
$('#theme_data').html(JSON.stringify(Telegram.WebApp.themeParams, null, 2)); $('#theme_data').html(JSON.stringify(Telegram.WebApp.themeParams, null, 2));

View file

@ -106,6 +106,22 @@ var DemoApp = {
Telegram.WebApp.sendData(new Date().toString()); Telegram.WebApp.sendData(new Date().toString());
} }
}, },
switchInlineQuery: function(query, choose_chat) {
var choose_chat_types = false;
if (choose_chat) {
var choose_chat_types = [];
var types = ['users', 'bots', 'groups', 'channels'];
for (var i = 0; i < types.length; i++) {
if ($('#select-' + types[i]).prop('checked')) {
choose_chat_types.push(types[i]);
}
}
if (!choose_chat_types.length) {
return DemoApp.showAlert('Select chat types!');
}
}
Telegram.WebApp.switchInlineQuery(query, choose_chat_types);
},
requestLocation: function(el) { requestLocation: function(el) {
if (navigator.geolocation) { if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) { navigator.geolocation.getCurrentPosition(function (position) {