From 20807ab8b4e0d1180b7fe74624a58b80b6cfc52a Mon Sep 17 00:00:00 2001
From: Friendika <info@friendika.com>
Date: Thu, 19 May 2011 20:11:09 -0700
Subject: [PATCH] dispy jot-header.tpl missing some code updates

---
 view/jot-header.tpl             |  3 ++-
 view/theme/dispy/jot-header.tpl | 18 +++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/view/jot-header.tpl b/view/jot-header.tpl
index 0fcd1e42fe..25f2736c7f 100644
--- a/view/jot-header.tpl
+++ b/view/jot-header.tpl
@@ -30,13 +30,14 @@ tinyMCE.init({
 	     //Character count
 		ed.onKeyUp.add(function(ed, e) {
 			var txt = tinyMCE.activeEditor.getContent();
-			textlen = txt.length;
+			var textlen = txt.length;
 			if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
 				$('#profile-jot-desc').html(ispublic);
 			}
 			else {
 				$('#profile-jot-desc').html('&nbsp;');
 			}	 
+
 			if(textlen <= 140) {
 				$('#character-counter').removeClass('red');
 				$('#character-counter').removeClass('orange');
diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl
index 40584878ae..00a4371c47 100644
--- a/view/theme/dispy/jot-header.tpl
+++ b/view/theme/dispy/jot-header.tpl
@@ -31,23 +31,30 @@ tinyMCE.init({
 	     //Character count
 		ed.onKeyUp.add(function(ed, e) {
 			var txt = tinyMCE.activeEditor.getContent();
-			var text = txt.length;
-			if(txt.length <= 140) {
+			var textlen = txt.length;
+			if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
+				$('#profile-jot-desc').html(ispublic);
+			}
+			else {
+				$('#profile-jot-desc').html('&nbsp;');
+			}
+
+			if(textlen <= 140) {
 				$('#character-counter').removeClass('red');
 				$('#character-counter').removeClass('orange');
 				$('#character-counter').addClass('grey');
 			}
-			if((txt.length > 140) && (txt .length <= 420)) {
+			if((textlen > 140) && (textlen <= 420)) {
 				$('#character-counter').removeClass('grey');
 				$('#character-counter').removeClass('red');
 				$('#character-counter').addClass('orange');
 			}
-			if(txt.length > 420) {
+			if(textlen > 420) {
 				$('#character-counter').removeClass('grey');
 				$('#character-counter').removeClass('orange');
 				$('#character-counter').addClass('red');
 			}
-			$('#character-counter').text(text);
+			$('#character-counter').text(textlen);
     	});
 
 		ed.onInit.add(function(ed) {
@@ -60,6 +67,7 @@ tinyMCE.init({
 </script>
 <script type="text/javascript" src="include/ajaxupload.js" ></script>
 <script>
+    var ispublic = '$ispublic';
 	$(document).ready(function() {
 		var uploader = new window.AjaxUpload(
 			'wall-image-upload',
-- 
2.39.5