|
|
@ -218,11 +218,12 @@ function refreshTwistdayReminder() { |
|
|
|
item.find('.twister-user-info').attr('data-screen-name', lucky); |
|
|
|
item.find('.twister-user-info').attr('data-screen-name', lucky); |
|
|
|
item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky)); |
|
|
|
item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky)); |
|
|
|
item.find('.twister-user-tag').text('@' +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') |
|
|
|
if (typeof(time) !== 'undefined') |
|
|
|
item.find('.twisterday').text(timeGmtToText(time)); |
|
|
|
itemTwisterday.text(timeGmtToText(time)); |
|
|
|
else |
|
|
|
else |
|
|
|
item.find('.twisterday').text(timeGmtToText(post.userpost.time)); |
|
|
|
itemTwisterday.text(timeGmtToText(post.userpost.time)); |
|
|
|
item.find('.twisterday').bind('click', (function(e) { replyInitPopup(e, post); }).bind(post)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAvatar(lucky, item.find('.twister-user-photo')); |
|
|
|
getAvatar(lucky, item.find('.twister-user-photo')); |
|
|
|
getFullname(lucky, item.find('.twister-user-full')); |
|
|
|
getFullname(lucky, item.find('.twister-user-full')); |
|
|
@ -231,8 +232,7 @@ function refreshTwistdayReminder() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
function removeLuckyFromList(list, post) { |
|
|
|
function removeLuckyFromList(list, post) { |
|
|
|
var lucky = post.userpost.n; |
|
|
|
list.find('[data-screen-name='+post.userpost.n+']').closest('li').remove(); |
|
|
|
list.find('[data-screen-name='+lucky+']').closest('li').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var showUpcomingTimer = ($.Options.getTwistdayReminderShowUpcomingOpt() === 'enable') ? $.Options.getTwistdayReminderShowUpcomingTimerOpt() *3600 : 0; |
|
|
|
var showUpcomingTimer = ($.Options.getTwistdayReminderShowUpcomingOpt() === 'enable') ? $.Options.getTwistdayReminderShowUpcomingTimerOpt() *3600 : 0; |
|
|
@ -246,30 +246,29 @@ function refreshTwistdayReminder() { |
|
|
|
var thatSec; |
|
|
|
var thatSec; |
|
|
|
|
|
|
|
|
|
|
|
posts.sort(function(a,b) { |
|
|
|
posts.sort(function(a,b) { |
|
|
|
if (parseInt(a.userpost.time) > parseInt(b.userpost.time)) |
|
|
|
return (parseInt(a.userpost.time) > parseInt(b.userpost.time)) ? 1 : -1; |
|
|
|
return 1; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < posts.length; i++) { |
|
|
|
for (var i = 0; i < posts.length; i++) { |
|
|
|
d.setTime(0); |
|
|
|
if (followingUsers.indexOf(posts[i].userpost.n) > -1) { |
|
|
|
d.setUTCSeconds(posts[i].userpost.time); |
|
|
|
d.setTime(0); |
|
|
|
if (d.getUTCMonth() === todayMonth && d.getUTCDate() === todayDate) { |
|
|
|
d.setUTCSeconds(posts[i].userpost.time); |
|
|
|
addLuckyToList(listCurrent, posts[i]); |
|
|
|
if (d.getUTCMonth() === todayMonth && d.getUTCDate() === todayDate) { |
|
|
|
} else if (showUpcomingTimer > 0) { |
|
|
|
addLuckyToList(listCurrent, posts[i]); |
|
|
|
thatSec = Date.UTC(todayYear,d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()) /1000; |
|
|
|
} else if (showUpcomingTimer > 0) { |
|
|
|
if (thatSec > todaySec && thatSec -todaySec <= showUpcomingTimer) { |
|
|
|
thatSec = Date.UTC(todayYear,d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()) /1000; |
|
|
|
d.setTime(0); |
|
|
|
if (thatSec > todaySec && thatSec -todaySec <= showUpcomingTimer) { |
|
|
|
d.setUTCSeconds(thatSec); |
|
|
|
d.setTime(0); |
|
|
|
addLuckyToList(listUpcoming, posts[i], d.getTime() /1000); |
|
|
|
d.setUTCSeconds(thatSec); |
|
|
|
|
|
|
|
addLuckyToList(listUpcoming, posts[i], d.getTime() /1000); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
removeLuckyFromList(listCurrent, posts[i]); |
|
|
|
|
|
|
|
removeLuckyFromList(listUpcoming, posts[i]); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
removeLuckyFromList(listCurrent, posts[i]); |
|
|
|
removeLuckyFromList(listCurrent, posts[i]); |
|
|
|
removeLuckyFromList(listUpcoming, posts[i]); |
|
|
|
removeLuckyFromList(listUpcoming, posts[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
removeLuckyFromList(listCurrent, posts[i]); |
|
|
|
|
|
|
|
removeLuckyFromList(listUpcoming, posts[i]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|