2 $(".rt_btn").live("click", function(e){
\r
7 $(".replie_btn").live("click", function(e){
\r
11 $(".favor_btn").live("click", function(e){
\r
15 $(".unfollow_list").live("click",function(e){
\r
17 var $this = $(this);
\r
18 var id = $(this).parent().parent().find(".rank_name").text().substr(1);
\r
19 updateSentTip("Unfollowing lists...", 5000, "ing");
\r
21 url: "ajax/list.php",
\r
23 data: "action=destory&id=" + id,
\r
24 success: function(msg) {
\r
25 if (msg.indexOf("success") >= 0) {
\r
26 updateSentTip("Successfully unfollowing list" + id, 3000, "success");
\r
29 updateSentTip("Unfollow failed. Please try again.", 3000, "failure");
\r
32 error: function(msg) {
\r
33 updateSentTip("Unfollow failed. Please try again.", 3000, "failure");
\r
39 $(".delete_list").click(function(e){
\r
41 var $this = $(this);
\r
42 var list_id = $(this).parent().parent().find(".rank_name").text().substr(1);
\r
43 var confirm = window.confirm("Do you really want to delete" + list_id + "?");
\r
45 updateSentTip("deleting list" + list_id + "...", 5000, "ing");
\r
47 url: "ajax/delete.php",
\r
49 data: "list_id=" + list_id,
\r
50 success: function(msg) {
\r
51 if (msg.indexOf("success") >= 0) {
\r
52 $this.parent().parent().parent().remove();
\r
53 updateSentTip("Successfully deleting" + list_id, 3000, "success");
\r
55 updateSentTip("Delete failed. Please try again.", 3000, "failure");
\r
58 error: function(msg) {
\r
59 updateSentTip("Delete failed. Please try again.", 3000, "failure");
\r
65 $("#list_create_btn").click(function(e){
\r
67 $("#list_form").toggle("fast");
\r
68 $("#list_name").focus().val("");
\r
69 $("#list_description").val("");
\r
70 $("#list_protect").removeAttr("checked");
\r
71 $("#pre_list_name").val("");
\r
72 $("#is_edit").val(0);
\r
75 $(".edit_list").click(function(e){
\r
77 var parent = $(this).parent().parent();
\r
78 var list_name = parent.find(".rank_name").text().split("/")[1];
\r
79 var list_description = parent.find(".rank_description").text().slice(3);
\r
80 var list_protect = parent.find(".rank_count").text().indexOf("隐私群") > 0;
\r
82 $("#list_form").show("fast");
\r
83 $("#list_name").focus().val(list_name);
\r
84 $("#list_description").val(list_description);
\r
85 if (list_protect) {
\r
86 $("#list_protect").attr("checked", "checked");
\r
88 $("#list_protect").removeAttr("checked");
\r
90 $("#is_edit").val(1);
\r
91 $("#pre_list_name").val(list_name);
\r
96 $(".add_member").click(function(e){
\r
98 $("#member_form").remove();
\r
99 var position = $(this).position();
\r
100 var liPosition = $(this).parent().parent().parent().position();
\r
101 var list_name = $(this).parent().parent().find(".rank_name").text().split("/")[1];
\r
102 $('<form method="POST" action="./lists.php?t=1" id="member_form">' +
\r
103 '<span>User ID:(Saperated with comma, e.g. JLHwung,twitter)</span>' +
\r
104 '<span><textarea type="text" name="list_members" id="list_members"></textarea></span>' +
\r
105 '<input type="hidden" name="member_list_name" value="' + list_name + '" />' +
\r
106 '<span><input type="submit" class="btn" id="member_submit" value="Submit" /> <input type="button" class="btn" id="member_cancel" value="Cancel" /></span>' +
\r
107 '</form>').appendTo("#statuses").css("left", liPosition.left + position.left).css("top", liPosition.top + position.top + 30);
\r
109 $("#member_cancel").click(function(){
\r
110 $("#member_form").remove();
\r