From 0b15fa8f4b7b314e670e6f228d6528d57556c976 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Wed, 25 Nov 2015 17:53:13 +0300 Subject: [PATCH] Mobile app bugfixes Enable webpage attachment on mobile Closes #892 Closes #880 --- app/js/directives.js | 4 ++-- app/js/messages_manager.js | 5 ++--- app/js/services.js | 5 +++++ app/less/mobile.less | 18 ++++++++++++++++++ app/partials/mobile/channel_modal.html | 2 +- app/partials/mobile/message.html | 6 +++--- .../mobile/message_attach_pending.html | 4 +++- .../mobile/message_attach_webpage.html | 2 +- 8 files changed, 35 insertions(+), 11 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index 0264cff9..7c4d5c8c 100755 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -1563,14 +1563,14 @@ angular.module('myApp.directives', ['myApp.filters']) $(submitBtn).on('mousedown touchstart', onMessageSubmit); function onMessageSubmit (e) { - $scope.$apply(function () { + $timeout(function () { updateValue(); $scope.draftMessage.send(); composer.resetTyping(); if (composerEmojiPanel) { composerEmojiPanel.update(); } - }); + }, Config.Navigator.touch ? 100 : 0); return cancelEvent(e); } diff --git a/app/js/messages_manager.js b/app/js/messages_manager.js index 4ce7028f..698f2766 100644 --- a/app/js/messages_manager.js +++ b/app/js/messages_manager.js @@ -2065,8 +2065,7 @@ angular.module('myApp.services') case 'messageMediaWebPage': if (!message.media.webpage || - message.media.webpage._ == 'webPageEmpty' || - Config.Mobile) { + message.media.webpage._ == 'webPageEmpty') { delete message.media; break; } @@ -2085,7 +2084,7 @@ angular.module('myApp.services') case 'messageActionChatEditTitle': case 'messageActionChannelCreate': case 'messageActionChannelEditTitle': - message.action.rTitle = RichTextProcessor.wrapRichText(message.action.title, {noLinks: true, noLinebreaks: true}) || _('chat_title_deleted'); + message.action.rTitle = RichTextProcessor.wrapRichText(message.action.title, {noLinebreaks: true}) || _('chat_title_deleted'); break; case 'messageActionBotIntro': diff --git a/app/js/services.js b/app/js/services.js index 2a230ddf..197c3360 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -1371,6 +1371,11 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) height: height }; + if (options.website && Config.Mobile) { + width = 50; + height = 50; + } + // console.log('chosen photo size', photoID, thumbPhotoSize); if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') { var dim = calcImageInBox(thumbPhotoSize.w, thumbPhotoSize.h, width, height); diff --git a/app/less/mobile.less b/app/less/mobile.less index 7dba6982..097271ba 100644 --- a/app/less/mobile.less +++ b/app/less/mobile.less @@ -597,6 +597,19 @@ html { } } +.im_message_webpage, +.im_message_webpage_site, +.im_message_webpage_title, +.im_message_webpage_description { + overflow: hidden; + text-overflow: ellipsis; + font-size: 13px; + line-height: 140%; +} +.im_message_webpage_wrap { + padding-left: 6px; +} + .im_message { &_document { position: relative; @@ -695,6 +708,11 @@ html { &_document_thumbed &_download_progress_wrap { width: 130px; } + + &_text { + line-height: 140%; + font-size: 13px; + } } .img_gif_label, diff --git a/app/partials/mobile/channel_modal.html b/app/partials/mobile/channel_modal.html index 482f3f66..c9af1779 100644 --- a/app/partials/mobile/channel_modal.html +++ b/app/partials/mobile/channel_modal.html @@ -21,7 +21,7 @@
  • - +
  • diff --git a/app/partials/mobile/message.html b/app/partials/mobile/message.html index 4d3dc599..c9e1eb0f 100644 --- a/app/partials/mobile/message.html +++ b/app/partials/mobile/message.html @@ -40,7 +40,7 @@ -
    +
    @@ -51,6 +51,8 @@
    +
    +
    @@ -69,8 +71,6 @@
    - -
    diff --git a/app/partials/mobile/message_attach_pending.html b/app/partials/mobile/message_attach_pending.html index 3f23dd68..34bf685b 100644 --- a/app/partials/mobile/message_attach_pending.html +++ b/app/partials/mobile/message_attach_pending.html @@ -1,5 +1,7 @@
    - +
    + +
    diff --git a/app/partials/mobile/message_attach_webpage.html b/app/partials/mobile/message_attach_webpage.html index e8a6d0bd..b507f56f 100644 --- a/app/partials/mobile/message_attach_webpage.html +++ b/app/partials/mobile/message_attach_webpage.html @@ -31,6 +31,7 @@
    +
    -