2 var INTERVAL_COOKIE = 'homeInterval';
5 $("#allTimeline").click(function(e) {
6 var $this = $(e.target);
7 var type = $this.attr('class');
39 markReply($("#allTimeline > li"));
40 $("#submit_btn").click(function (e) {
44 $("body").live("click", function (e) {
45 document.title = document.title.replace(/(\([0-9]+\))/g, "");
50 var setUpdateInterval = function () {
51 if (!location.href.split("?")[1] || location.href.split("?")[1] == "p=1") {
52 var interval = parseFloat($.cookie(INTERVAL_COOKIE));
53 if (interval === 0.0) {
56 interval = interval > 0 ? interval : 1;
57 UPDATE_INTERVAL = setInterval(function () {
59 }, interval * 1000 * 60);
63 if (PAUSE_UPDATE === true) {
64 window.setTimeout(update, 5000);
65 } else if (PAUSE_TIMELINE === true) {
68 PAUSE_TIMELINE = true;
69 updateSentTip('Retrieving new tweets...', 5000, 'ing');
70 if ($.cookie("intervalChanged") === "true") {
71 clearInterval(UPDATE_INTERVAL);
72 $.cookie("intervalChanged", "")
75 $("ol.timeline li.mine").removeClass("mine").addClass("myTweet");
76 var since_id = $("ol.timeline li:not(.myTweet):not(#ajax_statuses li):first").find(".status_id").text();
78 url: "ajax/updateTimeline.php",
81 data: "since_id=" + since_id,
82 success: function (msg) {
83 if ($.trim(msg).indexOf("</li>") > 0) {
84 var source = $(msg).prependTo($(".timeline"));
86 if (document.title.match(/\d+/) != null) {
87 num = parseInt(document.title.match(/\d+/));
89 document.title = "(" + (num + $(msg).length - 1) + ") " + document.title.replace(/(\([0-9]+\))/g, "");
90 markReply($('#allTimeline > li'));
93 if($("div.new").length == 1) {
94 $("div.new").show().slideDown("fast");
96 $("div.new").filter(":first").remove();
97 $("span.tweetcount").filter(":last").text(num + $(msg).length - 1);
99 $("span.big-retweet-icon").tipsy({
102 previewMedia(source);
104 updateSentTip('No new tweets', 3000, 'failure');
106 PAUSE_TIMELINE = false;
108 error: function (msg) {
109 PAUSE_TIMELINE = false;