From f2a602b455a006fb162890a6910e1d928d7d4ab0 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 10 Nov 2014 21:33:37 +0300 Subject: [PATCH] Added new embeds Added 0.3.3 changelog --- app/css/app.css | 39 +++++++++++++++-------- app/js/lib/mtproto_wrapper.js | 2 +- app/js/lib/ng_utils.js | 13 +++++++- app/js/services.js | 38 ++++++++++++++++------ app/partials/desktop/changelog_modal.html | 17 +++++++++- package.json | 2 +- 6 files changed, 83 insertions(+), 28 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 0a3ca666..42e128ef 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1293,20 +1293,31 @@ div.im_message_video_thumb { background-image: url(../img/icons/IconsetW_1x.png); } -.im_message_iframe_video { - position: relative; - padding-bottom: 56.25%; /* 16/9 ratio */ - height: 0; - overflow: hidden; - margin-top: 5px; -} -.im_message_iframe_video iframe, -.im_message_iframe_video webview { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; +.im_message_media_embed { + position: relative; + height: 0; + overflow: hidden; + margin-top: 5px; +} +.im_message_video_embed { + padding-bottom: 56.25%; /* 16/9 ratio */ +} +.im_message_insta_embed { + padding-bottom: 122%; +} +.im_message_vine_embed { + padding-bottom: 100%; +} +.im_message_media_embed iframe, +.im_message_media_embed webview { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.im_message_twitter_embed > blockquote { + visibility: hidden; } .im_message_gif_wrap { diff --git a/app/js/lib/mtproto_wrapper.js b/app/js/lib/mtproto_wrapper.js index ea7bd883..e7363014 100644 --- a/app/js/lib/mtproto_wrapper.js +++ b/app/js/lib/mtproto_wrapper.js @@ -251,7 +251,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) function downloadCheck(dcID) { var downloadPull = downloadPulls[dcID]; - var downloadLimit = dcID == 'upload' ? 17 : 5; + var downloadLimit = dcID == 'upload' ? 11 : 5; if (downloadActives[dcID] >= downloadLimit || !downloadPull || !downloadPull.length) { return false; diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index 929cd58a..61fa441b 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -727,6 +727,7 @@ angular.module('izhukov.utils', []) .service('ExternalResourcesManager', function ($q, $http) { var urlPromises = {}; + var twitterAttached = false; function downloadImage (url) { if (urlPromises[url] !== undefined) { @@ -740,8 +741,18 @@ angular.module('izhukov.utils', []) }); } + function attachTwitterScript () { + twitterAttached = true; + + $('