]> git.mxchange.org Git - friendica.git/blobdiff - view/jot-header.tpl
doc updates - connecting to services
[friendica.git] / view / jot-header.tpl
index eebaf803ac91a4cf021c4c9c87cfa57a158ebeb6..eae6cb0f44f56f4cc3fd8c123b3e3c43553a28ec 100644 (file)
@@ -3,6 +3,7 @@
 <script language="javascript" type="text/javascript">
 
 var editor;
+var textlen = 0;
 
 tinyMCE.init({
        theme : "advanced",
@@ -29,23 +30,29 @@ tinyMCE.init({
             //Character count
                ed.onKeyUp.add(function(ed, e) {
                        var txt = tinyMCE.activeEditor.getContent();
-                       var text = txt.length;
-                       if(txt.length <= 140) {
+                       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) {
@@ -58,6 +65,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',
@@ -74,11 +82,13 @@ tinyMCE.init({
                        var selstr;
                        $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
                                selstr = $(this).text();
-                               $('#profile-jot-perms img').attr('src', 'images/lock_icon.gif');
+                               $('#jot-perms-icon').removeClass('unlock').addClass('lock');
+                               $('#jot-public').attr('checked', false);
                                $('.profile-jot-net input').attr('disabled', 'disabled');
                        });
                        if(selstr == null) { 
-                               $('#profile-jot-perms img').attr('src', 'images/unlock_icon.gif');
+                               $('#jot-perms-icon').removeClass('lock').addClass('unlock');
+                               $('#jot-public').attr('checked', 'checked');
                                $('.profile-jot-net input').attr('disabled', false);
                        }
 
@@ -89,6 +99,7 @@ tinyMCE.init({
        function jotGetLink() {
                reply = prompt("$linkurl");
                if(reply && reply.length) {
+                       reply = bin2hex(reply);
                        $('#profile-rotator').show();
                        $.get('parse_url?url=' + reply, function(data) {
                                tinyMCE.execCommand('mceInsertRawHTML',false,data);