Browse Source

show usernames in #groupchat messages

master
Simon Grim 9 years ago
parent
commit
89e4d5ed07
  1. 11
      css/style.css
  2. 5
      following.html
  3. 5
      home.html
  4. 2
      js/mobile_abstract.js
  5. 2
      js/twister_directmsg.js
  6. 33
      js/twister_formatpost.js
  7. 11
      theme_calm/css/style.css
  8. 20
      theme_nin/css/style.css

11
css/style.css

@ -1552,13 +1552,21 @@ ol.toptrends-list {
left: auto; 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 { .direct-messages-thread .post.sent .post-info-time {
float: left; float: left;
} }
.direct-messages-thread .post.sent .post-info-time .post-info-sent { .direct-messages-thread .post.sent .post-info-time .post-info-sent {
float: right; float: right;
margin: 0 2px; margin-left: 2px;
} }
.direct-messages-thread .post.sent .post-text { .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 { .post-rt-reference .post-photo {
width: 24px; width: 24px;
height: 24px; height: 24px;
margin: 4px;
} }
.post-rt-reference .post-photo img { .post-rt-reference .post-photo img {

5
following.html

@ -382,7 +382,10 @@
<!-- cada li é uma mensagem --> <!-- cada li é uma mensagem -->
<li id="dm-chat-template" class="module post message"> <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> <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> <p class="post-text"></p>
</li> </li>

5
home.html

@ -474,7 +474,10 @@
<!-- cada li é uma mensagem --> <!-- cada li é uma mensagem -->
<li id="dm-chat-template" class="module post message"> <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> <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> <p class="post-text"></p>
</li> </li>

2
js/mobile_abstract.js

@ -150,7 +150,7 @@ var MAL = function()
else else
return "#profile?user=" + username; return "#profile?user=" + username;
//} //}
} };
// recover username from url (only for hash) // recover username from url (only for hash)
this.urlToUser = function(url) { this.urlToUser = function(url) {

2
js/twister_directmsg.js

@ -81,7 +81,7 @@ function processDmConversation(postboard, dm_screenname, dmData) {
var dmList = dmData[dm_screenname]; var dmList = dmData[dm_screenname];
if (dmList.length) { if (dmList.length) {
for (var i = 0; i < dmList.length; i++) { 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) .attr('data-id', dmList[i].id)
.appendTo(postboard) .appendTo(postboard)
; ;

33
js/twister_formatpost.js

@ -280,24 +280,31 @@ function dmDataToSnippetItem(dmData, remoteUser) {
} }
// format dmdata (returned by getdirectmsgs) to display in conversation thread // format dmdata (returned by getdirectmsgs) to display in conversation thread
function dmDataToConversationItem(dmData, localUser, remoteUser) { function postToElemDM(dmData, localUser, remoteUser) {
var from = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0)) var senderAlias = (dmData.from && dmData.from.length && dmData.from.charCodeAt(0))
? dmData.from ? dmData.from : (dmData.fromMe ? localUser : remoteUser);
: (dmData.fromMe ? localUser : remoteUser); var elem = $('#dm-chat-template').clone(true)
var classDm = dmData.fromMe ? "sent" : "received"; .removeAttr('id')
var dmItem = $("#dm-chat-template").clone(true); .addClass(dmData.fromMe ? 'sent' : 'received')
dmItem.removeAttr('id'); ;
dmItem.addClass(classDm);
getAvatar(from, dmItem.find(".post-photo").find("img") ); var elemName = elem.find('.post-info-name')
dmItem.find('.post-info-time') .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)) .attr('title', timeSincePost(dmData.time))
.find('span:last') .find('span:last')
.text(timeGmtToText(dmData.time)) .text(timeGmtToText(dmData.time))
; ;
setPostInfoSent(from,dmData.k,dmItem.find('.post-info-sent')); setPostInfoSent(senderAlias, dmData.k, elem.find('.post-info-sent'));
dmItem.find('.post-text').html(htmlFormatMsg(dmData.text).html); elem.find('.post-text').html(htmlFormatMsg(dmData.text).html);
return dmItem; return elem;
} }
// convert message text to html, featuring @users and links formating. // convert message text to html, featuring @users and links formating.

11
theme_calm/css/style.css

@ -1920,13 +1920,21 @@ textarea.splited-post {
left: auto; 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 { .direct-messages-thread .post.sent .post-info-time {
float: left; float: left;
} }
.direct-messages-thread .post.sent .post-info-time .post-info-sent { .direct-messages-thread .post.sent .post-info-time .post-info-sent {
float: right; float: right;
margin: 0 2px; margin-left: 2px;
} }
.direct-messages-thread .post.sent .post-text { .direct-messages-thread .post.sent .post-text {
@ -2631,6 +2639,7 @@ p.post-text img {
.post-rt-reference .post-photo { .post-rt-reference .post-photo {
width: 24px; width: 24px;
height: 24px; height: 24px;
margin: 4px;
} }
.post-rt-reference .post-photo img { .post-rt-reference .post-photo img {

20
theme_nin/css/style.css

@ -2868,17 +2868,19 @@ ol.toptrends-list a:hover {
margin-left: 58px; margin-left: 58px;
font-size: 0.9em; font-size: 0.9em;
} }
/* line 758, ../sass/style.sass */ /* line 758, ../sass/style.sass */
.directMessages .post-info-name { .directMessages .post-info-name {
float: none; float: none;
} }
/* line 760, ../sass/style.sass */ /* line 760, ../sass/style.sass */
.directMessages .post-info-tag { .directMessages .post-info-tag {
line-height: 1em; line-height: 1em;
padding: 0; padding: 0;
display: inline; display: inline;
font-size: 80%; font-size: 80%;
margin: 0 0 0 1em; margin-left: 0.1em;
} }
/* line 767, ../sass/style.sass */ /* line 767, ../sass/style.sass */
@ -2911,6 +2913,13 @@ ol.toptrends-list a:hover {
margin: 0px 10px 20px 10px; margin: 0px 10px 20px 10px;
cursor: default; cursor: default;
} }
.direct-messages-thread .post .post-info-name {
display: block;
margin-left: 128px;
padding: 0;
}
/* line 793, ../sass/style.sass */ /* line 793, ../sass/style.sass */
.direct-messages-thread .post .post-info-time { .direct-messages-thread .post .post-info-time {
float: none; float: none;
@ -2962,6 +2971,15 @@ ol.toptrends-list a:hover {
left: 0; left: 0;
top: 10px; 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 */ /* line 842, ../sass/style.sass */
.direct-messages-thread .post.sent .post-text:after { .direct-messages-thread .post.sent .post-text:after {
border-top: solid 7px transparent; border-top: solid 7px transparent;

Loading…
Cancel
Save