Add: show note and last-status on acct

This commit is contained in:
Cutls 2019-08-31 00:09:37 +09:00
parent b50a55cce7
commit 18ce8cf2f4
3 changed files with 32 additions and 16 deletions

View File

@ -338,6 +338,7 @@ blockquote:before,
margin-left: -5px; margin-left: -5px;
display: flex; display: flex;
height: calc(100% - 3.5rem); height: calc(100% - 3.5rem);
overflow: hidden;
} }
#left-menu { #left-menu {
width: 230px; width: 230px;

View File

@ -280,6 +280,17 @@ iframe,
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.acct-note p{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.area-additional.acct-note p:not(:first-child) {
display: none;
}
.area-additional.acct-note p:first-child:after {
content: "...";
}
.area-actions { .area-actions {
padding: 0; padding: 0;
@ -386,6 +397,7 @@ iframe,
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
height: calc(0.8em + 8px); height: calc(0.8em + 8px);
user-select: none;
} }
.cbadge-hover { .cbadge-hover {
color: var(--color); color: var(--color);

View File

@ -376,7 +376,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var uniqueid = toot.id; var uniqueid = toot.id;
var toot = toot.reblog; var toot = toot.reblog;
var dis_name = escapeHTML(toot.account.display_name); var dis_name = escapeHTML(toot.account.display_name);
if(!dis_name){ if (!dis_name) {
dis_name = toot.account.acct dis_name = toot.account.acct
} }
if (toot.account.emojis) { if (toot.account.emojis) {
@ -624,9 +624,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} else { } else {
var to_mention = [toot.account.acct]; var to_mention = [toot.account.acct];
//メンションじゃなくてもlang_parse_thread //メンションじゃなくてもlang_parse_thread
if(toot.in_reply_to_id){ if (toot.in_reply_to_id) {
mentions = '<div style="float:right"><a onclick="details(\'' + toot.id + '\',' + acct_id + mentions = '<div style="float:right"><a onclick="details(\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="pointer waves-effect">' + lang.lang_parse_thread + '</a></div>'; ',\'' + tlid + '\')" class="pointer waves-effect">' + lang.lang_parse_thread + '</a></div>';
} }
} }
var tagck = toot.tags[0]; var tagck = toot.tags[0];
@ -1014,16 +1014,18 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else { } else {
var avatar = "../../img/missing.svg"; var avatar = "../../img/missing.svg";
} }
if(tlid == "dir" && acct_id == "noauth"){ if (tlid == "dir" && acct_id == "noauth") {
var udg ='<a onclick="udgEx(\'' + toot.url + '\',\'main\');" user="' + toot.acct + '" class="udg">' var udg = '<a onclick="udgEx(\'' + toot.url + '\',\'main\');" user="' + toot.acct + '" class="udg">'
}else{ } else {
var udg ='<a onclick="udg(\'' + toot.id + '\',' + var udg = '<a onclick="udg(\'' + toot.id + '\',' +
acct_id + ');" user="' + toot.acct + '" class="udg">' acct_id + ');" user="' + toot.acct + '" class="udg">'
} }
if(tlid == "dir"){ var latest = date(toot.last_status_at, "relative");
var latest = date(toot.last_status_at, "relative"); if(toot.last_status_at){
var authhtml = '<div class="cbadge" style="width:100px;">Last: ' + latest + var latesthtml = '<div class="cbadge" style="width:100px;">Last: ' + latest +
'</div>'; '</div>'
}else{
var latesthtml = ""
} }
templete = templete + templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' + '<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
@ -1037,10 +1039,11 @@ function userparse(obj, auth, acct_id, tlid, popup) {
toot.acct + locked + '</span>' + toot.acct + locked + '</span>' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<div style="justify-content:space-around;top:5px" class="area-actions"> <div class="cbadge" style="width:100px;">Follows:' + '<div class="area-additional acct-note">' + toot.note.replace(/<br\s?\/?>.+/g, "...") + '</div>' +
'<div style="justify-content:space-around;top:5px" class="area-actions"> <div class="cbadge" style="width:100px;">' + lang.lang_status_follow + ':' +
toot.following_count + toot.following_count +
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count + '</div><div class="cbadge" style="width:100px;">' + lang.lang_status_followers + ':' + toot.followers_count +
'</div>' + authhtml + '</div>' + latesthtml + authhtml +
'</div>' + '</div>' +
'</div>'; '</div>';
} }