From 363c4c57986706f6fadac33717759c5ab3ed0b29 Mon Sep 17 00:00:00 2001
From: Fabio Comuni <fabrix.xm@gmail.com>
Date: Mon, 25 Jul 2011 08:56:51 +0200
Subject: [PATCH] Remove "share" greyed text in jot editor when user reshare an
 item

---
 view/jot-header.tpl             |  9 ++++++---
 view/theme/dispy/jot-header.tpl | 18 +++++++++++-------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/view/jot-header.tpl b/view/jot-header.tpl
index 8e671a0b3..795267ee3 100644
--- a/view/jot-header.tpl
+++ b/view/jot-header.tpl
@@ -187,8 +187,8 @@ function initEditor(cb){
 
 	function jotShare(id) {
 		$('#like-rotator-' + id).show();
-			
 		$.get('share/' + id, function(data) {
+			if (!editor) $("#profile-jot-text").val("");
 			initEditor(function(){
 				tinyMCE.execCommand('mceInsertRawHTML',false,data);
 				$('#like-rotator-' + id).hide();
@@ -211,8 +211,11 @@ function initEditor(cb){
 		if(reply && reply.length) {
 			$('#profile-rotator').show();
 			$.get('parse_url?url=' + reply, function(data) {
-				tinyMCE.execCommand('mceInsertRawHTML',false,data);
-				$('#profile-rotator').hide();
+				if (!editor) $("#profile-jot-text").val("");
+				initEditor(function(){
+					tinyMCE.execCommand('mceInsertRawHTML',false,data);
+					$('#profile-rotator').hide();
+				});
 			});
 		}
 	}
diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl
index 5401f92dd..155595056 100644
--- a/view/theme/dispy/jot-header.tpl
+++ b/view/theme/dispy/jot-header.tpl
@@ -209,11 +209,12 @@ function initEditor(cb) {
 	function jotShare(id) {
 		$('#like-rotator-' + id).show();
 		$.get('share/' + id, function(data) {
-                    initEditor(function(){
-                        tinyMCE.execCommand('mceInsertRawHTML',false,data);
-                        $('#like-rotator-' + id).hide();
-                        $(window).scrollTop(0);
-                    })
+				if (!editor) $("#profile-jot-text").val("");
+				initEditor(function(){
+					tinyMCE.execCommand('mceInsertRawHTML',false,data);
+					$('#like-rotator-' + id).hide();
+					$(window).scrollTop(0);
+				});
 		});
 	}
 
@@ -230,8 +231,11 @@ function initEditor(cb) {
 		if(reply && reply.length) {
 			$('#profile-rotator').show();
 			$.get('parse_url?url=' + reply, function(data) {
-				tinyMCE.execCommand('mceInsertRawHTML',false,data);
-				$('#profile-rotator').hide();
+				if (!editor) $("#profile-jot-text").val("");
+				initEditor(function(){
+					tinyMCE.execCommand('mceInsertRawHTML',false,data);
+					$('#profile-rotator').hide();
+				});
 			});
 		}
 	}