web/wp-content/plugins/network-publisher/networkpub.js
author Anthony Ly <anthonyly.com@gmail.com>
Mon, 19 Nov 2012 18:26:13 +0100
changeset 194 32102edaa81b
parent 170 8e3a5a6fc63e
child 204 09a1c134465b
permissions -rw-r--r--
MAJ wordpress et ajout de plugin

jQuery(document).ready(function($){
	$(".networkpublisherremove").bind("click", function(e) {
		$("#networkpub_remove").html('<div class="updated fade" style="padding:5px;text-align:center">'+$("#networkpub_text_removing").val()+'.</div>')
		var key = $(this).attr("id");
		$(this).parent().parent().css('opacity','.30');
		if(key) {
			var blog_url = $("#networkpub_plugin_url").val();
			$.post(blog_url+"networkpub_ajax.php", {action:"networkpub_remove", networkpub_key:key}, function(data) {
				if(data != key) {
					$("#networkpub_remove").html('<div class="updated fade" style="padding:5px;text-align:center">'+$("#networkpub_text_an_error_occured").val()+': <a href="http://www.linksalpha.com/publisher/pubs">'+$("#networkpub_text_linksalpha_publisher").val()+'</a></div>');
				} else {
					var dr = data.split("_");
					$("#r_key_"+dr[1]).remove();
					$("#networkpub_remove").html('<div class="updated fade" style="padding:5px;text-align:center">'+$("#networkpub_text_publication_has_been_removed").val()+'</div>')
				}
		    });
		} 
		return false;
	});
	$.receiveMessage(
		function(e){
			$("#networkpub_postbox").height(e.data.split("=")[1]+'px');
		},
		'http://www.linksalpha.com'
	);
	$("#site_links").live("change", function(event) {
		$.postMessage(
			$(this).val(),
			'http://www.linksalpha.com/post',
			parent
		);
	});
});