Browse Source

Improvements for mobile

master
Igor Zhukov 9 years ago
parent
commit
c8ef691eb0
  1. 2
      app/js/directives.js
  2. 4
      app/js/services.js
  3. 2
      app/less/app.less
  4. 22
      app/less/mobile.less
  5. 2
      app/partials/desktop/im.html
  6. 26
      app/partials/mobile/full_gif.html
  7. 7
      app/partials/mobile/im.html
  8. 4
      app/partials/mobile/message.html

2
app/js/directives.js

@ -1539,7 +1539,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -1539,7 +1539,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}
$scope.$on('inline_results', function (e, inlineResults) {
var w = (messageFieldWrap.offsetWidth || 382) - 2;
var w = Config.Mobile ? $(window).width() : (messageFieldWrap.offsetWidth || 382) - 2;
var h = 80;
if (inlineResults) {
AppInlineBotsManager.regroupWrappedResults(inlineResults.results, w, h);

4
app/js/services.js

@ -2755,8 +2755,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2755,8 +2755,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
thumbW = realW;
}
var result = results[i + j];
result.thumbW = Math.floor(thumbW);
result.thumbH = Math.floor(thumbH);
result.thumbW = Math.floor(thumbW) - 2;
result.thumbH = Math.floor(thumbH) - 2;
});
i += rowCnt;

2
app/less/app.less

@ -2878,6 +2878,7 @@ a.composer_emoji_btn { @@ -2878,6 +2878,7 @@ a.composer_emoji_btn {
background: #FFF;
display: none;
position: absolute;
z-index: 10;
border: 0;
.box-shadow(0px 1px 1px 0px rgba(60,75,87,0.27));
@ -3170,6 +3171,7 @@ _:-ms-lang(x), .composer_rich_textarea:empty:focus:before { @@ -3170,6 +3171,7 @@ _:-ms-lang(x), .composer_rich_textarea:empty:focus:before {
.inline_result_gif,
.inline_result_photo {
display: inline-block;
padding: 1px;
}
.inline_result_article {
display: block;

22
app/less/mobile.less

@ -885,15 +885,18 @@ a.im_message_from_photo { @@ -885,15 +885,18 @@ a.im_message_from_photo {
margin-left: -45px;
}
}
.im_message_author,
.im_message_author_via {
display: block;
font-size: 13px;
font-weight: normal;
margin-bottom: 3px;
}
.im_message_author {
display: none;
}
.im_history_messages_group {
a.im_message_author,
.im_message_author_via {
a.im_message_author {
display: inline;
font-size: 13px;
font-weight: normal;
@ -1797,6 +1800,12 @@ a.media_modal_date:hover { @@ -1797,6 +1800,12 @@ a.media_modal_date:hover {
padding-right: 35px;
}
}
.im_inline_placeholder_wrap {
font-size: 15px;
line-height: 17px;
padding: 6px 7px;
top: 0;
}
.im_send_field_panel {
position: relative;
}
@ -1810,4 +1819,9 @@ a.media_modal_date:hover { @@ -1810,4 +1819,9 @@ a.media_modal_date:hover {
}
.im_send_keyboard_wrap {
padding: 0 5px;
}
.composer_progress_icon {
right: 6px;
top: 4px;
}

2
app/partials/desktop/im.html

@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
<div my-arc-progress stroke="5" width="50"></div>
</div>
<div ng-show="state.loaded">
<div ng-show="!state.notSelected &amp;&amp; state.loaded">
<div my-history class="im_history_col">
<div class="im_history_wrap nano">

26
app/partials/mobile/full_gif.html

@ -2,6 +2,17 @@ @@ -2,6 +2,17 @@
<div class="img_gif_image_wrap">
<div class="img_gif_meta" ng-show="!isActive" ng-switch="document.progress.enabled">
<div ng-switch-when="true" class="img_gif_meta_contents">
<i class="icon icon-cancel">
<i class="icon icon-bar"></i>
<i class="icon icon-bar"></i>
</i>
<div my-arc-progress="document.progress.percent"></div>
</div>
<div ng-switch-default class="img_gif_label noselect img_gif_meta_contents">GIF</div>
</div>
<div ng-if="document.url" ng-show="document.downloaded &amp;&amp; isActive" ng-switch="document.mime_type == 'video/mp4'">
<video ng-switch-when="true" width="{{document.thumb.width}}" height="{{document.thumb.height}}" controls class="img_gif_video">
<source ng-src="{{document.url}}" type="video/mp4">
@ -12,19 +23,4 @@ @@ -12,19 +23,4 @@
</div>
<div ng-show="!isActive" ng-switch="document.progress.enabled">
<div ng-switch-when="true" class="img_gif_progress_wrap">
<div class="img_gif_progress progress tg_progress">
<div class="progress-bar progress-bar-success" ng-style="{width: document.progress.percent + '%'}"></div>
</div>
</div>
<div ng-switch-default class="img_gif_info_wrap">
<div class="img_gif_label pull-left">GIF</div>
<div ng-if="!document.downloaded" class="img_gif_size pull-right" ng-bind="::document.size | formatSize"></div>
</div>
</div>
</a>

7
app/partials/mobile/im.html

@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
<my-i18n msgid="im_loading_history"></my-i18n><span my-loading-dots></span>
</div>
<div ng-show="state.loaded">
<div ng-show="!state.notSelected &amp;&amp; state.loaded">
<div my-history-mobile class="im_history_col">
<div class="im_history_wrap im_history_scrollable_wrap mobile_scrollable_wrap">
@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
<div class="im_send_form_wrap1">
<div class="im_send_form_wrap clearfix" ng-controller="AppImSendController">
<form my-send-form draft-message="draftMessage" mentions="mentions" commands="commands" class="im_send_form" ng-class="{im_send_form_empty: !draftMessage.text.length}">
<form my-send-form draft-message="draftMessage" mentions="mentions" commands="commands" class="im_send_form" ng-class="{im_send_form_empty: !draftMessage.text.length, composer_progress_enabled: draftMessage.inlineProgress}">
<div class="im_send_reply_wrap" ng-if="draftMessage.replyToMessage != null">
<a class="im_send_reply_cancel" ng-mousedown="draftMessage.replyClear()"><i class="icon icon-reply-bar"></i><i class="icon icon-reply-bar"></i></a>
@ -151,9 +151,10 @@ @@ -151,9 +151,10 @@
<div class="im_send_field_wrap" ng-class="historyState.replyKeyboard._ == 'replyKeyboardMarkup' ? 'im_send_field_wrap_2ndbtn' : ''">
<a class="composer_command_btn" ng-show="!historyState.replyKeyboard && commands.list.length > 0 && (!draftMessage.text.length || draftMessage.text[0] == '/')" ng-mousedown="toggleSlash($event)" ng-class="draftMessage.text[0] == '/' ? 'active' : ''"><i class="icon icon-slash"></i></a>
<a class="composer_keyboard_btn" ng-show="historyState.replyKeyboard._ == 'replyKeyboardMarkup'" ng-mousedown="replyKeyboardToggle($event)" ng-class="!historyState.replyKeyboard.pFlags.hidden ? 'active' : ''"><i class="icon icon-keyboard"></i></a>
<div class="composer_progress_icon" my-arc-progress width="22" stroke="2.5"></div>
<div class="im_send_dropbox_wrap" my-i18n="im_photos_drop_text"></div>
<textarea ng-model="draftMessage.text" class="form-control im_message_field no_outline" dir="auto"></textarea>
<textarea ng-model="draftMessage.text" class="form-control im_message_field no_outline" dir="auto" ng-trim="false"></textarea>
</div>
<div class="im_attach pull-right">

4
app/partials/mobile/message.html

@ -40,10 +40,10 @@ @@ -40,10 +40,10 @@
<span class="im_message_date" ng-bind="::historyMessage.date | time"></span>
</div>
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media && historyMessage.media._ != 'messageMediaWebPage' && !historyMessage.media.rCaption ? true : false}">
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media && historyMessage.media._ != 'messageMediaWebPage' && !historyMessage.media.rCaption && !historyMessage.viaBotID ? true : false}">
<a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a>
<span ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" my-i18n="message_via_bot"><my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></a></my-i18n-param></span>
<span ng-if="::historyMessage.viaBotID && !historyMessage.fwdFromID" class="im_message_author_via" my-i18n="message_via_bot"><my-i18n-param name="bot"><a class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"></a></my-i18n-param></span>
<a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a>

Loading…
Cancel
Save