var objClicked = null; $j(document).ready(function(){ $j('.fs_follow_icon a').click(function(){ objClicked = this; }); }); // Send invitation to friend on 360 function send360Invite() { $j('#send_invite').attr('disabled', 'disabled'); $j(".thickbox_ajaxload_wait1").show(); var user = $j("#owner_username").val(); var pass = $j("#owner_password").val(); var url = $j("#friend_url").val(); var msg = encodeURIComponent($j("#invite_comment").val()); $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/ajaxFriendInviteSender", data: "frurl="+url+"&comment="+msg+"&usr="+user+"&pwd="+pass, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); window.alert(result); } else { $j("#send_report").show(); $j("#box_send_invite").hide(); $j(".thickbox_ajaxload_wait1").hide(); } } }); } // Follow friend on LinkHay via Suggestion function followViaSugesstion() { var friend_id = $j("#friend_id").val(); var node_id = $j("#node_id").val(); $j(".thickbox_ajaxload_wait2").show(); $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/ajaxFriendFollow", data: "to_id="+friend_id, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); window.alert(result); } else { $j("#follow_report").show(); $j("#follow_button").hide(); $j("#box_follow").hide(); $j(objClicked).hide(); $j(".thickbox_ajaxload_wait2").hide(); } } }); return false; } // Remove a node from list function hideGraphNode(t, id) { if(!confirm("Bạn chắc chắn muốn xóa người này khỏi danh sách?")){ return false; } $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/ajaxNodeUpdate", data: "nodeid=" + id + "&type=" + t, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); window.alert(result); } else { if(t == 'invite') { var item = "#invite_item"+id; } else if(t == 'suggest') { var item = "#suggest_item"+id; } $j(item).remove(); } } }); return false; } /* View followers on Follow Suggestion */ function getFollowers(id) { $j("#ajaxLoading").show(); $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/connect/ajaxFollowSuggestionGetFollowers", data: "id="+id, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); window.alert(result); } else { $j("#gs-followers-"+id).html(result); } $j("#ajaxLoading").hide(); } }); return false; } /* Follow a Follow Suggestion */ function followSuggestion(id) { $j("#ajaxLoading").show(); $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/ajaxFriendFollow", data: "to_id="+id, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); $j("#ajaxLoading").hide(); window.alert(result); } else { $j("#ajaxLoading").hide(); $j("#gs-follow-"+id).html("Đã theo đuôi"); removeFollowSuggestion(id); } } }); return false; } /* Hide and load another Follow Suggestion */ function removeFollowSuggestion(id) { $j("#ajaxLoading").show(); $j("#gs-suggestion-"+id).fadeOut(1000); $j.ajax({ type: "POST", url: my_base_url+my_pligg_base+"/connect/ajaxFollowSuggestionRemove", data: "id="+id, success: function(result) { if (/ERROR/.test(result)) { result = result.substring(7, result.length); window.alert(result); } else { if (result!="NA") { $j("#gs-suggestion-container").html(result); } else { $j("#gs_widget").hide(); } } $j("#ajaxLoading").hide(); } }); return false; }