2 $(".rt_btn").click(function(e){
4 if ($("#textbox").length > 0) {
7 $("#info_head").after('<h2>What are you doing?</h2>' + formHTML);
12 $(".retw_btn").live("click", function(e){
16 $(".rt_undo").live("click", function(e){
20 $(".replie_btn").live("click", function(e){
22 var replie_id = $(this).parent().parent().find(".status_word").find(".user_name").attr("id");
23 if ($("#textbox").length > 0) {
26 $("#info_head").after('<h2>In reply to ' + replie_id + '</h2>' + formHTML);
32 $("#list_send_btn").click(function(e){
34 if ($("#textbox").length == 0) {
35 $("#info_head").after('<h2>What are you doing?</h2>' + formHTML);
40 $(".favor_btn").live("click", function(e){
45 $("#list_follow_btn").live("click", function(e){
48 var id = $("#info_name").text();
49 updateSentTip("Following list " + id + "...", 5000, "ing");
54 data: "action=create&id=" + id,
55 success: function(msg) {
56 if (msg.indexOf("success") >= 0) {
57 updateSentTip("You have followed " + id + ".", 3000, "success");
58 $this.after('<a class="info_btn_hover" id="list_block_btn" href="#">Unfollow</a>');
61 updateSentTip("Failed to follow list " + id + ".", 3000, "failure");
64 error: function(msg) {
65 updateSentTip("Failed to follow list " + id + ".", 3000, "failure");
71 $("#list_block_btn").live("click", function(e){
74 var id = $("#info_name").text();
75 updateSentTip("Unfollowing list " + id + "...", 5000, "ing");
79 data: "action=destory&id=" + id,
80 success: function(msg) {
81 if (msg.indexOf("success") >= 0) {
82 updateSentTip("You have unfollowed list " + id + ".", 3000, "success");
83 $this.after('<a class="info_btn" id="list_follow_btn" href="#">Follow</a>');
86 updateSentTip("Failed to unfollow list " + id + ".", 3000, "failure");
89 error: function(msg) {
90 updateSentTip("Failed to unfollow list " + id + ".", 3000, "failure");
96 document.onclick = function(){
97 document.title =document.title.replace(/(\([0-9]+\))/g, "");
99 var args = location.href.split("?")[1];
100 if (!args.split("&")[1] || args.split("&")[1] == "p=1") {
101 setInterval(function(){
108 var since_id = $(".timeline li:first-child").find(".status_id").text();
109 var list_id = $("#info_name").text();
111 url: "ajax/updateList.php",
114 data: "id=" + list_id + "&since_id=" + since_id,
115 success: function(msg) {
117 if ($.trim(msg).indexOf("</li>") > 0) {
118 $(".timeline").prepend(msg);
120 if (document.title.match(/\d+/) != null) {
121 num = parseInt(document.title.match(/\d+/));
123 document.title = "(" + (num+$(msg).length )+ ")" + document.title.replace(/(\([0-9]+\))/g, "");