Skip to content

Commit

Permalink
Merge branch 'upstream' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdnx committed Mar 14, 2024
2 parents cdb15cb + 8a3441f commit 7a1000e
Show file tree
Hide file tree
Showing 34 changed files with 307 additions and 276 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ jobs:
- name: First set up.
run: |
sudo chown -R `whoami`:admin /usr/local/share
brew install automake ninja pkg-config nasm meson
brew update
brew upgrade || true
brew install automake meson nasm ninja pkg-config
# Disable spotlight.
sudo mdutil -a -i off
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
[submodule "Telegram/lib_webview"]
path = Telegram/lib_webview
url = https://github.com/desktop-app/lib_webview.git
[submodule "Telegram/ThirdParty/jemalloc"]
path = Telegram/ThirdParty/jemalloc
url = https://github.com/jemalloc/jemalloc
[submodule "Telegram/ThirdParty/dispatch"]
path = Telegram/ThirdParty/dispatch
url = https://github.com/apple/swift-corelibs-libdispatch
Expand Down
36 changes: 24 additions & 12 deletions Telegram/Resources/iv_html/page.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
:root {
--font-sans: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, tahoma, arial, sans-serif;
--font-serif: Iowan Old Style, Apple Garamond, Baskerville, Georgia, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
--font-mono: Menlo, Cascadia Code, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
}

body {
font-family: 'Helvetica Neue';
font-family: var(--font-sans);
font-size: 17px;
line-height: 25px;
padding: 0;
Expand Down Expand Up @@ -82,6 +88,12 @@ html.custom_scroll ::-webkit-scrollbar-thumb:hover {
opacity: 1;
}
}
#menu_page_blocker {
z-index: 999;
position: fixed;
width: 100%;
height: 100%;
}
#top_shadow {
z-index: 999;
position: fixed;
Expand Down Expand Up @@ -145,7 +157,7 @@ article {
}
article h1,
article h2 {
font-family: 'Georgia';
font-family: var(--font-serif);
font-size: 28px;
line-height: 31px;
margin: 21px 18px 12px;
Expand Down Expand Up @@ -237,10 +249,10 @@ article ol p {
}
article pre,
article pre.hljs {
font-family: Menlo;
font-family: var(--font-mono);
margin: 14px 0;
padding: 7px 18px;
background: #F5F8FC;
background: var(--td-box-divider-bg);
font-size: 16px;
white-space: pre-wrap;
word-wrap: break-word;
Expand All @@ -265,7 +277,7 @@ article pre + pre {
}
article h3,
article h4 {
font-family: 'Georgia';
font-family: var(--font-serif);
font-size: 24px;
line-height: 30px;
margin: 18px 18px 9px;
Expand All @@ -284,7 +296,7 @@ article ol h4 {
margin: 10px 0 5px;
}
article blockquote {
font-family: 'Georgia';
font-family: var(--font-serif);
margin: 18px 18px 16px;
padding-left: 22px;
position: relative;
Expand All @@ -310,7 +322,7 @@ article.rtl blockquote:before {
left: auto;
}
article aside {
font-family: 'Georgia';
font-family: var(--font-serif);
margin: 18px 18px 16px;
padding: 0 18px;
text-align: center;
Expand All @@ -326,7 +338,7 @@ article blockquote cite,
article aside cite,
article footer cite,
article .pullquote cite {
font-family: 'Helvetica Neue';
font-family: var(--font-sans);
font-size: 15px;
display: block;
color: var(--td-window-sub-text-fg);
Expand Down Expand Up @@ -601,7 +613,7 @@ ol figcaption {
padding-right: 0;
}
figcaption > cite {
font-family: 'Helvetica Neue';
font-family: var(--font-sans);
font-size: 12px;
display: block;
line-height: 15px;
Expand Down Expand Up @@ -855,7 +867,7 @@ section.related {
margin: 7px 0 12px;
}
section.related h4 {
font-family: 'Helvetica Neue';
font-family: var(--font-sans);
font-size: 17px;
line-height: 26px;
font-weight: 500;
Expand Down Expand Up @@ -993,10 +1005,10 @@ section.channel > a > div.join:hover {
text-decoration: underline;
}
section.channel > a > div.join span:before {
content: var(--td-lng-group-call-join);
content: var(--td-lng-iv-join-channel);
}
section.channel > a > h4 {
font-family: 'Helvetica Neue';
font-family: var(--font-sans);
font-size: 17px;
line-height: 26px;
font-weight: 500;
Expand Down
42 changes: 39 additions & 3 deletions Telegram/Resources/iv_html/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ var IV = {
var target = e.target;
var context = '';
while (target) {
if (target.id == 'menu_page_blocker') {
IV.notify({ event: 'menu_page_blocker_click' });
IV.menuShown(false);
return;
}
if (target.tagName == 'AUDIO' || target.tagName == 'VIDEO') {
return;
}
Expand Down Expand Up @@ -122,12 +127,17 @@ var IV = {
}
},
toggleChannelJoined: function (id, joined) {
IV.channelsJoined['channel' + id] = joined;
IV.checkChannelButtons();
},
checkChannelButtons: function() {
const channels = document.getElementsByClassName('channel');
const full = 'channel' + id;
for (var i = 0; i < channels.length; ++i) {
const channel = channels[i];
if (String(channel.getAttribute('data-context')) === full) {
channel.classList.toggle('joined', joined);
const full = String(channel.getAttribute('data-context'));
const value = IV.channelsJoined[full];
if (value !== undefined) {
channel.classList.toggle('joined', value);
}
}
},
Expand Down Expand Up @@ -320,6 +330,7 @@ var IV = {
+ '" type="video/mp4" />'
+ '</video>';
var media = element.firstChild;
media.oncontextmenu = function () { return false; };
media.oncanplay = IV.checkVideos;
media.onloadeddata = IV.checkVideos;
}
Expand Down Expand Up @@ -414,6 +425,15 @@ var IV = {
&& (fromEl.getAttribute('data-src')
== toEl.getAttribute('data-src'))) {
return false;
} else if (fromEl.tagName == 'SECTION'
&& fromEl.classList.contains('channel')
&& fromEl.hasAttribute('data-context')
&& toEl.tagName == 'SECTION'
&& toEl.classList.contains('channel')
&& toEl.hasAttribute('data-context')
&& (String(fromEl.getAttribute('data-context'))
== String(toEl.getAttribute('data-context')))) {
return false;
} else if (fromEl.classList.contains('loaded')) {
toEl.classList.add('loaded');
}
Expand Down Expand Up @@ -568,6 +588,7 @@ var IV = {
} else {
IV.initMedia();
}
IV.checkChannelButtons();
if (scroll === undefined) {
IV.jumpToHash(hash, true);
} else {
Expand Down Expand Up @@ -599,11 +620,26 @@ var IV = {
back: function () {
window.history.back();
},
menuShown: function (shown) {
var already = document.getElementById('menu_page_blocker');
if (already && shown) {
return;
} else if (already) {
document.body.removeChild(already);
return;
} else if (!shown) {
return;
}
var blocker = document.createElement('div');
blocker.id = 'menu_page_blocker';
document.body.appendChild(blocker);
},

videos: {},
videosPlaying: {},

cache: {},
channelsJoined: {},
index: 0,
position: 0
};
Expand Down
2 changes: 2 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -4869,6 +4869,8 @@ https://github.com/rabbitgramdesktop/rabbitgramdesktop/blob/dev/LEGAL

"lng_iv_open_in_browser" = "Open in Browser";
"lng_iv_share" = "Share";
"lng_iv_join_channel" = "Join";
"lng_iv_window_title" = "Instant View";

// Wnd specific

Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="4.15.3.0" />
Version="4.15.4.0" />
<Properties>
<DisplayName>rabbitGram Desktop</DisplayName>
<PublisherDisplayName>xmdnx</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,15,3,0
PRODUCTVERSION 4,15,3,0
FILEVERSION 4,15,4,0
PRODUCTVERSION 4,15,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "xmdnx"
VALUE "FileDescription", "rabbitGram Desktop"
VALUE "FileVersion", "4.15.3.0"
VALUE "FileVersion", "4.15.4.0"
VALUE "LegalCopyright", "Copyright (C) 2023-2024"
VALUE "ProductName", "rabbitGram Desktop"
VALUE "ProductVersion", "4.15.3.0"
VALUE "ProductVersion", "4.15.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,15,3,0
PRODUCTVERSION 4,15,3,0
FILEVERSION 4,15,4,0
PRODUCTVERSION 4,15,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "xmdnx"
VALUE "FileDescription", "rabbitGram Desktop Updater"
VALUE "FileVersion", "4.15.3.0"
VALUE "FileVersion", "4.15.4.0"
VALUE "LegalCopyright", "Copyright (C) 2023-2024"
VALUE "ProductName", "rabbitGram Desktop"
VALUE "ProductVersion", "4.15.3.0"
VALUE "ProductVersion", "4.15.4.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit 7a1000e

Please sign in to comment.