Browse Source

Added changeling

master
Igor Zhukov 9 years ago
parent
commit
7bdba384c9
  1. 28
      app/js/lib/ng_utils.js
  2. 36
      app/less/app.less
  3. 12
      app/partials/desktop/changelog_modal.html
  4. 16
      app/partials/mobile/changelog_modal.html

28
app/js/lib/ng_utils.js

@ -1146,7 +1146,7 @@ angular.module('izhukov.utils', []) @@ -1146,7 +1146,7 @@ angular.module('izhukov.utils', [])
var soundcloudRegExp = /^https?:\/\/(?:soundcloud\.com|snd\.sc)\/([a-zA-Z0-9%\-\_]+)\/([a-zA-Z0-9%\-\_]+)/i;
var spotifyRegExp = /(https?:\/\/(open\.spotify\.com|play\.spotify\.com|spoti\.fi)\/(.+)|spotify:(.+))/i;
var markdownRegExp = /(^|\n)```(.{0,16})\n([\s\S]+?)\n```(\n|$)|(^|\s)`([^\n]+?)`/;
var markdownRegExp = /(^|\s)```([\s\S]+?)```|(^|\s)`([^\n]+?)`/;
var siteHashtags = {
Telegram: '#/im?q=%23{1}',
@ -1319,26 +1319,32 @@ angular.module('izhukov.utils', []) @@ -1319,26 +1319,32 @@ angular.module('izhukov.utils', [])
var raw = text;
var match;
var newText = [];
var rawOffset = 0;
var matchIndex;
while (match = raw.match(markdownRegExp)) {
matchIndex = rawOffset + match.index;
newText.push(raw.substr(0, match.index));
if (match[3]) { // pre
newText.push(match[1] + match[3] + match[4]);
if (match[2]) { // pre
newText.push(match[1] + match[2]);
entities.push({
_: 'messageEntityPre',
language: match[2] || '',
offset: match.index + match[1].length,
length: match[3].length
})
language: '',
offset: matchIndex + match[1].length,
length: match[2].length
});
rawOffset -= 6;
} else { // code
newText.push(match[5] + match[6]);
newText.push(match[3] + match[4]);
entities.push({
_: 'messageEntityCode',
offset: match.index + match[5].length,
length: match[6].length
})
offset: matchIndex + match[3].length,
length: match[4].length
});
rawOffset -= 2;
}
raw = raw.substr(match.index + match[0].length);
rawOffset += match.index + match[0].length;
}
newText.push(raw);
return newText.join('');

36
app/less/app.less

@ -38,6 +38,14 @@ h1, h2, h3, h4, h5 { @@ -38,6 +38,14 @@ h1, h2, h3, h4, h5 {
.user-select(text);
}
pre {
margin-bottom: 0;
max-height: 300px;
overflow: auto;
padding: 3px;
border: 1px solid #dedede;
}
a {
cursor: pointer;
@ -2049,12 +2057,6 @@ a.im_message_fwd_photo { @@ -2049,12 +2057,6 @@ a.im_message_fwd_photo {
word-wrap: break-word;
line-height: 150%;
}
.im_message_text pre {
margin-bottom: 0;
max-height: 300px;
overflow: auto;
padding: 4px;
}
.im_message_photo_caption,
.im_message_video_caption {
clear: both;
@ -3984,12 +3986,12 @@ a.countries_modal_search_clear { @@ -3984,12 +3986,12 @@ a.countries_modal_search_clear {
box-shadow: none;
overflow: visible;
}
.im_dialogs_col_wrap,
.im_bottom_panel_wrap,
.tg_head_logo_wrap,
.tg_head_msgs_edit_btn,
.tg_head_peer_return_btn,
.tg_head_peer_dropdown {
body .im_dialogs_col_wrap,
body .im_bottom_panel_wrap,
body .tg_head_logo_wrap,
body .tg_head_msgs_edit_btn,
body .tg_head_peer_return_btn,
body .tg_head_peer_dropdown {
display: none;
}
body .im_history_wrap {
@ -4001,6 +4003,16 @@ a.countries_modal_search_clear { @@ -4001,6 +4003,16 @@ a.countries_modal_search_clear {
body .nano > .nano-content {
position: static;
}
body .tg_head_peer_info {
text-align: center;
}
body .im_history_col_wrap,
body .tg_head_main_wrap {
width: auto;
max-width: 700px;
float: none;
margin: 0 auto;
}
}

12
app/partials/desktop/changelog_modal.html

@ -31,6 +31,18 @@ @@ -31,6 +31,18 @@
<div class="md_modal_sections">
<div class="md_modal_versioned_section_wrap" ng-if="canShowVersion('0.4.8')">
<div class="md_modal_section_version">0.4.8</div>
<div class="md_modal_section_description changelog_version_changes">
<ul class="list-unstyled changelog_version_changes_list">
<li>Introducing Channels – a great new way to broadcast your messages to unlimited audiences.</li>
<li>Check out the <a href="https://telegram.org/blog/channels" target="_blank">Telegram Blog</a> for more info</li>
<li>Improved performance in Safari on OS X El Capitan.</li>
<li>Added formatting for fixed-width code, surround text with `single backticks` for inline text and ```triple backticks``` for blocks of pre-formatted text.</li>
</ul>
</div>
</div>
<div class="md_modal_versioned_section_wrap" ng-if="canShowVersion('0.4.7')">
<div class="md_modal_section_version">0.4.7</div>
<div class="md_modal_section_description changelog_version_changes">

16
app/partials/mobile/changelog_modal.html

@ -19,9 +19,23 @@ @@ -19,9 +19,23 @@
<div class="modal_section changelog_version_wrap">
<h3 class="modal_section_header changelog_version_title">
Version 0.4.7
Version 0.4.8
<span class="pull-right" my-i18n="changelog_modal_title_current_version"></span>
</h3>
<div class="modal_section_body changelog_version_changes">
<ul class="list-unstyled changelog_version_changes_list">
<li>Introducing Channels – a great new way to broadcast your messages to unlimited audiences.</li>
<li>Check out the <a href="https://telegram.org/blog/channels" target="_blank">Telegram Blog</a> for more info</li>
<li>Improved performance in Safari on OS X El Capitan.</li>
<li>Added formatting for fixed-width code, surround text with `single backticks` for inline text and ```triple backticks``` for blocks of pre-formatted text.</li>
</ul>
</div>
</div>
<div class="modal_section changelog_version_wrap">
<h3 class="modal_section_header changelog_version_title">
Version 0.4.7
</h3>
<div class="modal_section_body changelog_version_changes">
<ul class="list-unstyled changelog_version_changes_list">
<li>New bot API, free for everyone. If you're an engineer, create your own bots for games, services or integrations.

Loading…
Cancel
Save