Browse Source

Merge pull request #1 from slr/latest-activity

latest activity
readme-update
erqan 8 years ago committed by GitHub
parent
commit
fc3fd21015
  1. 11
      css/style.css
  2. 12
      home.html
  3. 27
      js/interface_common.js
  4. 2
      js/twister_following.js
  5. 23
      js/twister_io.js
  6. 20
      theme_calm/css/style.css
  7. 20
      theme_nin/css/style.css

11
css/style.css

@ -891,19 +891,19 @@ textarea.splited-post { @@ -891,19 +891,19 @@ textarea.splited-post {
}
.followers,
.last-activity
{
.latest-activity {
font-size: 12px;
color: rgba( 0, 0, 0, .6 );
margin-left: 58px;
}
.followed-by,
.user-status-time
{
.latest-activity .time {
color: #e34f42;
font-size: 13px;
cursor: pointer;
}
.twister-user-name,
.twister-by-user-name
{
@ -2389,12 +2389,13 @@ ol.toptrends-list { @@ -2389,12 +2389,13 @@ ol.toptrends-list {
right: 32px;
}
.following-own-modal .following-list .last-activity {
.following-own-modal .following-list .latest-activity {
position: absolute;
top: 110px;
right: 32px;
margin: 0;
}
/*************************************
*********** AUTOCOMPLETING ***********
**************************************/

12
home.html

@ -302,9 +302,9 @@ @@ -302,9 +302,9 @@
</a>
</div>
<a class="twister-user-remove">&times;</a>
<div class="last-activity">
<div class="latest-activity" data-screen-name="" data-id="" data-time="0">
<span class="label">Last activity</span>
<span class="user-status-time" data-time="0" data-screen-name="" data-id=""></span>
<span class="time"></span>
</div>
<button class="follow">Follow</button>
</div>
@ -780,11 +780,9 @@ @@ -780,11 +780,9 @@
<div>
<span class="swarm-status" style="display: none;"></span>
</div>
<div>
<span class="last-activity">
<span class="label">Last activity</span>
<span class="user-status-time" data-time="0" data-screen-name="" data-id=""></span>
</span>
<div class="latest-activity" data-screen-name="" data-id="" data-time="0">
<span class="label">Last activity</span>
<span class="time"></span>
</div>
</div>
</li>

27
js/interface_common.js

@ -711,7 +711,7 @@ function addPeerToFollowingList(list, peerAlias) { @@ -711,7 +711,7 @@ function addPeerToFollowingList(list, peerAlias) {
.on('mouseup', {route: $.MAL.mentionsUrl(peerAlias)}, routeOnClick);
getAvatar(peerAlias, item.find('.mini-profile-photo'));
getFullname(peerAlias, item.find('.mini-profile-name'));
getStatusTime(peerAlias, item.find('.user-status-time'));
getStatusTime(peerAlias, item.find('.latest-activity .time'));
if (peerAlias === defaultScreenName)
item.find('.following-config').hide();
@ -752,7 +752,7 @@ function fillWhoToFollowModal(list, hlist, start) { @@ -752,7 +752,7 @@ function fillWhoToFollowModal(list, hlist, start) {
getFullname(utf, item.find('.twister-user-full'));
getBioToElem(utf, item.find('.bio'));
getFullname(followingUsers[i], item.find('.followed-by').text(followingUsers[i]));
getStatusTime(utf,item.find('.user-status-time'));
getStatusTime(utf, item.find('.latest-activity .time'));
item.find('.twister-user-remove').remove();
@ -875,14 +875,22 @@ function handleClickOpenProfileModal(event) { @@ -875,14 +875,22 @@ function handleClickOpenProfileModal(event) {
}
function handleClickOpenConversation(event) {
event.preventDefault();
event.stopPropagation();
var elem = $(event.target).closest(event.data.feeder);
if (!elem.length) {
muteEvent(event, true);
return;
}
var elem = $(event.target);
var postData = elem.closest(event.data.feeder);
var post = {
writer: elem.attr('data-screen-name'),
id: elem.attr('data-id')
};
if (!post.writer || !post.id) {
muteEvent(event, true);
return;
}
event.data.route = '#conversation?post=' + postData.attr('data-screen-name')
+ ':post' + postData.attr('data-id');
event.data.route = '#conversation?post=' + post.writer + ':post' + post.id;
routeOnClick(event);
}
@ -2623,7 +2631,8 @@ function initInterfaceCommon() { @@ -2623,7 +2631,8 @@ function initInterfaceCommon() {
displayQueryPending($('.hashtag-modal .postboard-posts'));
});
$('.user-status-time').on('mouseup', {feeder: '.user-status-time'}, handleClickOpenConversation);
getElem('.latest-activity', true).on('mouseup',
{feeder: '.latest-activity'}, handleClickOpenConversation);
replaceDashboards();
$(window).resize(replaceDashboards);

2
js/twister_following.js

@ -515,7 +515,7 @@ function processWhoToFollowSuggestion(suggestion, followedBy) { @@ -515,7 +515,7 @@ function processWhoToFollowSuggestion(suggestion, followedBy) {
getAvatar(suggestion, item.find('.twister-user-photo'));
getFullname(followedBy, item.find('.followed-by').text(followedBy));
getStatusTime(suggestion,item.find('.user-status-time'));
getStatusTime(suggestion, item.find('.latest-activity .time'));
item.find('.twister-user-remove').on('click', function() {
item.remove();

23
js/twister_io.js

@ -524,19 +524,16 @@ function getPostsCount(peerAlias, elem) { @@ -524,19 +524,16 @@ function getPostsCount(peerAlias, elem) {
function getStatusTime(peerAlias, elem) {
dhtget(peerAlias, 'status', 's',
function(req, v) {
var time = 0;
var k = -1;
if (v && v.userpost) {
time = v.userpost.time;
k = v.userpost.k;
}
elem.text(timeGmtToText(time));
elem.attr('data-time', time);
if (k > -1) {
elem.attr('data-screen-name', peerAlias);
elem.attr('data-id', k);
}
function (req, ret) {
if (!ret || !ret.userpost)
return;
req.elem.text(timeGmtToText(ret.userpost.time))
.closest('.latest-activity')
.attr('data-screen-name', req.peerAlias)
.attr('data-id', ret.userpost.k)
.attr('data-time', ret.userpost.time)
;
}, {peerAlias: peerAlias, elem: elem}
);
}

20
theme_calm/css/style.css

@ -1072,16 +1072,19 @@ textarea.splited-post { @@ -1072,16 +1072,19 @@ textarea.splited-post {
opacity: .8;
}
.followers
{
.followers,
.latest-activity {
font-size: 12px;
color: rgba( 0, 0, 0, .6 );
margin-left: 58px;
}
.followed-by
{
.followed-by,
.latest-activity .time {
font-size: 13px;
cursor: pointer;
}
.twister-user-name,
.twister-by-user-name
{
@ -2767,7 +2770,7 @@ textarea.splited-post { @@ -2767,7 +2770,7 @@ textarea.splited-post {
display: inline-block;
text-align: initial;
width: 320px;
height: 120px;
height: 130px;
margin: 2px;
padding: 2px;
border: solid 1px rgba(69, 71, 77, .1);
@ -2813,6 +2816,13 @@ textarea.splited-post { @@ -2813,6 +2816,13 @@ textarea.splited-post {
right: 32px;
}
.following-own-modal .following-list .latest-activity {
position: absolute;
top: 110px;
right: 32px;
margin: 0;
}
.gifCheckBox {
float: right;
vertical-align: middle;

20
theme_nin/css/style.css

@ -2209,7 +2209,8 @@ textarea.splited-post { @@ -2209,7 +2209,8 @@ textarea.splited-post {
}
/* line 447, ../sass/style.sass */
.followers {
.followers,
.latest-activity {
font-size: 12px;
color: #66686B;
}
@ -2219,13 +2220,22 @@ textarea.splited-post { @@ -2219,13 +2220,22 @@ textarea.splited-post {
}
/* line 453, ../sass/style.sass */
.followed-by {
.followed-by,
.latest-activity {
color: #aaa;
font-size: 12px;
cursor: pointer;
display: block;
}
.who-to-follow .latest-activity {
margin-bottom: 8px;
}
.who-to-follow .latest-activity .label {
display: none;
}
/* line 459, ../sass/style.sass */
.twister-user-name, .twister-by-user-name {
font-weight: bold;
@ -3356,7 +3366,7 @@ ol.toptrends-list a:hover { @@ -3356,7 +3366,7 @@ ol.toptrends-list a:hover {
.following-own-modal .following-list > li {
display: inline-block;
width: 320px;
height: 160px;
height: 184px;
margin: 2px;
padding: 2px;
border: solid 1px rgba(69, 71, 77, .1);
@ -3456,6 +3466,10 @@ ol.toptrends-list a:hover { @@ -3456,6 +3466,10 @@ ol.toptrends-list a:hover {
display: block;
}
.following-own-modal .following-list .latest-activity {
font-size: 11px;
}
/********** AUTOCOMPLETING *********/
/* line 1087, ../sass/style.sass */

Loading…
Cancel
Save