web/wp-content/plugins/network-publisher/networkpub.js
changeset 194 32102edaa81b
parent 170 8e3a5a6fc63e
child 204 09a1c134465b
--- a/web/wp-content/plugins/network-publisher/networkpub.js	Thu Sep 16 15:45:36 2010 +0000
+++ b/web/wp-content/plugins/network-publisher/networkpub.js	Mon Nov 19 18:26:13 2012 +0100
@@ -1,13 +1,33 @@
 jQuery(document).ready(function($){
-	$(".networkpubre").bind("click", function(e) {
+	$(".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+"/network-publisher/networkpub_ajax.php", {key:key}, function(data) {
-				var dr = data.split("_");
-				$("#r_key_"+dr[1]).remove();
+			$.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;
 	});
-})
\ No newline at end of file
+	$.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
+		);
+	});
+});
\ No newline at end of file