mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-03-15 13:22:43 +01:00
Update content of files
This commit is contained in:
parent
d7fc60e40d
commit
7cf989be01
6 changed files with 203 additions and 29 deletions
|
@ -6,6 +6,13 @@
|
|||
<item>
|
||||
<title>Telegram macOS</title>
|
||||
<description>• Bug fixes, minor improvements, and more.</description>
|
||||
<pubDate>2023-25-08 12:34:19</pubDate>
|
||||
<enclosure sparkle:version="250846" sparkle:shortVersionString="10.0.2" sparkle:dsaSignature="MCwCFEgpSBZVVXjvyByk4qmAD8YL492uAhRDJH8YJ86skbGnbUdCwkc0EF1sHg==" url="https://osx.telegram.org/updates/Telegram-10.0.2.250846.app.zip" length="92257148" forbidden="false" critical="false" environment="updates" fileName="Telegram-10.0.2.250846.app.zip" internalUrl="https://t.me/macos_stable_updates_files/194" dmgName="Telegram-10.0.2.250846.dmg" type="application/octet-stream"/>
|
||||
<sparkle:minimumSystemVersion>10.12</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
<item>
|
||||
<title>Telegram macOS</title>
|
||||
<description>• Bug fixes, minor improvements, and more.</description>
|
||||
<pubDate>2023-18-08 19:33:26</pubDate>
|
||||
<enclosure sparkle:version="250718" sparkle:shortVersionString="10.0.1" sparkle:dsaSignature="MCwCFEWXOuvcM/KM3uM1UqykdR/l7S3ZAhQY5hQkOjW8YgxJQR+UXs8hZgTVuw==" url="https://osx.telegram.org/updates/Telegram-10.0.1.250718.app.zip" length="92231019" forbidden="false" critical="false" environment="updates" fileName="Telegram-10.0.1.250718.app.zip" internalUrl="https://t.me/macos_stable_updates_files/193" dmgName="Telegram-10.0.1.250718.dmg" type="application/octet-stream"/>
|
||||
<sparkle:minimumSystemVersion>10.12</sparkle:minimumSystemVersion>
|
||||
|
@ -136,12 +143,5 @@
|
|||
<enclosure sparkle:version="244583" sparkle:shortVersionString="9.5.1" sparkle:dsaSignature="MC0CFFMajijcT9qskGpRHauRvOSdZu01AhUAhAlL/N+GsAjUGZAftL9yDRwF+oM=" url="https://osx.telegram.org/updates/Telegram-9.5.1.244583.app.zip" length="87500992" forbidden="false" critical="false" environment="updates" fileName="Telegram-9.5.1.244583.app.zip" internalUrl="https://t.me/macos_stable_updates_files/174" dmgName="Telegram-9.5.1.244583.dmg" type="application/octet-stream"/>
|
||||
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
<item>
|
||||
<title>Telegram macOS</title>
|
||||
<description>Power Saving Mode<br>• New switch to disable all resource-intensive processes with one click.<br>• Individual autoplay settings for videos, GIFs, stickers, animated emoji and more.<br>• Power saving mode turns on automatically based on battery charge.<br><br>• Bug fixes, performance improvements and all that jazz.</description>
|
||||
<pubDate>2023-15-03 18:05:58</pubDate>
|
||||
<enclosure sparkle:version="244466" sparkle:shortVersionString="9.5.1" sparkle:dsaSignature="MCwCFBIEUn8K6oIbf9htsKUlr3DPaaVwAhRych/iGyui55DwiyMA2R85KK0F3A==" url="https://osx.telegram.org/updates/Telegram-9.5.1.244466.app.zip" length="88217197" forbidden="false" critical="false" environment="updates" fileName="Telegram-9.5.1.244466.app.zip" internalUrl="https://t.me/macos_stable_updates_files/173" dmgName="Telegram-9.5.1.244466.dmg" type="application/octet-stream"/>
|
||||
<sparkle:minimumSystemVersion>10.12</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
|
@ -408,12 +408,20 @@
|
|||
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)];
|
||||
var webAppCallbacks = {};
|
||||
function generateCallbackId(len) {
|
||||
var tries = 100;
|
||||
while (--tries) {
|
||||
var id = '', chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', chars_len = chars.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
id += chars[Math.floor(Math.random() * chars_len)];
|
||||
}
|
||||
if (!webAppCallbacks[id]) {
|
||||
webAppCallbacks[id] = {};
|
||||
return id;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
throw Error('WebAppCallbackIdGenerateFailed');
|
||||
}
|
||||
|
||||
var viewportHeight = false, viewportStableHeight = false, isExpanded = true;
|
||||
|
@ -949,6 +957,42 @@
|
|||
return hapticFeedback;
|
||||
})();
|
||||
|
||||
var CloudStorage = (function() {
|
||||
var cloudStorage = {};
|
||||
|
||||
function invokeStorageMethod(method, params, callback) {
|
||||
if (!versionAtLeast('6.9')) {
|
||||
console.error('[Telegram.WebApp] CloudStorage is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
invokeCustomMethod(method, params, callback);
|
||||
return cloudStorage;
|
||||
}
|
||||
|
||||
cloudStorage.setItem = function(key, value, callback) {
|
||||
return invokeStorageMethod('saveStorageValue', {key: key, value: value}, callback);
|
||||
};
|
||||
cloudStorage.getItem = function(key, callback) {
|
||||
return cloudStorage.getItems([key], callback ? function(err, res) {
|
||||
if (err) callback(err);
|
||||
else callback(res[key]);
|
||||
} : null);
|
||||
};
|
||||
cloudStorage.getItems = function(keys, callback) {
|
||||
return invokeStorageMethod('getStorageValues', {keys: keys}, callback);
|
||||
};
|
||||
cloudStorage.removeItem = function(key, callback) {
|
||||
return cloudStorage.removeItems([key], callback);
|
||||
};
|
||||
cloudStorage.removeItems = function(keys, callback) {
|
||||
return invokeStorageMethod('deleteStorageValues', {keys: keys}, callback);
|
||||
};
|
||||
cloudStorage.getKeys = function(callback) {
|
||||
return invokeStorageMethod('getStorageKeys', {}, callback);
|
||||
};
|
||||
return cloudStorage;
|
||||
})();
|
||||
|
||||
var webAppInvoices = {};
|
||||
function onInvoiceClosed(eventType, eventData) {
|
||||
if (eventData.slug && webAppInvoices[eventData.slug]) {
|
||||
|
@ -1005,11 +1049,10 @@
|
|||
webAppScanQrPopupOpened = false;
|
||||
}
|
||||
|
||||
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];
|
||||
if (eventData.req_id && webAppCallbacks[eventData.req_id]) {
|
||||
var requestData = webAppCallbacks[eventData.req_id];
|
||||
delete webAppCallbacks[eventData.req_id];
|
||||
var data = null;
|
||||
if (typeof eventData.data !== 'undefined') {
|
||||
data = eventData.data;
|
||||
|
@ -1023,6 +1066,64 @@
|
|||
}
|
||||
}
|
||||
|
||||
var WebAppWriteAccessRequested = false;
|
||||
function onWriteAccessRequested(eventType, eventData) {
|
||||
if (WebAppWriteAccessRequested) {
|
||||
var requestData = WebAppWriteAccessRequested;
|
||||
WebAppWriteAccessRequested = false;
|
||||
if (requestData.callback) {
|
||||
requestData.callback(eventData.status == 'allowed');
|
||||
}
|
||||
receiveWebViewEvent('writeAccessRequested', {
|
||||
status: eventData.status
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var WebAppContactRequested = false;
|
||||
function onPhoneRequested(eventType, eventData) {
|
||||
if (WebAppContactRequested) {
|
||||
var requestData = WebAppContactRequested;
|
||||
WebAppContactRequested = false;
|
||||
if (requestData.callback) {
|
||||
requestData.callback(eventData.status == 'sent');
|
||||
}
|
||||
receiveWebViewEvent('contactRequested', {
|
||||
status: eventData.status
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onCustomMethodInvoked(eventType, eventData) {
|
||||
if (eventData.req_id && webAppCallbacks[eventData.req_id]) {
|
||||
var requestData = webAppCallbacks[eventData.req_id];
|
||||
delete webAppCallbacks[eventData.req_id];
|
||||
var res = null, err = null;
|
||||
if (typeof eventData.result !== 'undefined') {
|
||||
res = eventData.result;
|
||||
}
|
||||
if (typeof eventData.error !== 'undefined') {
|
||||
err = eventData.error;
|
||||
}
|
||||
if (requestData.callback) {
|
||||
requestData.callback(err, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function invokeCustomMethod(method, params, callback) {
|
||||
if (!versionAtLeast('6.9')) {
|
||||
console.error('[Telegram.WebApp] Method invokeCustomMethod is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
var req_id = generateCallbackId(16);
|
||||
var req_params = {req_id: req_id, method: method, params: params || {}};
|
||||
webAppCallbacks[req_id] = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_invoke_custom_method', false, req_params);
|
||||
};
|
||||
|
||||
if (!window.Telegram) {
|
||||
window.Telegram = {};
|
||||
}
|
||||
|
@ -1090,6 +1191,10 @@
|
|||
value: HapticFeedback,
|
||||
enumerable: true
|
||||
});
|
||||
Object.defineProperty(WebApp, 'CloudStorage', {
|
||||
value: CloudStorage,
|
||||
enumerable: true
|
||||
});
|
||||
WebApp.setHeaderColor = function(color_key) {
|
||||
WebApp.headerColor = color_key;
|
||||
};
|
||||
|
@ -1374,13 +1479,44 @@
|
|||
console.error('[Telegram.WebApp] Method readTextFromClipboard is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
var req_id = generateId(16);
|
||||
var req_id = generateCallbackId(16);
|
||||
var req_params = {req_id: req_id};
|
||||
webAppClipboardRequests[req_id] = {
|
||||
webAppCallbacks[req_id] = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_read_text_from_clipboard', false, req_params);
|
||||
};
|
||||
WebApp.requestWriteAccess = function (callback) {
|
||||
if (!versionAtLeast('6.9')) {
|
||||
console.error('[Telegram.WebApp] Method requestWriteAccess is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
if (WebAppWriteAccessRequested) {
|
||||
console.error('[Telegram.WebApp] Write access is already requested');
|
||||
throw Error('WebAppWriteAccessRequested');
|
||||
}
|
||||
WebAppWriteAccessRequested = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_request_write_access');
|
||||
};
|
||||
WebApp.requestContact = function (callback) {
|
||||
if (!versionAtLeast('6.9')) {
|
||||
console.error('[Telegram.WebApp] Method requestContact is not supported in version ' + webAppVersion);
|
||||
throw Error('WebAppMethodUnsupported');
|
||||
}
|
||||
if (WebAppContactRequested) {
|
||||
console.error('[Telegram.WebApp] Contact is already requested');
|
||||
throw Error('WebAppContactRequested');
|
||||
}
|
||||
WebAppContactRequested = {
|
||||
callback: callback
|
||||
};
|
||||
WebView.postEvent('web_app_request_phone');
|
||||
};
|
||||
WebApp.invokeCustomMethod = function (method, params, callback) {
|
||||
invokeCustomMethod(method, params, callback);
|
||||
};
|
||||
WebApp.ready = function () {
|
||||
WebView.postEvent('web_app_ready');
|
||||
};
|
||||
|
@ -1408,6 +1544,9 @@
|
|||
WebView.onEvent('qr_text_received', onQrTextReceived);
|
||||
WebView.onEvent('scan_qr_popup_closed', onScanQrPopupClosed);
|
||||
WebView.onEvent('clipboard_text_received', onClipboardTextReceived);
|
||||
WebView.onEvent('write_access_requested', onWriteAccessRequested);
|
||||
WebView.onEvent('phone_requested', onPhoneRequested);
|
||||
WebView.onEvent('custom_method_invoked', onCustomMethodInvoked);
|
||||
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?29"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?30"></script>
|
||||
<script>
|
||||
function setThemeClass() {
|
||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||
|
|
|
@ -174,6 +174,7 @@ pre {
|
|||
}
|
||||
.columns>* {
|
||||
flex-grow: 1;
|
||||
flex-basis: 20%;
|
||||
}
|
||||
.hint {
|
||||
font-size: .8em;
|
||||
|
|
|
@ -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?29"></script>
|
||||
<script src="https://tg.dev/js/telegram-web-app.js?30"></script>
|
||||
<script>
|
||||
function setThemeClass() {
|
||||
document.documentElement.className = Telegram.WebApp.colorScheme;
|
||||
|
@ -19,7 +19,7 @@
|
|||
</script>
|
||||
<link href="https://tg.dev/css/bootstrap.min.css?3" rel="stylesheet">
|
||||
<link href="https://tg.dev/css/bootstrap-extra.css?2" rel="stylesheet">
|
||||
<link href="/css/webappdemo.css?5" rel="stylesheet">
|
||||
<link href="/css/webappdemo.css?6" rel="stylesheet">
|
||||
</head>
|
||||
<body class="" style="visibility: hidden;">
|
||||
<section id="top_sect" class="second">
|
||||
|
@ -60,13 +60,20 @@
|
|||
<li><a href="javascript:Telegram.WebApp.openTelegramLink('https://t.me/DurgerKingBot/menu');">web_app_open_tg_link(webapp_direct_link)</a> (opens with confirm for the first time, then without)</li>
|
||||
</ul>
|
||||
<p>Test permissions:</p>
|
||||
<ul>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestLocation(this);">Request Location</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestVideo(this);">Request Video</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestAudio(this);">Request Audio</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestAudioVideo(this);">Request Audio+Video</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.testClipboard(this);" id="clipboard_test">Read from clipboard</a> <span></span></li>
|
||||
</ul>
|
||||
<div class="columns">
|
||||
<ul>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestLocation(this);">Request Location</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestVideo(this);">Request Video</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestAudio(this);">Request Audio</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestAudioVideo(this);">Request Audio+Video</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.testClipboard(this);" id="clipboard_test">Read from clipboard</a> <span></span></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestWriteAccess(this);">Request write access</a> <span></span></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestPhoneNumber(this);">Request phone number</a> <span></span><br><br></li>
|
||||
<li><a href="javascript:;" onclick="return DemoApp.requestServerTime(this);">Request server time</a> (invokes custom method) <span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>Test alerts:</p>
|
||||
<div class="columns">
|
||||
<ul>
|
||||
|
@ -106,7 +113,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?11"></script>
|
||||
<script src="/js/webappdemo.js?12"></script>
|
||||
<script>
|
||||
Telegram.WebApp.onEvent('themeChanged', function() {
|
||||
$('#theme_data').html(JSON.stringify(Telegram.WebApp.themeParams, null, 2));
|
||||
|
|
|
@ -172,6 +172,33 @@ var DemoApp = {
|
|||
});
|
||||
return false;
|
||||
},
|
||||
requestWriteAccess: function(el) {
|
||||
Telegram.WebApp.requestWriteAccess(function(allowed) {
|
||||
if (allowed) {
|
||||
$(el).next('span').text('(Access granted)').attr('class', 'ok');
|
||||
} else {
|
||||
$(el).next('span').html('(User declined this request)').attr('class', 'err');
|
||||
}
|
||||
});
|
||||
},
|
||||
requestPhoneNumber: function(el) {
|
||||
Telegram.WebApp.requestContact(function(sent) {
|
||||
if (sent) {
|
||||
$(el).next('span').text('(Phone number sent to the bot)').attr('class', 'ok');
|
||||
} else {
|
||||
$(el).next('span').html('(User declined this request)').attr('class', 'err');
|
||||
}
|
||||
});
|
||||
},
|
||||
requestServerTime: function(el) {
|
||||
Telegram.WebApp.invokeCustomMethod('getCurrentTime', {}, function(err, time) {
|
||||
if (err) {
|
||||
$(el).next('span').html('(' + cleanHTML(err) + ')').attr('class', 'err');
|
||||
} else {
|
||||
$(el).next('span').text('(' + (new Date(time*1000)).toString() + ')').attr('class', 'ok');
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleMainButton: function(el) {
|
||||
if (DemoApp.MainButton.isVisible) {
|
||||
DemoApp.MainButton.hide();
|
||||
|
|
Loading…
Add table
Reference in a new issue