Browse Source

Added signatures

Close #1165
master
Igor Zhukov 9 years ago
parent
commit
8f6d64131a
  1. 15
      app/js/directives.js
  2. 1
      app/js/messages_manager.js
  3. 11
      app/less/app.less
  4. 4
      app/less/desktop.less
  5. 3
      app/less/mobile.less
  6. 1
      app/partials/desktop/message.html
  7. 1
      app/partials/mobile/message.html

15
app/js/directives.js

@ -180,6 +180,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var messageMediaCompiled = $compile('<div class="im_message_media" my-message-media="media" message-id="messageId"></div>'); var messageMediaCompiled = $compile('<div class="im_message_media" my-message-media="media" message-id="messageId"></div>');
var messageKeyboardCompiled = $compile('<div class="im_message_keyboard" my-inline-reply-markup="markup"></div>'); var messageKeyboardCompiled = $compile('<div class="im_message_keyboard" my-inline-reply-markup="markup"></div>');
var messageSignCompiled = $compile('<div class="im_message_sign"><span class="im_message_sign_link" my-peer-link="signID"></span></div>');
return { return {
link: link, link: link,
@ -231,6 +232,19 @@ angular.module('myApp.directives', ['myApp.filters'])
}); });
} }
function updateMessageSignature($scope, element, message) {
if (!message.signID) {
$('.im_message_sign', element).hide();
return;
}
var scope = $scope.$new(true);
scope.signID = message.signID;
messageSignCompiled(scope, function (clonedElement) {
$('.im_message_sign', element).replaceWith(clonedElement);
});
}
function updateMessageKeyboard($scope, element, message) { function updateMessageKeyboard($scope, element, message) {
if (!message.reply_markup || if (!message.reply_markup ||
message.reply_markup._ != 'replyInlineMarkup') { message.reply_markup._ != 'replyInlineMarkup') {
@ -260,6 +274,7 @@ angular.module('myApp.directives', ['myApp.filters'])
function updateMessageBody($scope, element, message) { function updateMessageBody($scope, element, message) {
updateMessageText($scope, element, message); updateMessageText($scope, element, message);
updateMessageMedia($scope, element, message); updateMessageMedia($scope, element, message);
updateMessageSignature($scope, element, message);
updateMessageKeyboard($scope, element, message); updateMessageKeyboard($scope, element, message);
} }

1
app/js/messages_manager.js

@ -1120,6 +1120,7 @@ angular.module('myApp.services')
apiMessage.toID = toPeerID; apiMessage.toID = toPeerID;
apiMessage.fromID = apiMessage.pFlags.post ? toPeerID : apiMessage.from_id; apiMessage.fromID = apiMessage.pFlags.post ? toPeerID : apiMessage.from_id;
apiMessage.signID = apiMessage.pFlags.post && apiMessage.from_id || fwdHeader && fwdHeader.from_id;
if (apiMessage.via_bot_id > 0) { if (apiMessage.via_bot_id > 0) {
apiMessage.viaBotID = apiMessage.via_bot_id; apiMessage.viaBotID = apiMessage.via_bot_id;

11
app/less/app.less

@ -1654,6 +1654,14 @@ div.im_message_video_thumb {
font-weight: bold; font-weight: bold;
// margin-right: 4px; // margin-right: 4px;
} }
.im_message_sign {
padding-top: 1px;
}
.im_message_sign_link {
pointer-events: none;
color: #adadad;
font-size: 0.95em;
}
.icon-circle { .icon-circle {
display: none; display: none;
// display: inline-block; // display: inline-block;
@ -3888,7 +3896,8 @@ ul.chat_modal_migrate_list {
.audio_player_duration, .audio_player_duration,
.audio_player_size, .audio_player_size,
.im_message_fwd_date, .im_message_fwd_date,
.im_message_views_cnt { .im_message_views_cnt,
.im_message_sign_link {
color: #899daf; color: #899daf;
} }

4
app/less/desktop.less

@ -902,12 +902,14 @@ a.footer_link.active:active {
.im_message_selected .im_message_audio_size, .im_message_selected .im_message_audio_size,
.im_message_selected .im_message_fwd_date, .im_message_selected .im_message_fwd_date,
.im_message_selected .im_message_views_cnt, .im_message_selected .im_message_views_cnt,
.im_message_selected .im_message_sign_link,
.im_history_select_active .im_message_outer_wrap:hover .im_message_date, .im_history_select_active .im_message_outer_wrap:hover .im_message_date,
.im_history_select_active .im_message_outer_wrap:hover .im_message_document_size, .im_history_select_active .im_message_outer_wrap:hover .im_message_document_size,
.im_history_select_active .im_message_outer_wrap:hover .im_message_audio_duration, .im_history_select_active .im_message_outer_wrap:hover .im_message_audio_duration,
.im_history_select_active .im_message_outer_wrap:hover .im_message_audio_size, .im_history_select_active .im_message_outer_wrap:hover .im_message_audio_size,
.im_history_select_active .im_message_outer_wrap:hover .im_message_fwd_date, .im_history_select_active .im_message_outer_wrap:hover .im_message_fwd_date,
.im_history_select_active .im_message_outer_wrap:hover .im_message_views_cnt { .im_history_select_active .im_message_outer_wrap:hover .im_message_views_cnt,
.im_history_select_active .im_message_outer_wrap:hover .im_message_sign_link {
color: #899daf; color: #899daf;
} }

3
app/less/mobile.less

@ -916,6 +916,9 @@ a.im_message_author_via {
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
} }
.im_message_sign_link {
font-size: 12px;
}
} }
.im_grouped_short a.im_message_from_photo, .im_grouped_short a.im_message_from_photo,

1
app/partials/desktop/message.html

@ -65,6 +65,7 @@
<div my-message-body="historyMessage"> <div my-message-body="historyMessage">
<div class="im_message_text" dir="auto"></div> <div class="im_message_text" dir="auto"></div>
<div class="im_message_media"></div> <div class="im_message_media"></div>
<div class="im_message_sign"></div>
<div class="im_message_keyboard"></div> <div class="im_message_keyboard"></div>
</div> </div>

1
app/partials/mobile/message.html

@ -57,6 +57,7 @@
<div class="im_message_text" dir="auto"></div> <div class="im_message_text" dir="auto"></div>
<div class="im_message_media"></div> <div class="im_message_media"></div>
<div class="im_message_sign"></div>
</div> </div>

Loading…
Cancel
Save