]> git.mxchange.org Git - friendica.git/blobdiff - view/jot-header.tpl
added index to config and pconfig table
[friendica.git] / view / jot-header.tpl
index d998e977a40ab3852d60cbe26c371ea6bd3efae5..ef760abe0fb6409022354f49a3012db2e21e7def 100755 (executable)
@@ -3,14 +3,27 @@
 
 var editor=false;
 var textlen = 0;
+var plaintext = '$editselect';
 
 function initEditor(cb){
        if (editor==false){
-               $("#profile-jot-text-loading").show();  
+               $("#profile-jot-text-loading").show();
+               if(plaintext == 'none') {
+                       $("#profile-jot-text-loading").hide();
+                       $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+                       editor = true;
+                       $("a#jot-perms-icon").fancybox({
+                               'transitionIn' : 'elastic',
+                               'transitionOut' : 'elastic'
+                       });
+                       $(".jothidden").show();
+                       if (typeof cb!="undefined") cb();
+                       return;
+               }       
                tinyMCE.init({
                        theme : "advanced",
                        mode : "specific_textareas",
-                       editor_selector: /(profile-jot-text|prvmail-text)/,
+                       editor_selector: $editselect,
                        auto_focus: "profile-jot-text",
                        plugins : "bbcode,paste,autoresize",
                        theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
@@ -105,10 +118,9 @@ function enableOnUser(){
 }
 
 </script>
-<script type="text/javascript" src="js/ajaxupload.js" ></script>
+<script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script>
 <script>
        var ispublic = '$ispublic';
-       var addtitle = '$addtitle';
 
        $(document).ready(function() {
                
@@ -116,14 +128,13 @@ function enableOnUser(){
                $("#profile-jot-text").focus(enableOnUser);
                $("#profile-jot-text").click(enableOnUser);
 
-       
                var uploader = new window.AjaxUpload(
                        'wall-image-upload',
                        { action: 'wall_upload/$nickname',
                                name: 'userfile',
                                onSubmit: function(file,ext) { $('#profile-rotator').show(); },
                                onComplete: function(file,response) {
-                                       tinyMCE.execCommand('mceInsertRawHTML',false,response);
+                                       addeditortext(response);
                                        $('#profile-rotator').hide();
                                }                                
                        }
@@ -134,7 +145,7 @@ function enableOnUser(){
                                name: 'userfile',
                                onSubmit: function(file,ext) { $('#profile-rotator').show(); },
                                onComplete: function(file,response) {
-                                       tinyMCE.execCommand('mceInsertRawHTML',false,response);
+                                       addeditortext(response);
                                        $('#profile-rotator').hide();
                                }                                
                        }
@@ -167,7 +178,7 @@ function enableOnUser(){
                        reply = bin2hex(reply);
                        $('#profile-rotator').show();
                        $.get('parse_url?binurl=' + reply, function(data) {
-                               tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                               addeditortext(data);
                                $('#profile-rotator').hide();
                        });
                }
@@ -176,14 +187,14 @@ function enableOnUser(){
        function jotVideoURL() {
                reply = prompt("$vidurl");
                if(reply && reply.length) {
-                       tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]');
+                       addeditortext('[video]' + reply + '[/video]');
                }
        }
 
        function jotAudioURL() {
                reply = prompt("$audurl");
                if(reply && reply.length) {
-                       tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]');
+                       addeditortext('[audio]' + reply + '[/audio]');
                }
        }
 
@@ -196,11 +207,13 @@ function enableOnUser(){
        }
 
        function jotShare(id) {
+               if ($('#jot-popup').length != 0) $('#jot-popup').show();
+
                $('#like-rotator-' + id).show();
                $.get('share/' + id, function(data) {
                        if (!editor) $("#profile-jot-text").val("");
                        initEditor(function(){
-                               tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                               addeditortext(data);
                                $('#like-rotator-' + id).hide();
                                $(window).scrollTop(0);
                        });
@@ -224,7 +237,7 @@ function enableOnUser(){
                        $.get('parse_url?binurl=' + reply, function(data) {
                                if (!editor) $("#profile-jot-text").val("");
                                initEditor(function(){
-                                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                                       addeditortext(data);
                                        $('#profile-rotator').hide();
                                });
                        });
@@ -248,11 +261,32 @@ function enableOnUser(){
                }
        }
 
+       function itemFiler(id) {
+               reply = prompt("$fileas");
+               if(reply && reply.length) {
+                       commentBusy = true;
+                       $('body').css('cursor', 'wait');
+                       $.get('filer/' + id + '?term=' + reply);
+                       if(timer) clearTimeout(timer);
+                       timer = setTimeout(NavUpdate,3000);
+                       liking = 1;
+               }
+       }
+
        function jotClearLocation() {
                $('#jot-coord').val('');
                $('#profile-nolocation-wrapper').hide();
        }
 
+       function addeditortext(data) {
+               if(plaintext == 'none') {
+                       var currentText = $("#profile-jot-text").val();
+                       $("#profile-jot-text").val(currentText + data);
+               }
+               else
+                       tinyMCE.execCommand('mceInsertRawHTML',false,data);
+       }       
+
        $geotag
 
 </script>