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 { @@ -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 { @@ -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 {

5
following.html

@ -382,7 +382,10 @@ @@ -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>

5
home.html

@ -474,7 +474,10 @@ @@ -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>

2
js/mobile_abstract.js

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

2
js/twister_directmsg.js

@ -81,7 +81,7 @@ function processDmConversation(postboard, dm_screenname, dmData) { @@ -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)
;

33
js/twister_formatpost.js

@ -280,24 +280,31 @@ function dmDataToSnippetItem(dmData, remoteUser) { @@ -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.

11
theme_calm/css/style.css

@ -1920,13 +1920,21 @@ textarea.splited-post { @@ -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 { @@ -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 {

20
theme_nin/css/style.css

@ -2868,17 +2868,19 @@ ol.toptrends-list a:hover { @@ -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 { @@ -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 { @@ -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…
Cancel
Save