Browse Source

Improved copyable text

master
Igor Zhukov 9 years ago
parent
commit
c9698e125a
  1. 4
      app/js/directives.js
  2. 14
      app/less/desktop.less
  3. 7
      app/partials/desktop/message.html

4
app/js/directives.js

@ -2855,7 +2855,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var peerID, peer, peerPhoto; var peerID, peer, peerPhoto;
var imgEl = $('<img class="' + (attrs.imgClass || '') + '">'); var imgEl = $('<img class="' + (attrs.imgClass || '') + '">');
var initEl = $('<span class="peer_initials ' + (attrs.imgClass || '') + '"></span>'); var initEl = $('<span class="peer_initials nocopy ' + (attrs.imgClass || '') + '"></span>');
var jump = 0; var jump = 0;
var prevClass = false; var prevClass = false;
@ -2896,7 +2896,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} }
} }
initEl.text(peer.initials).prependTo(element); initEl.attr('data-content', encodeEntities(peer.initials)).prependTo(element);
imgEl.remove(); imgEl.remove();

14
app/less/desktop.less

@ -1796,18 +1796,14 @@ a.im_panel_peer_photo .peer_initials {
margin-top: 4px; margin-top: 4px;
margin-bottom: 4px; margin-bottom: 4px;
} }
.im_grouped_short .im_message_author_via, .im_grouped_short .im_message_author_wrap,
.im_grouped_short .im_message_from_photo, .im_grouped_short .im_message_from_photo,
.im_grouped_short .im_message_author, .im_grouped .im_message_author_wrap,
.im_grouped .im_message_author_via,
.im_grouped .im_message_from_photo, .im_grouped .im_message_from_photo,
.im_grouped .im_message_author, .im_grouped_fwd .im_message_author_wrap,
.im_grouped_fwd .im_message_author_via,
.im_grouped_fwd .im_message_from_photo, .im_grouped_fwd .im_message_from_photo,
.im_grouped_fwd .im_message_author, .im_grouped_fwd_short .im_message_author_wrap,
.im_grouped_fwd_short .im_message_author_via, .im_grouped_fwd_short .im_message_from_photo {
.im_grouped_fwd_short .im_message_from_photo,
.im_grouped_fwd_short .im_message_author {
display: none; display: none;
} }

7
app/partials/desktop/message.html

@ -44,7 +44,10 @@
<div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media ? true : false}"> <div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media ? true : false}">
<span class="copyonly">[<span ng-bind="::historyMessage.date | time"></span>] </span><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" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"></a></my-i18n-param></span><span class="copyonly">:</span> <span class="im_message_author_wrap">
<span class="copyonly">[<span ng-bind="::historyMessage.date | time"></span>] </span><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"><span class="copyonly">&nbsp;</span><span 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><span class="copyonly">:</span></span>
</span>
<a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a> <a class="im_message_reply_wrap" my-reply-message="historyMessage.reply_to_msg" ng-if="::historyMessage.reply_to_mid"></a>
@ -52,7 +55,7 @@
<span class="copyonly"><span my-i18n="message_forwarded_message"></span>:&nbsp;</span> <span class="copyonly"><span my-i18n="message_forwarded_message"></span>:&nbsp;</span>
<a class="im_message_fwd_photo pull-left" my-peer-photolink="::historyMessage.fwdFromID" img-class="im_message_fwd_photo"></a> <a class="im_message_fwd_photo pull-left" my-peer-photolink="::historyMessage.fwdFromID" img-class="im_message_fwd_photo"></a>
<div class="im_message_fwd_author_wrap"> <div class="im_message_fwd_author_wrap">
<a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID"></a><span ng-if="::historyMessage.viaBotID" class="im_message_fwd_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 class="copyonly">&nbsp;[</span><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span><span class="copyonly">]&nbsp;</span> <a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID"></a><span ng-if="::historyMessage.viaBotID" class="im_message_fwd_via"><span class="copyonly">&nbsp;</span><span 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><span class="copyonly">&nbsp;[</span><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_date | dateOrTime"></span><span class="copyonly">]&nbsp;</span>
<span class="im_message_views_inline" ng-if="::historyMessage.views > 0"> <span class="im_message_views_inline" ng-if="::historyMessage.views > 0">
<i class="icon-message-views"></i><span class="im_message_views_cnt" my-message-views="historyMessage.mid"></span> <i class="icon-message-views"></i><span class="im_message_views_cnt" my-message-views="historyMessage.mid"></span>
</span> </span>

Loading…
Cancel
Save