Browse Source

Improved mobile support

master
Igor Zhukov 9 years ago
parent
commit
f1fdd25070
  1. 2
      app/js/controllers.js
  2. 4
      app/js/lib/utils.js
  3. 2
      app/js/messages_manager.js
  4. 5
      app/js/services.js
  5. 8
      app/partials/desktop/chat_modal.html
  6. 140
      app/partials/mobile/channel_modal.html
  7. 14
      app/partials/mobile/chat_modal.html
  8. 29
      app/partials/mobile/dialog.html
  9. 6
      app/partials/mobile/full_gif.html
  10. 44
      app/partials/mobile/im.html
  11. 25
      app/partials/mobile/message.html
  12. 20
      app/partials/mobile/message_attach_venue.html
  13. 47
      app/partials/mobile/message_attach_webpage.html
  14. 3
      app/partials/mobile/message_service.html

2
app/js/controllers.js

@ -3299,7 +3299,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -3299,7 +3299,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
$scope.deletePhoto = function () {
$scope.photo.updating = true;
MtpApiManager.invokeApi('messages.editChatPhoto', {
MtpApiManager.invokeApi('channels.editPhoto', {
channel: AppChatsManager.getChannelInput($scope.chatID),
photo: {_: 'inputChatPhotoEmpty'}
}).then(onChatUpdated)['finally'](function () {

4
app/js/lib/utils.js

@ -323,7 +323,9 @@ function templateUrl (tplName) { @@ -323,7 +323,9 @@ function templateUrl (tplName) {
slider: 'desktop',
reply_message: 'desktop',
chat_invite_link_modal: 'desktop',
reply_markup: 'desktop'
reply_markup: 'desktop',
dialog_service: 'desktop',
channel_edit_modal: 'desktop'
};
var layout = forceLayout[tplName] || (Config.Mobile ? 'mobile' : 'desktop');
return 'partials/' + layout + '/' + tplName + '.html';

2
app/js/messages_manager.js

@ -1606,7 +1606,7 @@ angular.module('myApp.services') @@ -1606,7 +1606,7 @@ angular.module('myApp.services')
var chatTitle;
if (chatInvite._ == 'chatInviteAlready') {
AppChatsManager.saveApiChat(chatInvite.chat);
if (!chatInvite.chat.left) {
if (!chatInvite.chat.pFlags.left) {
return $rootScope.$broadcast('history_focus', {
peerString: AppChatsManager.getChatString(chatInvite.chat.id)
});

5
app/js/services.js

@ -1010,7 +1010,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -1010,7 +1010,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
if (chatsFull[id] !== undefined) {
var chat = AppChatsManager.getChat(id);
if (chat.version == chatsFull[id].participants.version ||
chat.left) {
chat.pFlags.left) {
return $q.when(chatsFull[id]);
}
}
@ -2433,7 +2433,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -2433,7 +2433,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
message: updateMessage.message,
fwd_from_id: updateMessage.fwd_from_id,
fwd_date: updateMessage.fwd_date,
reply_to_msg_id: updateMessage.reply_to_msg_id
reply_to_msg_id: updateMessage.reply_to_msg_id,
entities: updateMessage.entities
},
pts: updateMessage.pts,
pts_count: updateMessage.pts_count

8
app/partials/desktop/chat_modal.html

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<div class="md_modal_title_wrap">
<div class="md_modal_actions_wrap clearfix">
<a class="md_modal_action md_modal_action_close" ng-click="$close()" my-i18n="modal_close"></a>
<a class="md_modal_action" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.left" ng-click="editTitle()" my-i18n="modal_edit"></a>
<a class="md_modal_action" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.pFlags.left" ng-click="editTitle()" my-i18n="modal_edit"></a>
</div>
<div class="md_modal_title" my-i18n="group_modal_info"></div>
</div>
@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-if="chatFull.chat._ != 'chatForbidden'">
<i class="md_modal_section_icon md_modal_section_icon_person"></i>
<div class="md_modal_section_link_wrap" ng-switch="chatFull.chat.left">
<div class="md_modal_section_link_wrap" ng-switch="chatFull.chat.pFlags.left">
<a ng-switch-when="true" class="md_modal_section_link" ng-click="returnToGroup()" my-i18n="group_modal_return"></a>
<a ng-switch-default class="md_modal_section_link" ng-click="inviteToGroup()" my-i18n="group_modal_add_member"></a>
@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
</div>
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.left && chatFull.isAdmin">
<div class="md_modal_iconed_section_wrap md_modal_iconed_section_link" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.isAdmin">
<!-- <i class="md_modal_section_icon md_modal_section_icon_more"></i> -->
<div class="md_modal_section_link_wrap">
@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</div>
<div ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.left &amp;&amp; chatFull.participants.participants.length > 0">
<div ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.pFlags.left &amp;&amp; chatFull.participants.participants.length > 0">
<div class="md_modal_section_splitter"></div>

140
app/partials/mobile/channel_modal.html

@ -0,0 +1,140 @@ @@ -0,0 +1,140 @@
<div class="chat_modal_wrap">
<div class="tg_page_head tg_modal_head">
<div class="navbar navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-toggle-wrap dropdown" dropdown ng-if="chatFull.chat.pFlags.creator || !chatFull.chat.pFlags.left && !chatFull.chat.pFlags.kicked">
<a class="dropdown-toggle navbar-toggle" dropdown-toggle>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<ul class="dropdown-menu">
<li ng-if="chatFull.chat.pFlags.creator">
<a ng-click="deletePhoto()" my-i18n="group_modal_menu_delete_photo"></a>
</li>
<li ng-if="chatFull.chat.pFlags.creator">
<a ng-click="editChannel()" my-i18n="modal_edit"></a>
</li>
<li ng-if="chatFull.chat.pFlags.creator">
<a ng-click="deleteChannel()" my-i18n="channel_modal_delete_channel"></a>
</li>
<li ng-if="!chatFull.chat.pFlags.creator && !chatFull.chat.pFlags.left && !chatFull.chat.pFlags.kicked">
<a ng-click="leaveChannel()" my-i18n="channel_modal_leave_channel"></a>
</li>
</ul>
</div>
<div class="navbar-header">
<ul class="nav navbar-nav navbar-quick-nav">
<li>
<a ng-click="$close()" class="navbar-quick-media-back">
<i class="icon icon-back"></i>
<div class="navbar-quick-back-title">
<h4 my-i18n="channel_modal_info"></h4>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-body mobile_modal_body">
<div class="mobile_user_modal_photo_profile_wrap">
<a href="" ng-click="openPhoto(chatFull.chat_photo.id, {p: -chatFull.chat.id})" class="mobile_user_modal_image_wrap pull-left" ng-class="{disabled: !chatFull.chat.photo.photo_small}">
<img
class="mobile_user_modal_image mobile_chat_modal_image"
my-load-thumb
watch="true"
thumb="chatFull.thumb"
/>
</a>
<div class="mobile_user_modal_info_wrap clearfix">
<h4 class="mobile_user_modal_header" my-peer-link="-chatFull.chat.id"></h4>
<p class="mobile_user_modal_status" ng-if="chatFull.participants_count > 0">
<ng-pluralize count="chatFull.participants_count"
when="group_modal_pluralize_participants">
</ng-pluralize>
</p>
</div>
</div>
<div class="mobile_modal_section" ng-if="chatFull.rAbout">
<h4 class="mobile_modal_section_header" my-i18n="user_modal_about"></h4>
<div class="mobile_modal_section_value" ng-bind-html="chatFull.rAbout"></div>
</div>
<div class="mobile_modal_section" ng-if="chatFull.chat.username || chatFull.chat.pFlags.creator">
<h4 class="mobile_modal_section_header" my-i18n="channel_modal_share_link"></h4>
<div class="mobile_modal_section_value" ng-switch="chatFull.chat.username.length > 0">
<a ng-switch-when="true" class="settings_modal_username_link" ng-click="shareLink($event)" ng-bind="'https://telegram.me/' + chatFull.chat.username" ng-href="https://telegram.me/{{chatFull.chat.username}}" target="_blank"></a>
<a ng-switch-default ng-click="shareLink($event)" ng-bind="chatFull.exported_invite.link" ng-href="{{chatFull.exported_invite.link}}" target="_blank"></a>
</div>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat.pFlags.creator">
<a class="mobile_modal_action" ng-click="inviteToChannel()" my-i18n="channel_modal_add_member"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat.pFlags.left">
<a class="mobile_modal_action" ng-click="joinChannel()" my-i18n="channel_modal_join"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ == 'chatForbidden'">
<a class="mobile_modal_action" ng-click="flushHistory()" my-i18n="group_modal_return"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat.pFlags.creator &amp;&amp; !photo.updating">
<span class="mobile_modal_action mobile_modal_upload_action">
<input my-file-upload type="file" multiple="false" class="im_attach_input" size="120" multiple="false" accept="image/x-png, image/png, image/gif, image/jpeg" />
<my-i18n="group_modal_update_photo"></my-i18n>
</span>
</div>
<div class="mobile_modal_action_wrap" ng-if="photo.updating">
<span class="mobile_modal_action" my-i18n>
<my-i18n="group_modal_update_active"></my-i18n>
<span my-loading-dots></span>
</span>
</div>
<div class="mobile_modal_action_wrap">
<a class="mobile_modal_action tg_checkbox clearfix" ng-click="settings.notifications = !settings.notifications" ng-class="settings.notifications ? 'tg_checkbox_on' : ''">
<span class="icon icon-checkbox-outer"><i class="icon-checkbox-inner"></i></span>
<span class="tg_checkbox_label" my-i18n="group_modal_notifications"></span>
</a>
</div>
<div class="mobile_modal_section" ng-if="chatFull.participants.participants.length > 0">
<h4 class="mobile_modal_section_header" my-i18n="group_modal_members"></h4>
<div class="mobile_modal_section_body">
<div class="chat_modal_members_list">
<div class="chat_modal_participant_wrap clearfix" ng-repeat="participant in chatFull.participants.participants | orderBy:'-user.sortStatus'">
<a ng-if="participant.canKick" ng-click="kickFromChannel(participant.user_id)" class="chat_modal_participant_kick pull-right" my-i18n="group_modal_members_kick"></a>
<a ng-if="participant.canLeave" ng-click="leaveChannel()" class="chat_modal_participant_kick pull-right" my-i18n="group_modal_menu_leave"></a>
<a class="chat_modal_participant_photo pull-left" my-user-photolink="participant.user_id" img-class="chat_modal_participant_photo" status="true"></a>
<div class="chat_modal_participant_name">
<a my-peer-link="participant.user_id"></a>
</div>
<div class="chat_modal_participant_status" my-user-status="::participant.user_id" bot-chat-privacy="true"></div>
</div>
</div>
</div>
</div>
</div>
</div>

14
app/partials/mobile/chat_modal.html

@ -11,10 +11,10 @@ @@ -11,10 +11,10 @@
<span class="icon-bar"></span>
</a>
<ul class="dropdown-menu">
<li ng-if="chatFull.thumb.location" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.left">
<li ng-if="chatFull.thumb.location" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.pFlags.left">
<a ng-click="deletePhoto()" my-i18n="group_modal_menu_delete_photo"></a>
</li>
<li ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.left">
<li ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.pFlags.left">
<a ng-click="editTitle()" my-i18n="group_modal_menu_edit_group"></a>
</li>
<li>
@ -66,20 +66,20 @@ @@ -66,20 +66,20 @@
</div>
<div class="mobile_modal_action_wrap" ng-if="!chatFull.chat.left &amp;&amp; chatFull.participants.participants.length">
<div class="mobile_modal_action_wrap" ng-if="!chatFull.chat.pFlags.left &amp;&amp; chatFull.participants.participants.length">
<a class="mobile_modal_action" ng-click="inviteToGroup()" my-i18n="group_modal_add_member"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.left && chatFull.isAdmin">
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' && !chatFull.chat.pFlags.left && chatFull.isAdmin">
<a class="mobile_modal_action" ng-click="inviteViaLink()" my-i18n="group_modal_menu_share_link"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; chatFull.chat.left">
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; chatFull.chat.pFlags.left">
<a class="mobile_modal_action" ng-click="returnToGroup()" my-i18n="group_modal_return"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ == 'chatForbidden'">
<a class="mobile_modal_action" ng-click="flushHistory()" my-i18n="group_modal_return"></a>
</div>
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.left &amp;&amp; !photo.updating">
<div class="mobile_modal_action_wrap" ng-if="chatFull.chat._ != 'chatForbidden' &amp;&amp; !chatFull.chat.pFlags.left &amp;&amp; !photo.updating">
<span class="mobile_modal_action mobile_modal_upload_action">
<input my-file-upload type="file" multiple="false" class="im_attach_input" size="120" multiple="false" accept="image/x-png, image/png, image/gif, image/jpeg" />
<my-i18n="group_modal_update_photo"></my-i18n>
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
</div>
<div class="chat_modal_members_forbidden" ng-if="chatFull.chat._ == 'chatForbidden' || chatFull.chat.left" my-i18n="group_modal_members_unavailable"></div>
<div class="chat_modal_members_forbidden" ng-if="chatFull.chat._ == 'chatForbidden' || chatFull.chat.pFlags.left" my-i18n="group_modal_members_unavailable"></div>
</div>
</div>

29
app/partials/mobile/dialog.html

@ -39,13 +39,13 @@ @@ -39,13 +39,13 @@
<span class="im_dialog_message_text" my-i18n="conversation_message_deleted"></span>
</div>
<div ng-switch-default class="im_dialog_message">
<span ng-switch="::dialogMessage.peerID > 0">
<span ng-switch="dialogMessage.peerID > 0 || dialogMessage.fromID < 0">
<span ng-switch-when="true">
<span class="im_dialog_chat_from_wrap" ng-if="dialogMessage.out">
<span
class="im_dialog_chat_from"
my-i18n="conversation_you"
></span><span ng-if="dialogMessage.message.length || dialogMessage.media">:</span>
></span><span ng-if="dialogMessage.message.length > 0 || !!dialogMessage.media">:</span>
</span>
</span>
<span ng-switch-default>
@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
<span class="im_dialog_message_media" ng-if="dialogMessage.media" ng-switch="dialogMessage.media._">
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
<span ng-switch-when="messageMediaDocument" ng-switch="::dialogMessage.media.document.sticker || false">
<span ng-switch-when="messageMediaDocument" ng-switch="dialogMessage.media.document.sticker || false">
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
<span ng-switch-when="2">
<span ng-bind-html="dialogMessage.media.document.stickerEmoji"></span>
@ -80,28 +80,7 @@ @@ -80,28 +80,7 @@
<span ng-switch-when="messageMediaContact" my-i18n="conversation_media_contact"></span>
</span>
<span class="im_dialog_message_service" ng-if="dialogMessage._ == 'messageService'" ng-switch="dialogMessage.action._">
<span ng-switch-when="messageActionChatCreate" my-i18n="conversation_group_created"></span>
<span ng-switch-when="messageActionChatEditTitle" my-i18n="conversation_group_renamed"></span>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="conversation_group_photo_updated"></span>
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="conversation_group_photo_removed"></span>
<span ng-switch-when="messageActionChatAddUser" ng-switch="dialogMessage.from_id == dialogMessage.action.user_id">
<span ng-switch-when="true" my-i18n="conversation_returned_to_group"></span>
<span ng-switch-default my-i18n="conversation_invited_user">
<my-i18n-param name="user"><span my-peer-link="dialogMessage.action.user_id"></span></my-i18n-param>
</span>
</span>
<span ng-switch-when="messageActionChatDeleteUser" ng-switch="dialogMessage.from_id == dialogMessage.action.user_id">
<span ng-switch-when="true" my-i18n="conversation_left_group"></span>
<span ng-switch-default my-i18n="conversation_kicked_user">
<my-i18n-param name="user"><span my-peer-link="dialogMessage.action.user_id"></span></my-i18n-param>
</span>
</span>
</span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="conversation_joined_by_link"></span>
<span class="im_dialog_message_service" ng-if="dialogMessage._ == 'messageService'" my-service-short-message="dialogMessage"></span>
<span class="im_dialog_message_text" ng-if="dialogMessage.message.length" ng-bind-html="dialogMessage.richMessage"></span>
</div>

6
app/partials/mobile/full_gif.html

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
<a class="img_gif_with_progress_wrap" ng-click="toggle($event)">
<div class="img_gif_image_wrap" ng-switch="document.downloaded &amp;&amp; isActive">
<div class="img_gif_image_wrap">
<img ng-switch-when="true" class="img_gif_image" ng-src="{{document.url}}" />
<img ng-switch-default class="img_gif_thumb" my-load-thumb thumb="document.thumb" />
<img ng-if="document.url" ng-show="document.downloaded &amp;&amp; isActive" class="img_gif_image" ng-src="{{document.url}}" />
<img ng-hide="document.downloaded &amp;&amp; isActive" class="img_gif_thumb" my-load-thumb thumb="document.thumb" />
</div>

44
app/partials/mobile/im.html

@ -46,19 +46,18 @@ @@ -46,19 +46,18 @@
</ul>
</div>
<div class="im_dialogs_contacts_wrap" ng-show="foundUsers.length > 0">
<div class="im_dialogs_contacts_wrap" ng-show="foundPeers.length > 0">
<h5 my-i18n="im_found_title"></h5>
<ul class="nav nav-pills nav-stacked">
<li class="im_dialog_wrap" ng-repeat="foundUser in foundUsers track by foundUser.userID" ng-class="{active: curDialog.peerID == foundUser.userID}">
<a class="im_dialog" ng-mousedown="dialogSelect(foundUser.peerString)">
<div class="im_dialog_photo pull-left" my-user-photolink="foundUser.userID" img-class="im_dialog_photo" watch="true"></div>
<li class="im_dialog_wrap" ng-repeat="foundPeer in foundPeers track by foundPeer.id" ng-class="{active: curDialog.peerID == foundPeer.id}">
<a class="im_dialog" ng-mousedown="dialogSelect(foundPeer.peerString)">
<div class="im_dialog_photo pull-left" my-user-photolink="foundPeer.id" img-class="im_dialog_photo" watch="true"></div>
<div class="im_dialog_message_wrap">
<div class="im_dialog_peer">
<span class="im_dialog_user" my-peer-link="foundUser.userID"></span>
<span class="im_dialog_user" my-peer-link="foundPeer.id"></span>
</div>
<div class="im_dialog_message" ng-switch="foundUser.user.username.length > 0">
<span ng-switch-when="true" class="im_dialog_message_text" ng-bind="::'@' + foundUser.user.username"></span>
<span ng-switch-default class="im_dialog_message_text" my-user-status="::foundUser.userID"></span>
<div class="im_dialog_message">
<span class="im_dialog_message_text" ng-bind="::'@' + foundPeer.username"></span>
</div>
</div>
</a>
@ -87,7 +86,7 @@ @@ -87,7 +86,7 @@
<div class="im_history_wrap im_history_scrollable_wrap mobile_scrollable_wrap">
<div class="im_history_scrollable">
<div class="im_history" ng-class="{im_history_selectable: !historyState.startBot, im_history_select_active: historyState.selectActions}">
<div class="im_history" ng-class="{im_history_selectable: !historyState.botActions, im_history_select_active: historyState.selectActions}">
<div ng-if="state.empty" class="im_history_empty" ng-switch="state.mayBeHasMore" my-vertical-position="0.25" padding="true">
<span ng-switch-when="true">
<my-i18n msgid="im_loading_history"></my-i18n><span my-loading-dots></span>
@ -109,17 +108,32 @@ @@ -109,17 +108,32 @@
<div class="im_bottom_panel_wrap">
<div class="im_edit_panel_wrap clearfix" ng-show="historyState.selectActions || historyState.startBot" ng-switch="historyState.startBot != false">
<div class="im_edit_start_actions" ng-switch-when="true">
<a class="btn btn-primary im_start_btn" ng-click="botStart()" my-i18n="im_start"></a>
<div class="im_edit_panel_wrap clearfix" ng-show="historyState.actions()" ng-switch="historyState.actions()">
<div class="im_edit_panel_border"></div>
<div ng-switch-when="bot">
<a ng-show="historyState.botActions == 'param'" class="btn btn-md btn-md-primary im_edit_cancel_link" ng-click="cancelBot()" my-i18n="modal_cancel"></a>
<div class="im_edit_start_actions">
<a class="btn btn-primary im_start_btn" ng-click="startBot()" my-i18n="im_start"></a>
</div>
</div>
<div ng-switch-when="channel">
<div class="im_edit_start_actions" ng-switch="historyState.channelActions">
<a ng-switch-when="join" class="btn btn-primary im_start_btn" ng-click="joinChannel()" my-i18n="im_channel_join"></a>
<a ng-switch-when="mute" class="btn btn-primary im_start_btn" ng-click="togglePeerMuted(true)" my-i18n="im_channel_mute"></a>
<a ng-switch-when="unmute" class="btn btn-primary im_start_btn" ng-click="togglePeerMuted(false)" my-i18n="im_channel_unmute"></a>
</div>
</div>
<div class="im_edit_selected_actions" ng-switch-default my-i18n>
<a class="btn btn-primary im_edit_forward_btn" ng-click="selectedForward()" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" my-i18n-format="im_forward"></a><a class="btn btn-danger im_edit_delete_btn" ng-click="selectedDelete()" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" my-i18n-format="im_delete"></a>
<div ng-switch-when="selected" class="im_edit_selected_actions" my-i18n>
<a class="btn btn-md btn-md-primary im_edit_cancel_link" ng-click="selectedCancel()" my-i18n="modal_cancel"></a>
<a class="btn btn-primary im_edit_forward_btn" ng-click="selectedForward()" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" my-i18n-format="im_forward"></a>
<a class="btn btn-primary im_edit_delete_btn" ng-click="selectedDelete()" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" my-i18n-format="im_delete"></a>
<a class="btn btn-primary im_edit_reply_btn" ng-click="selectedReply()" ng-show="selectedCount == 1" my-i18n="im_reply"></a>
<my-i18n-param name="count"><strong class="im_selected_count" ng-show="selectedCount > 0" ng-bind="selectedCount"></strong></my-i18n-param>
</div>
</div>
<div class="im_send_panel_wrap" ng-show="!historyState.selectActions &amp;&amp; !historyState.startBot">
<div class="im_send_panel_wrap" ng-show="!historyState.actions()">
<div class="im_send_form_wrap1">

25
app/partials/mobile/message.html

@ -9,11 +9,11 @@ @@ -9,11 +9,11 @@
<div class="im_bot_intro_message" ng-bind-html="::historyMessage.action.rDescription"></div>
</div>
<div ng-switch-default class="im_service_message">
<a class="im_message_author" my-peer-link="historyMessage.from_id" short="!historyMessage.to_id.chat_id" color="historyMessage.to_id.chat_id > 0" no-watch="true"></a>
<a class="im_message_author" ng-if="::historyMessage.fromID > 0" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a>
<span class="im_message_service" my-service-message></span>
</div>
<a ng-if="::historyMessage.action._ == 'messageActionChatEditPhoto'" class="im_service_message_photo_thumb" href="" ng-click="openPhoto(historyMessage.action.photo.id)">
<a ng-if="::historyMessage.action._ == 'messageActionChatEditPhoto' || historyMessage.action._ == 'messageActionChannelEditPhoto'" class="im_service_message_photo_thumb" href="" ng-click="openPhoto(historyMessage.action.photo.id)">
<img
class="im_service_message_photo_thumb"
my-load-thumb
@ -23,36 +23,39 @@ @@ -23,36 +23,39 @@
</div>
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.out ? 'im_message_out' : 'im_message_in']">
<div ng-switch-default class="im_content_message_wrap" ng-class="::[historyMessage.out ? 'im_message_out' : 'im_message_in', historyMessage.fwdFromID ? 'im_message_fwd' : '']">
<i class="icon icon-select-tick"></i>
<i ng-if="::historyMessage.unread &amp;&amp; historyMessage.out || historyMessage.pending || false" class="icon-message-status" ng-class="{'icon-message-status-unread': historyMessage.unread, 'icon-message-status-pending': historyMessage.pending}" ng-show="!historyMessage.error"></i>
<a class="im_message_from_photo pull-left" my-user-photolink="historyMessage.from_id" img-class="im_message_from_photo"></a>
<a class="im_message_from_photo pull-left" my-peer-photolink="::historyMessage.fromID" img-class="im_message_from_photo"></a>
<div class="im_message_meta">
<i class="icon-message-status-tick"></i>
<span class="im_message_date" ng-bind="::mhistoryMessage.date | time"></span>
<span class="im_message_date" ng-bind="::historyMessage.date | time"></span>
</div>
<div class="im_message_body" ng-class="::{im_message_body_media: !!historyMessage.media && !historyMessage.media.rCaption}">
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media && !historyMessage.media.rCaption ? true : false}">
<a class="im_message_author" my-peer-link="historyMessage.from_id" short="!historyMessage.to_id.chat_id" color="historyMessage.to_id.chat_id > 0" no-watch="true"></a>
<a class="im_message_author" my-peer-link="historyMessage.fromID" short="historyMessage.toID > 0" color="historyMessage.toID < 0" no-watch="true"></a>
<a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a>
<div ng-if="::historyMessage.fwd_from_id > 0 &amp;&amp; !historyMessage.media" class="im_message_fwd_header" my-i18n="message_forwarded_message_mobile">
<a my-i18n-param="from" class="im_message_fwd_author" my-peer-link="historyMessage.fwd_from_id" no-watch="true"></a>
<div ng-if="::!!historyMessage.fwdFromID &amp;&amp; !historyMessage.media" class="im_message_fwd_header" my-i18n="message_forwarded_message_mobile">
<a my-i18n-param="from" class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID" no-watch="true"></a>
<span my-i18n-param="date" class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span>
</div>
<div ng-if="::historyMessage.media || false" class="im_message_media" ng-switch="historyMessage.media._">
<div ng-if="::historyMessage.media || historyMessage.mid < 0 ? true : false" class="im_message_media" ng-switch="historyMessage.media._">
<div ng-switch-when="messageMediaPhoto" my-message-photo="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaVideo" my-message-video="historyMessage.media" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaDocument" my-message-document="historyMessage.media.document" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaAudio" class="im_message_audio" my-audio-player audio="historyMessage.media.audio" message="historyMessage"></div>
<div ng-switch-when="messageMediaGeo" my-message-geo="historyMessage.media"></div>
<div ng-switch-when="messageMediaVenue" my-message-geo="historyMessage.media"></div>
<div ng-switch-when="messageMediaVenue" my-message-venue="historyMessage.media"></div>
<div ng-switch-when="messageMediaContact" class="im_message_contact" my-message-contact></div>
<div ng-switch-when="messageMediaWebPage" class="im_message_webpage" my-message-webpage="historyMessage.media.webpage" message-id="historyMessage.mid"></div>
<div ng-switch-when="messageMediaPending" my-message-pending></div>
<div ng-switch-when="messageMediaUnsupported">
<div class="im_message_text">

20
app/partials/mobile/message_attach_venue.html

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<div class="im_message_venue clearfix">
<a ng-href="{{::venue.mapUrl}}" target="_blank" class="im_message_venue_geopoint_wrap">
<i class="icon icon-geo-point"></i>
<img
class="im_message_venue_geopoint_image"
my-geo-point-map="venue.geo"
width="100"
height="100"
/>
</a>
<div class="im_message_venue_info">
<div class="im_message_venue_title_wrap">
<a ng-href="{{::venue.mapUrl}}" target="_blank" class="im_message_document_name" ng-bind="::venue.title"></a>
</div>
<div class="im_message_venue_address" ng-bind="::venue.address"></div>
</div>
</div>

47
app/partials/mobile/message_attach_webpage.html

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
<div ng-show="webpage._ == 'webPage'" class="im_message_webpage_wrap clearfix" ng-switch="webpage.type">
<div ng-switch-when="photo" class="im_message_webpage_photo">
<div class="im_message_webpage_site" ng-bind="webpage.site_name || webpage.display_url"></div>
<div class="im_message_webpage_title">
<a href="{{webpage.url}}" target="_blank" ng-bind-html="webpage.rTitle"></a>
</div>
<div ng-if="webpage.description.length" class="im_message_webpage_description" ng-bind-html="webpage.rDescription"></div>
<a class="im_message_photo_thumb" ng-click="openPhoto(webpage.photo.id, {w: webpage.id, m: messageId})" ng-style="::{width: webpage.photo.thumb.width + 'px'}" ng-mouseover="preloadPhoto(webpage.photo.id)">
<img
class="im_message_photo_thumb"
my-load-thumb
thumb="webpage.photo.thumb"
/>
</a>
</div>
<div ng-switch-when="video" class="im_message_webpage_video">
<div class="im_message_webpage_site" ng-bind="webpage.site_name || webpage.display_url"></div>
<div class="im_message_webpage_title">
<a ng-click="openEmbed($event)" href="{{webpage.url}}" target="_blank" ng-bind-html="webpage.rTitle"></a>
</div>
<div ng-if="webpage.description.length" class="im_message_webpage_description" ng-bind-html="webpage.rDescription"></div>
<a class="im_message_video_thumb" ng-click="openEmbed($event)" ng-href="{{webpage.url}}" target="_blank" ng-style="::{width: video.thumb.width + 'px'}">
<span ng-if="webpage.duration > 0" class="im_message_video_duration" ng-bind="::webpage.duration | duration"></span>
<i class="icon icon-videoplay"></i>
<img
class="im_message_video_thumb"
my-load-thumb
thumb="webpage.photo.thumb"
/>
</a>
</div>
<div ng-switch-default class="im_message_webpage_article">
<a ng-if="webpage.photo" href="{{webpage.url}}" target="_blank" class="im_message_webpage_article_photo pull-right">
<img
class="im_message_article_thumb"
my-load-thumb
thumb="webpage.photo.thumb"
/>
</a>
<div class="im_message_webpage_site" ng-bind="webpage.site_name"></div>
<div class="im_message_webpage_title">
<a ng-click="openEmbed($event)" href="{{webpage.url}}" target="_blank" ng-bind-html="webpage.rTitle"></a>
</div>
<div ng-if="webpage.description.length" class="im_message_webpage_description" ng-bind-html="webpage.rDescription"></div>
</div>
</div>

3
app/partials/mobile/message_service.html

@ -20,7 +20,8 @@ @@ -20,7 +20,8 @@
</span>
<span ng-switch-when="messageActionChatJoinedByLink" my-i18n="message_service_joined_by_link"></span>
<span ng-switch-when="messageActionChannelCreate" my-i18n="message_service_created_channel">
<span ng-switch-when="messageActionChannelCreate" my-i18n="message_service_created_channel"></span>
<span ng-switch-when="messageActionChannelEditTitle" my-i18n="message_service_changed_channel_name">
<my-i18n-param name="channel-name">&laquo;<strong ng-bind-html="::historyMessage.action.rTitle"></strong>&raquo;</my-i18n-param>
</span>
<span ng-switch-when="messageActionChannelEditPhoto" my-i18n="message_service_changed_channel_photo"></span>

Loading…
Cancel
Save