diff --git a/data/web/telegram.org/css/widget-frame.css b/data/web/telegram.org/css/widget-frame.css
index 804366eca1..592e712b64 100644
--- a/data/web/telegram.org/css/widget-frame.css
+++ b/data/web/telegram.org/css/widget-frame.css
@@ -170,6 +170,7 @@ a:hover .emoji > b {
height: 1.25em;
vertical-align: top;
display: inline-block;
+ box-sizing: content-box;
white-space: nowrap;
overflow: hidden;
position: relative;
diff --git a/data/web/telegram.org/js/promote.js b/data/web/telegram.org/js/promote.js
index 51dbfc34c9..a7082da658 100644
--- a/data/web/telegram.org/js/promote.js
+++ b/data/web/telegram.org/js/promote.js
@@ -649,9 +649,13 @@ var NewAd = {
state.intersectTopicsCheckbox = state.$form.field('intersect_topics');
state.intersectTopicsCheckbox.on('change.curPage', NewAd.onIntersectTopicsChange);
state.excludePoliticCheckbox = state.$form.field('exclude_politic');
- state.excludePoliticCheckbox.on('change.curPage', NewAd.onExcludePoliticChange);
+ state.excludePoliticCheckbox.on('change.curPage', NewAd.onExcludeChannelTopicChange);
state.onlyPoliticCheckbox = state.$form.field('only_politic');
- state.onlyPoliticCheckbox.on('change.curPage', NewAd.onOnlyPoliticChange);
+ state.onlyPoliticCheckbox.on('change.curPage', NewAd.onOnlyChannelTopicChange);
+ state.excludeCryptoCheckbox = state.$form.field('exclude_crypto');
+ state.excludeCryptoCheckbox.on('change.curPage', NewAd.onExcludeChannelTopicChange);
+ state.onlyCryptoCheckbox = state.$form.field('only_crypto');
+ state.onlyCryptoCheckbox.on('change.curPage', NewAd.onOnlyChannelTopicChange);
state.activeRadio = state.$form.field('active');
state.activeRadio.fieldEl().on('change.curPage', NewAd.onActiveChange);
state.useScheduleCheckbox = state.$form.field('use_schedule');
@@ -737,16 +741,20 @@ var NewAd = {
NewAd.updateAdTargetOverview();
NewAd.saveDraftAuto(true);
},
- onExcludePoliticChange: function() {
+ onExcludeChannelTopicChange: function() {
if ($(this).prop('checked')) {
Aj.state.onlyPoliticCheckbox.prop('checked', false);
+ Aj.state.onlyCryptoCheckbox.prop('checked', false);
}
NewAd.updateAdTargetOverview();
NewAd.saveDraftAuto(true);
},
- onOnlyPoliticChange: function() {
+ onOnlyChannelTopicChange: function() {
if ($(this).prop('checked')) {
- Aj.state.excludePoliticCheckbox.prop('checked', false);
+ Aj.state.excludePoliticCheckbox.not(this).prop('checked', false);
+ Aj.state.excludeCryptoCheckbox.not(this).prop('checked', false);
+ Aj.state.onlyPoliticCheckbox.not(this).prop('checked', false);
+ Aj.state.onlyCryptoCheckbox.not(this).prop('checked', false);
}
NewAd.updateAdTargetOverview();
NewAd.saveDraftAuto(true);
@@ -2133,6 +2141,8 @@ var NewAd = {
user_targets = joinTargets(user_targets, false, true);
if (Aj.state.onlyPoliticCheckbox.prop('checked')) {
overview += '
' + l('WEB_AD_TARGET_USERS_ONLY_POLITIC', {target: user_targets}) + '
';
+ } else if (Aj.state.onlyCryptoCheckbox.prop('checked')) {
+ overview += '' + l('WEB_AD_TARGET_USERS_ONLY_CRYPTO', {target: user_targets}) + '
';
} else {
overview += '' + l('WEB_AD_TARGET_USERS', {target: user_targets}) + '
';
}
@@ -2148,6 +2158,9 @@ var NewAd = {
if (Aj.state.excludePoliticCheckbox.prop('checked')) {
overview += '' + l('WEB_AD_TARGET_EXCLUDE_POLITIC') + '
';
}
+ if (Aj.state.excludeCryptoCheckbox.prop('checked')) {
+ overview += '' + l('WEB_AD_TARGET_EXCLUDE_CRYPTO') + '
';
+ }
}
$('.js-exclude-outside').addClass('hide');
} else {
@@ -2202,6 +2215,12 @@ var NewAd = {
if ($form.field('only_politic').prop('checked')) {
values.push('only_politic');
}
+ if ($form.field('exclude_crypto').prop('checked')) {
+ values.push('exclude_crypto');
+ }
+ if ($form.field('only_crypto').prop('checked')) {
+ values.push('only_crypto');
+ }
if ($form.field('exclude_outside').prop('checked')) {
values.push('exclude_outside');
}
@@ -2314,6 +2333,12 @@ var NewAd = {
if ($form.field('only_politic').prop('checked')) {
params.only_politic = 1;
}
+ if ($form.field('exclude_crypto').prop('checked')) {
+ params.exclude_crypto = 1;
+ }
+ if ($form.field('only_crypto').prop('checked')) {
+ params.only_crypto = 1;
+ }
if ($form.field('exclude_outside').prop('checked')) {
params.exclude_outside = 1;
}
@@ -2429,6 +2454,12 @@ var NewAd = {
if ($form.field('only_politic').prop('checked')) {
params.only_politic = 1;
}
+ if ($form.field('exclude_crypto').prop('checked')) {
+ params.exclude_crypto = 1;
+ }
+ if ($form.field('only_crypto').prop('checked')) {
+ params.only_crypto = 1;
+ }
if ($form.field('exclude_outside').prop('checked')) {
params.exclude_outside = 1;
}
@@ -2489,6 +2520,8 @@ var NewAd = {
}
$form.field('exclude_politic').prop('checked', false);
$form.field('only_politic').prop('checked', false);
+ $form.field('exclude_crypto').prop('checked', false);
+ $form.field('only_crypto').prop('checked', false);
$form.field('exclude_outside').prop('checked', false);
$form.field('device').trigger('selectval', ['']);
Aj.state.titleField.focusAndSelect();
diff --git a/data/web/telegram.org/js/telegram-web-app.js b/data/web/telegram.org/js/telegram-web-app.js
index 2cb0affdbe..24f992eb99 100644
--- a/data/web/telegram.org/js/telegram-web-app.js
+++ b/data/web/telegram.org/js/telegram-web-app.js
@@ -1899,7 +1899,7 @@
window.open(url, '_blank');
}
};
- WebApp.openTelegramLink = function (url) {
+ WebApp.openTelegramLink = function (url, options) {
var a = document.createElement('A');
a.href = url;
if (a.protocol != 'http:' &&
@@ -1912,8 +1912,13 @@
throw Error('WebAppTgUrlInvalid');
}
var path_full = a.pathname + a.search;
+ options = options || {};
if (isIframe || versionAtLeast('6.1')) {
- WebView.postEvent('web_app_open_tg_link', false, {path_full: path_full});
+ var req_params = {path_full: path_full};
+ if (options.force_request) {
+ req_params.force_request = true;
+ }
+ WebView.postEvent('web_app_open_tg_link', false, req_params);
} else {
location.href = 'https://t.me' + path_full;
}
diff --git a/data/web/webappcontent.telegram.org/demo.html b/data/web/webappcontent.telegram.org/demo.html
index da93a91d47..9a4fa5ebb1 100644
--- a/data/web/webappcontent.telegram.org/demo.html
+++ b/data/web/webappcontent.telegram.org/demo.html
@@ -102,7 +102,7 @@
Test permissions: