Browse Source

Improved forwarded messages styles

master
Igor Zhukov 11 years ago
parent
commit
b25172c438
  1. 80
      app/css/app.css
  2. 6
      app/js/controllers.js
  3. 1
      app/js/services.js
  4. 16
      app/partials/message.html

80
app/css/app.css

@ -1370,21 +1370,29 @@ a.im_dialog_selected .im_dialog_date { @@ -1370,21 +1370,29 @@ a.im_dialog_selected .im_dialog_date {
.im_message_author {
.im_message_author,
.im_message_fwd_author {
color: #3a6d99;
font-weight: bold;
}
.non_osx .im_message_author {
.non_osx .im_message_author,
.non_osx .im_message_fwd_author {
font-size: 12px;
}
.im_message_grouped1 .im_message_from_photo,
.im_message_grouped1 .im_message_author,
.im_message_grouped2 .im_message_from_photo,
.im_message_grouped2 .im_message_author {
.im_message_grouped2 .im_message_author,
.im_message_grouped3 .im_message_author,
.im_message_grouped3 .im_message_from_photo,
.im_message_grouped4 .im_message_author,
.im_message_grouped4 .im_message_from_photo {
display: none;
}
.im_message_grouped1 .im_message_body,
.im_message_grouped2 .im_message_body {
.im_message_grouped2 .im_message_body,
.im_message_grouped3 .im_message_body,
.im_message_grouped4 .im_message_body {
margin-left: 46px;
}
.im_message_grouped1 .im_content_message_select_area,
@ -1394,15 +1402,38 @@ a.im_dialog_selected .im_dialog_date { @@ -1394,15 +1402,38 @@ a.im_dialog_selected .im_dialog_date {
.im_history_appending .im_content_message_select_area {
height: 52px;
}
.im_message_grouped1 .icon-select-tick {
margin-top: 4px;
.im_message_grouped1 .icon-select-tick,
.im_message_grouped4 .icon-select-tick {
margin-top: 5px;
}
.im_message_grouped1 .icon-message-status {
.im_message_grouped1 .icon-message-status,
.im_message_grouped4 .icon-message-status {
margin-top: 5px;
}
.im_message_grouped3 .im_message_fwd_from,
.im_message_grouped4 .im_message_fwd_from {
display: none;
}
.im_message_grouped1 .im_message_fwd .im_message_date,
.im_message_grouped2 .im_message_fwd .im_message_date,
.im_message_grouped3 .im_message_fwd .im_message_date,
.im_message_grouped4 .im_message_fwd .im_message_date {
display: none;
}
.im_message_grouped3 .im_message_fwd,
.im_message_grouped4 .im_message_fwd {
margin-top: 8px;
}
.im_message_grouped3 .im_message_fwd,
.im_message_grouped4 .im_message_fwd {
margin-top: 8px;
}
.im_message_from_photo,
.im_message_contact_photo {
.im_message_contact_photo,
.im_message_fwd_photo {
width: 34px;
height: 34px;
@ -1803,7 +1834,8 @@ img.im_message_document_thumb { @@ -1803,7 +1834,8 @@ img.im_message_document_thumb {
opacity: 1;
}
.im_message_date {
.im_message_date,
.im_message_fwd_date {
color: #adadad;
font-size: 0.85em;
padding: 0 0 20px 10px;
@ -1854,6 +1886,31 @@ div.im_message_body { @@ -1854,6 +1886,31 @@ div.im_message_body {
div.im_message_fwd_header {
color: #808080;
}
.im_message_fwd_from {
margin-top: 5px;
}
.im_message_grouped2 .im_message_fwd_from {
margin-top: 0;
}
.im_message_fwd {
margin-top: 4px;
margin-bottom: 4px;
}
.im_message_fwd .im_message_fwd_author_wrap,
.im_message_fwd .im_message_text,
.im_message_fwd .im_message_media {
margin-left: 42px;
}
a.im_message_fwd_photo {
position: absolute;
margin-top: 1px;
}
.im_message_fwd_author {
margin-right: 5px;
}
.im_message_fwd_date {
padding: 0;
}
.im_message_text {
word-wrap: break-word;
@ -3008,12 +3065,15 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status { @@ -3008,12 +3065,15 @@ a.contacts_modal_contact:hover .contacts_modal_contact_status {
.im_message_selected .im_message_date,
.im_message_selected .im_message_fwd_header,
.im_message_selected .im_message_document_size,
.im_message_selected .im_message_fwd_date,
.im_message_focus .im_message_date,
.im_message_focus .im_message_fwd_header,
.im_message_focus .im_message_document_size,
.im_message_focus .im_message_fwd_date,
.im_history_selectable .im_message_outer_wrap:hover .im_message_date,
.im_history_selectable .im_message_outer_wrap:hover .im_message_fwd_header,
.im_history_selectable .im_message_outer_wrap:hover .im_message_document_size {
.im_history_selectable .im_message_outer_wrap:hover .im_message_document_size,
.im_history_selectable .im_message_outer_wrap:hover .im_message_fwd_date {
color: #68839c;
}

6
app/js/controllers.js

@ -693,7 +693,11 @@ angular.module('myApp.controllers', []) @@ -693,7 +693,11 @@ angular.module('myApp.controllers', [])
curMessage.date < prevMessage.date + 900) {
var singleLine = curMessage.message && curMessage.message.length < 70 && curMessage.message.indexOf("\n") == -1;
curMessage.grouped = !curMessage.fwd_from_id && singleLine ? 1 : 2;
if (curMessage.fwd_from_id && curMessage.fwd_from_id == prevMessage.fwd_from_id) {
curMessage.grouped = singleLine ? 4 : 3;
} else {
curMessage.grouped = !curMessage.fwd_from_id && singleLine ? 1 : 2;
}
} else if (prevMessage || !i) {
delete curMessage.grouped;
}

1
app/js/services.js

@ -1832,6 +1832,7 @@ angular.module('myApp.services', []) @@ -1832,6 +1832,7 @@ angular.module('myApp.services', [])
if (message._ == 'messageForwarded') {
message.fwdUser = AppUsersManager.getUser(message.fwd_from_id);
message.fwdPhoto = AppUsersManager.getUserPhoto(message.fwd_from_id, 'User');
}
if (message.media) {

16
app/partials/message.html

@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
</div>
<div bindonce bo-if="historyMessage._ != 'messageService'" class="im_content_message_wrap" ng-class="{im_message_unread: historyMessage.unread, im_message_out: historyMessage.out, im_message_in: !historyMessage.out, im_message_error: historyMessage.error, im_message_pending: historyMessage.pending}">
<div bindonce bo-if="historyMessage._ != 'messageService'" class="im_content_message_wrap" ng-class="{im_message_unread: historyMessage.unread, im_message_out: historyMessage.out, im_message_error: historyMessage.error, im_message_pending: historyMessage.pending, im_message_fwd: historyMessage._ == 'messageForwarded'}">
<div class="im_content_message_select_area">
<i class="icon icon-select-tick"></i>
</div>
@ -85,8 +85,18 @@ @@ -85,8 +85,18 @@
<a bo-if="historyMessage.to_id.chat_id > 0" class="im_message_author" bo-class="'user_color_' + historyMessage.fromPhoto.num" ng-click="openUser(historyMessage.from_id)" ng-bind-html="historyMessage.fromUser.rFullName"></a>
<a bo-if="!historyMessage.to_id.chat_id" class="im_message_author" ng-click="openUser(historyMessage.from_id)" ng-bind-html="historyMessage.fromUser.rFirstName" ></a>
<div bo-if="historyMessage._ == 'messageForwarded'" class="im_message_fwd_header">
Forwarded message from <a class="im_message_fwd_author" ng-click="openUser(historyMessage.fwd_from_id)" ng-bind-html="historyMessage.fwdUser.rFirstName"></a>, <span class="im_message_fwd_date" ng-bind="historyMessage.fwd_date | dateOrTime"></span>
<div bo-if="historyMessage._ == 'messageForwarded'" class="im_message_fwd_from">
<a ng-click="openUser(historyMessage.fwd_from_id)" class="im_message_fwd_photo pull-left">
<img
class="im_message_fwd_photo"
my-load-thumb
thumb="historyMessage.fwdPhoto"
/>
</a>
<div class="im_message_fwd_author_wrap">
<a class="im_message_fwd_author" ng-click="openUser(historyMessage.fwd_from_id)" ng-bind-html="historyMessage.fwdUser.rFirstName"></a><span class="im_message_fwd_date" ng-bind="historyMessage.fwd_date | dateOrTime"></span>
</div>
</div>
<div bo-if="historyMessage.media &amp;&amp; historyMessage.media._ != 'messageMediaEmpty'" class="im_message_media" ng-switch="historyMessage.media._">

Loading…
Cancel
Save