mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 16:37:52 +00:00
show usernames in #groupchat messages
This commit is contained in:
parent
af386f0ad9
commit
89e4d5ed07
@ -1552,13 +1552,21 @@ ol.toptrends-list {
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-name {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-time {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-time .post-info-sent {
|
||||
float: right;
|
||||
margin: 0 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-text {
|
||||
@ -2205,6 +2213,7 @@ ul.dropdown-menu .active, ul.dropdown-menu .active a {
|
||||
.post-rt-reference .post-photo {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
.post-rt-reference .post-photo img {
|
||||
|
@ -382,7 +382,10 @@
|
||||
<!-- cada li é uma mensagem -->
|
||||
<li id="dm-chat-template" class="module post message">
|
||||
<div class="post-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="post-info-time" title="08/10/13 às 18:00"><span class="post-info-sent"></span> <span></span></a>
|
||||
<div class="post-info">
|
||||
<a class="post-info-name open-profile-modal"></a>
|
||||
<a class="post-info-time"><span class="post-info-sent"></span> <span></span></a>
|
||||
</div>
|
||||
<p class="post-text"></p>
|
||||
</li>
|
||||
|
||||
|
@ -474,7 +474,10 @@
|
||||
<!-- cada li é uma mensagem -->
|
||||
<li id="dm-chat-template" class="module post message">
|
||||
<div class="post-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
|
||||
<a href="#" class="post-info-time" title="08/10/13 às 18:00"><span class="post-info-sent"></span> <span></span></a>
|
||||
<div class="post-info">
|
||||
<a class="post-info-name open-profile-modal"></a>
|
||||
<a class="post-info-time"><span class="post-info-sent"></span> <span></span></a>
|
||||
</div>
|
||||
<p class="post-text"></p>
|
||||
</li>
|
||||
|
||||
|
@ -150,7 +150,7 @@ var MAL = function()
|
||||
else
|
||||
return "#profile?user=" + username;
|
||||
//}
|
||||
}
|
||||
};
|
||||
|
||||
// recover username from url (only for hash)
|
||||
this.urlToUser = function(url) {
|
||||
|
@ -81,7 +81,7 @@ function processDmConversation(postboard, dm_screenname, dmData) {
|
||||
var dmList = dmData[dm_screenname];
|
||||
if (dmList.length) {
|
||||
for (var i = 0; i < dmList.length; i++) {
|
||||
var dmItem = dmDataToConversationItem(dmList[i], defaultScreenName, dm_screenname)
|
||||
var dmItem = postToElemDM(dmList[i], defaultScreenName, dm_screenname)
|
||||
.attr('data-id', dmList[i].id)
|
||||
.appendTo(postboard)
|
||||
;
|
||||
|
@ -280,24 +280,31 @@ function dmDataToSnippetItem(dmData, remoteUser) {
|
||||
}
|
||||
|
||||
// format dmdata (returned by getdirectmsgs) to display in conversation thread
|
||||
function dmDataToConversationItem(dmData, localUser, remoteUser) {
|
||||
var from = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
|
||||
? dmData.from
|
||||
: (dmData.fromMe ? localUser : remoteUser);
|
||||
var classDm = dmData.fromMe ? "sent" : "received";
|
||||
var dmItem = $("#dm-chat-template").clone(true);
|
||||
dmItem.removeAttr('id');
|
||||
dmItem.addClass(classDm);
|
||||
getAvatar(from, dmItem.find(".post-photo").find("img") );
|
||||
dmItem.find('.post-info-time')
|
||||
function postToElemDM(dmData, localUser, remoteUser) {
|
||||
var senderAlias = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
|
||||
? dmData.from : (dmData.fromMe ? localUser : remoteUser);
|
||||
var elem = $('#dm-chat-template').clone(true)
|
||||
.removeAttr('id')
|
||||
.addClass(dmData.fromMe ? 'sent' : 'received')
|
||||
;
|
||||
|
||||
var elemName = elem.find('.post-info-name')
|
||||
.attr('href', $.MAL.userUrl(senderAlias));
|
||||
if (senderAlias[0] === '*' )
|
||||
getGroupChatName(senderAlias, elemName);
|
||||
else
|
||||
getFullname(senderAlias, elemName);
|
||||
|
||||
getAvatar(senderAlias, elem.find('.post-photo').find('img'));
|
||||
elem.find('.post-info-time')
|
||||
.attr('title', timeSincePost(dmData.time))
|
||||
.find('span:last')
|
||||
.text(timeGmtToText(dmData.time))
|
||||
;
|
||||
setPostInfoSent(from,dmData.k,dmItem.find('.post-info-sent'));
|
||||
dmItem.find('.post-text').html(htmlFormatMsg(dmData.text).html);
|
||||
setPostInfoSent(senderAlias, dmData.k, elem.find('.post-info-sent'));
|
||||
elem.find('.post-text').html(htmlFormatMsg(dmData.text).html);
|
||||
|
||||
return dmItem;
|
||||
return elem;
|
||||
}
|
||||
|
||||
// convert message text to html, featuring @users and links formating.
|
||||
|
@ -1920,13 +1920,21 @@ textarea.splited-post {
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-name {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-time {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-time .post-info-sent {
|
||||
float: right;
|
||||
margin: 0 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-text {
|
||||
@ -2631,6 +2639,7 @@ p.post-text img {
|
||||
.post-rt-reference .post-photo {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
.post-rt-reference .post-photo img {
|
||||
|
@ -2868,17 +2868,19 @@ ol.toptrends-list a:hover {
|
||||
margin-left: 58px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* line 758, ../sass/style.sass */
|
||||
.directMessages .post-info-name {
|
||||
float: none;
|
||||
}
|
||||
|
||||
/* line 760, ../sass/style.sass */
|
||||
.directMessages .post-info-tag {
|
||||
line-height: 1em;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
font-size: 80%;
|
||||
margin: 0 0 0 1em;
|
||||
margin-left: 0.1em;
|
||||
}
|
||||
|
||||
/* line 767, ../sass/style.sass */
|
||||
@ -2911,6 +2913,13 @@ ol.toptrends-list a:hover {
|
||||
margin: 0px 10px 20px 10px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post .post-info-name {
|
||||
display: block;
|
||||
margin-left: 128px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* line 793, ../sass/style.sass */
|
||||
.direct-messages-thread .post .post-info-time {
|
||||
float: none;
|
||||
@ -2962,6 +2971,15 @@ ol.toptrends-list a:hover {
|
||||
left: 0;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.direct-messages-thread .post.sent .post-info-name {
|
||||
margin-right: 128px;
|
||||
}
|
||||
|
||||
/* line 842, ../sass/style.sass */
|
||||
.direct-messages-thread .post.sent .post-text:after {
|
||||
border-top: solid 7px transparent;
|
||||
|
Loading…
Reference in New Issue
Block a user