From 0a51e2f0da70c0bf1e1b0ec8044431a893b9bb4b Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 13 May 2015 00:38:36 +0500 Subject: [PATCH] exluding advert msg of random guy from twisterday reminder routine, fixes of its css --- css/style.css | 8 ++++++-- js/interface_home.js | 43 +++++++++++++++++++-------------------- theme_calm/css/style.css | 8 ++++++-- theme_nin/css/style.css | 12 ++++++++--- theme_nin/sass/style.sass | 9 +++++--- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/css/style.css b/css/style.css index 1d1c22a..825b221 100644 --- a/css/style.css +++ b/css/style.css @@ -836,7 +836,7 @@ ol.toptrends-list { .twistday-reminder h4 { margin: 1% 1% 1% 16%; - font-size: 90%; + font-size: 10px; color: rgba(0, 0, 0, 0.5); } @@ -849,6 +849,10 @@ ol.toptrends-list { padding: 5px; } +.twistday-reminder .twister-user-info { + margin: 1.2% 0 -2.8% 0; +} + .twistday-reminder .twister-user-tag, .twistday-reminder .twister-user-full { display: block; @@ -857,7 +861,7 @@ ol.toptrends-list { } .twistday-reminder .twisterday { - font-size: 80%; + font-size: 11px; margin-left: 11%; } diff --git a/js/interface_home.js b/js/interface_home.js index 291173f..84adf92 100644 --- a/js/interface_home.js +++ b/js/interface_home.js @@ -218,11 +218,12 @@ function refreshTwistdayReminder() { item.find('.twister-user-info').attr('data-screen-name', lucky); item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky)); item.find('.twister-user-tag').text('@' +lucky); + itemTwisterday = item.find('.twisterday'); + itemTwisterday.bind('click', (function(e) { replyInitPopup(e, post); }).bind(post)); if (typeof(time) !== 'undefined') - item.find('.twisterday').text(timeGmtToText(time)); + itemTwisterday.text(timeGmtToText(time)); else - item.find('.twisterday').text(timeGmtToText(post.userpost.time)); - item.find('.twisterday').bind('click', (function(e) { replyInitPopup(e, post); }).bind(post)); + itemTwisterday.text(timeGmtToText(post.userpost.time)); getAvatar(lucky, item.find('.twister-user-photo')); getFullname(lucky, item.find('.twister-user-full')); @@ -231,8 +232,7 @@ function refreshTwistdayReminder() { } } function removeLuckyFromList(list, post) { - var lucky = post.userpost.n; - list.find('[data-screen-name='+lucky+']').closest('li').remove(); + list.find('[data-screen-name='+post.userpost.n+']').closest('li').remove(); } var showUpcomingTimer = ($.Options.getTwistdayReminderShowUpcomingOpt() === 'enable') ? $.Options.getTwistdayReminderShowUpcomingTimerOpt() *3600 : 0; @@ -246,30 +246,29 @@ function refreshTwistdayReminder() { var thatSec; posts.sort(function(a,b) { - if (parseInt(a.userpost.time) > parseInt(b.userpost.time)) - return 1; - else - return -1; + return (parseInt(a.userpost.time) > parseInt(b.userpost.time)) ? 1 : -1; }); for (var i = 0; i < posts.length; i++) { - d.setTime(0); - d.setUTCSeconds(posts[i].userpost.time); - if (d.getUTCMonth() === todayMonth && d.getUTCDate() === todayDate) { - addLuckyToList(listCurrent, posts[i]); - } else if (showUpcomingTimer > 0) { - thatSec = Date.UTC(todayYear,d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()) /1000; - if (thatSec > todaySec && thatSec -todaySec <= showUpcomingTimer) { - d.setTime(0); - d.setUTCSeconds(thatSec); - addLuckyToList(listUpcoming, posts[i], d.getTime() /1000); + if (followingUsers.indexOf(posts[i].userpost.n) > -1) { + d.setTime(0); + d.setUTCSeconds(posts[i].userpost.time); + if (d.getUTCMonth() === todayMonth && d.getUTCDate() === todayDate) { + addLuckyToList(listCurrent, posts[i]); + } else if (showUpcomingTimer > 0) { + thatSec = Date.UTC(todayYear,d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()) /1000; + if (thatSec > todaySec && thatSec -todaySec <= showUpcomingTimer) { + d.setTime(0); + d.setUTCSeconds(thatSec); + addLuckyToList(listUpcoming, posts[i], d.getTime() /1000); + } else { + removeLuckyFromList(listCurrent, posts[i]); + removeLuckyFromList(listUpcoming, posts[i]); + } } else { removeLuckyFromList(listCurrent, posts[i]); removeLuckyFromList(listUpcoming, posts[i]); } - } else { - removeLuckyFromList(listCurrent, posts[i]); - removeLuckyFromList(listUpcoming, posts[i]); } } diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index f142274..41a3a0d 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1019,7 +1019,7 @@ textarea.splited-post { .twistday-reminder h4 { margin: 1% 1% 1% 16%; - font-size: 90%; + font-size: 10px; color: rgba(0, 0, 0, 0.5); } @@ -1032,6 +1032,10 @@ textarea.splited-post { padding: 5px; } +.twistday-reminder .twister-user-info { + margin: 1.2% 0 -2.8% 0; +} + .twistday-reminder .twister-user-tag, .twistday-reminder .twister-user-full { display: block; @@ -1040,7 +1044,7 @@ textarea.splited-post { } .twistday-reminder .twisterday { - font-size: 80%; + font-size: 11px; margin-left: 11%; } diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 46ddf43..bc11378 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -2538,12 +2538,13 @@ ol.toptrends-list a:hover { } .twistday-reminder h3 { + font-size: 0.98em; float: left; } .twistday-reminder h4 { margin: 1% 1% 1% 16%; - font-size: 90%; + font-size: 0.84em; color: rgba(0, 0, 0, 0.5); } @@ -2551,9 +2552,14 @@ ol.toptrends-list a:hover { text-decoration: none; } +.twistday-reminder .current .label, .twistday-reminder .upcoming .label { + margin-right: 10%; +} + .twistday-reminder .twister-user-info { - margin-top: 8px; + margin-top: 1.2%; } + .twistday-reminder .twister-user-tag, .twistday-reminder .twister-user-full { display: block; @@ -2566,7 +2572,7 @@ ol.toptrends-list a:hover { } .twistday-reminder .twisterday { - font-size: 80%; + font-size: 0.8em; margin-left: 8%; } diff --git a/theme_nin/sass/style.sass b/theme_nin/sass/style.sass index 0d8f1c1..6bceb22 100755 --- a/theme_nin/sass/style.sass +++ b/theme_nin/sass/style.sass @@ -585,15 +585,18 @@ ol.toptrends-list small display: none h3 + font-size: 0.98em float: left h4 margin: 1% 1% 1% 16% - font-size: 90% + font-size: 0.84em color: rgba(0, 0, 0, 0.5) a:hover text-decoration: none + .current .label, .upcoming .label + margin-right: 10% .twister-user-info - margin-top: 8px + margin-top: 1.2% .twister-user-tag, .twister-user-full display: block margin: 0 @@ -601,7 +604,7 @@ ol.toptrends-list img.twister-user-photo margin: 0 .twisterday - font-size: 80% + font-size: 0.8em margin-left: 8% &.hover cursor: pointer