Update content of files

This commit is contained in:
GitHub Action 2022-05-24 10:59:29 +00:00
parent 4bab7b88a2
commit 72d18f2db6
3 changed files with 12 additions and 7 deletions

View file

@ -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?10"></script>
<script src="https://tg.dev/js/telegram-web-app.js?11"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;
@ -441,7 +441,7 @@
</div>
<script src="https://tg.dev/js/jquery.min.js"></script>
<script src="https://tg.dev/js/tgsticker.js?27"></script>
<script src="/js/cafe.js?20"></script>
<script src="/js/cafe.js?21"></script>
<script>Cafe.init({"apiUrl":"\/cafe\/api","userId":0,"userHash":null});</script>
</body>
</html>

View file

@ -8,7 +8,7 @@
<meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex,nofollow" />
<script src="https://telegram.org/js/telegram-web-app.js?10"></script>
<script src="https://telegram.org/js/telegram-web-app.js?11"></script>
<script>
function setThemeClass() {
document.documentElement.className = Telegram.WebApp.colorScheme;
@ -188,9 +188,9 @@
</ul>
<p>Haptics:</p>
<ul>
<li>Impact: <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccupped('heavy');">heavy</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccupped('light');">light</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccupped('medium');">medium</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccupped('rigid');">rigid</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccupped('soft');">soft</a></li>
<li>Notification: <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('error');">error</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('success');">success</a>, <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('warning');">warning</a></li>
<li>Selection: <a href="javascript:Telegram.WebApp.HapticFeedback.selectionChanged();">changed</a></li>
<li>Impact: <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccurred('heavy');">heavy</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccurred('light');">light</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccurred('medium');">medium</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccurred('rigid');">rigid</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.impactOccurred('soft');">soft</a><br><br></li>
<li>Notification: <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('error');">error</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('success');">success</a>, &nbsp; <a href="javascript:Telegram.WebApp.HapticFeedback.notificationOccurred('warning');">warning</a><br><br></li>
<li>Selection: <a href="javascript:Telegram.WebApp.HapticFeedback.selectionChanged();">changed</a><br><br></li>
</ul>
<pre><code id="webview_data"></code></pre>
<div class="hint">
@ -378,7 +378,7 @@ $('body').css('visibility', '');
Telegram.WebApp.MainButton
.setText('CLOSE WEBVIEW')
.show()
.onClick(function(){ webviewClose(); });
.onClick(webviewClose);
function toggleMainButton(el) {
var mainButton = Telegram.WebApp.MainButton;

View file

@ -54,11 +54,13 @@ var Cafe = {
},
eIncrClicked: function(e) {
e.preventDefault();
Telegram.WebApp.HapticFeedback.impactOccurred('light');
var itemEl = $(this).parents('.js-item');
Cafe.incrClicked(itemEl, 1);
},
eDecrClicked: function(e) {
e.preventDefault();
Telegram.WebApp.HapticFeedback.impactOccurred('light');
var itemEl = $(this).parents('.js-item');
Cafe.incrClicked(itemEl, -1);
},
@ -278,8 +280,10 @@ var Cafe = {
if (status == 'paid') {
Telegram.WebApp.close();
} else if (status == 'failed') {
Telegram.WebApp.HapticFeedback.notificationOccurred('error');
Cafe.showStatus('Payment has been failed.');
} else {
Telegram.WebApp.HapticFeedback.notificationOccurred('warning');
Cafe.showStatus('You have cancelled this order.');
}
});
@ -288,6 +292,7 @@ var Cafe = {
}
}
if (result.error) {
Telegram.WebApp.HapticFeedback.notificationOccurred('error');
Cafe.showStatus(result.error);
}
});