From 64e85c36010e5e97e7fda04d177b92d46faeaab0 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Tue, 10 Mar 2015 23:36:09 +0500 Subject: [PATCH] deleting user self-retwisted posts when unfollow, fix of follow button placement in who-to-follow, workaround checks of in TwisterFollowing.update --- css/style.css | 9 +++++---- js/interface_home.js | 3 ++- js/twister_following.js | 22 ++++++++++++---------- theme_calm/css/style.css | 9 +++++---- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/css/style.css b/css/style.css index 553264a..6f0dd96 100644 --- a/css/style.css +++ b/css/style.css @@ -145,9 +145,9 @@ button.follow:hover, button.unfollow:hover, .following-list button.private:hover } .follow-suggestions .follow, .follow-suggestions .unfollow { - display: block; - position: relative; - left: 50%; + display: inline-block; + float: right; + margin-right: 10px; } /************************************* @@ -702,7 +702,8 @@ textarea.splited-post { .twister-user { clear: both; - padding-bottom: 10px; + overflow: hidden; + padding-bottom: 4px; margin-top: 4px; border-bottom: solid 1px rgba( 69, 71, 77, .1 ); border-top: solid 1px rgba( 69, 71, 77, .1 ); diff --git a/js/interface_home.js b/js/interface_home.js index ff8b208..436cca1 100644 --- a/js/interface_home.js +++ b/js/interface_home.js @@ -148,7 +148,8 @@ var InterfaceFunctions = function() .on("eventUnfollow", function(e, user) { $(".following-count").text(followingUsers.length-1); $('.wrapper .postboard .post').each( function() { - if ($(this).find('[data-screen-name="'+user+'"]').length && !$(this).find(".post-retransmited-by").text()) + if ($(this).find('[data-screen-name="'+user+'"]').length + && (!$(this).find(".post-retransmited-by").text() || $(this).find(".post-retransmited-by").text() == '@'+user)) $( this ).remove(); }); }); diff --git a/js/twister_following.js b/js/twister_following.js index 60ee65a..71308c4 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -93,9 +93,9 @@ TwisterFollowing.prototype = { delete this.followingsFollowings[username]; this.save(); } - if (username in _idTrackerMap) + if (typeof _idTrackerMap !== 'undefined' && username in _idTrackerMap) delete _idTrackerMap[username]; - if (username in _lastHaveMap) + if (typeof _lastHaveMap !== 'undefined' && username in _lastHaveMap) delete _lastHaveMap[username]; return; } @@ -111,14 +111,16 @@ TwisterFollowing.prototype = { if (updated) this.save(); - for (var user in _idTrackerMap) { - if (followingUsers.indexOf(user) < 0) - delete _idTrackerMap[user]; - } - for (var user in _lastHaveMap) { - if (followingUsers.indexOf(user) < 0) - delete _lastHaveMap[user]; - } + if (typeof _idTrackerMap !== 'undefined') + for (var user in _idTrackerMap) { + if (followingUsers.indexOf(user) < 0) + delete _idTrackerMap[user]; + } + if (typeof _lastHaveMap !== 'undefined') + for (var user in _lastHaveMap) { + if (followingUsers.indexOf(user) < 0) + delete _lastHaveMap[user]; + } for (; i < followingUsers.length; i++) { var ctime = new Date().getTime() / 1000; diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index d81a177..3b69a14 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -166,9 +166,9 @@ button.unfollow:hover { } .follow-suggestions .follow, .follow-suggestions .unfollow { - display: block; - position: relative; - left: 50%; + display: inline-block; + float: right; + margin-right: 10px; } /************************************* @@ -892,7 +892,8 @@ textarea.splited-post { .twister-user { clear: both; - padding-bottom: 10px; + overflow: hidden; + padding-bottom: 4px; margin-top: 4px; border-bottom: solid 1px rgba( 69, 71, 77, .1 ); border-top: solid 1px rgba( 69, 71, 77, .1 );