]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/testbubble/jot-header.tpl
some smarty templates needed updating
[friendica.git] / view / theme / testbubble / jot-header.tpl
index 7b2dca9fe9d3331f7e13c275ecd0ebe053df64c8..9c0037f7f242cc0ca1541fdca5b06257b25a10d1 100644 (file)
@@ -4,11 +4,38 @@
 
 var editor=false;
 var textlen = 0;
+var plaintext = '$editselect';
 
 function initEditor(cb) {
     if (editor==false) {
         $("#profile-jot-text-loading").show();
-               $("#jot-title-desc").show();
+ if(plaintext == 'none') {
+            $("#profile-jot-text-loading").hide();
+            $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+            $(".jothidden").show();
+            editor = true;
+            $("a#jot-perms-icon").colorbox({
+                               'inline' : true,
+                               'transition' : 'elastic'
+            });
+                                   $("#profile-jot-submit-wrapper").show();
+                                                               {{ if $newpost }}
+                                   $("#profile-upload-wrapper").show();
+                                       $("#profile-attach-wrapper").show();
+                                   $("#profile-link-wrapper").show();
+                                       $("#profile-video-wrapper").show();
+                                   $("#profile-audio-wrapper").show();
+                                       $("#profile-location-wrapper").show();
+                                   $("#profile-nolocation-wrapper").show();
+                                       $("#profile-title-wrapper").show();
+                                       $("#profile-jot-plugin-wrapper").show();
+                                       $("#jot-preview-link").show();
+                                                               {{ endif }}   
+
+
+            if (typeof cb!="undefined") cb();
+            return;
+        }
         tinyMCE.init({
                 theme : "advanced",
                 mode : "specific_textareas",
@@ -26,9 +53,9 @@ function initEditor(cb) {
                 entity_encoding : "raw",
                 add_unload_trigger : false,
                 remove_linebreaks : false,
-                force_p_newlines : false,
-                force_br_newlines : true,
-                forced_root_block : '',
+                //force_p_newlines : false,
+                //force_br_newlines : true,
+                forced_root_block : 'div',
                 convert_urls: false,
                 content_css: "$baseurl/view/custom_tinymce.css",
                 theme_advanced_path : false,
@@ -85,6 +112,7 @@ function initEditor(cb) {
                         ed.onInit.add(function(ed) {
                                 ed.pasteAsPlainText = true;
                                                                $("#profile-jot-text-loading").hide();
+                                                               $(".jothidden").show();
                                    $("#profile-jot-submit-wrapper").show();
                                                                {{ if $newpost }}
                                    $("#profile-upload-wrapper").show();
@@ -96,6 +124,7 @@ function initEditor(cb) {
                                    $("#profile-nolocation-wrapper").show();
                                        $("#profile-title-wrapper").show();
                                        $("#profile-jot-plugin-wrapper").show();
+                                       $("#jot-preview-link").show();
                                                                {{ endif }}   
                              $("#character-counter").show();
                                 if (typeof cb!="undefined") cb();
@@ -104,9 +133,9 @@ function initEditor(cb) {
         });
         editor = true;
         // setup acl popup
-        $("a#jot-perms-icon").fancybox({
-            'transitionIn' : 'none',
-            'transitionOut' : 'none'
+        $("a#jot-perms-icon").colorbox({
+                       'inline' : true,
+                       'transition' : 'elastic'
         }); 
     } else {
         if (typeof cb!="undefined") cb();
@@ -125,37 +154,13 @@ function initEditor(cb) {
                 }); 
 
 
-               $("#jot-title").mouseout(function() {
-                       $("#jot-title").hide();
-                       var ttl = $("#jot-title").val();
-                       $('#jot-title-display').html(ttl);
-                       if(ttl.length) {
-                               $("#jot-title-display").show();
-                       }
-                       else {
-                               $("#jot-title-desc").show();
-                       }
-               });
-
-               $("#jot-title-display").hover(function() {
-                       $("#jot-title-display").hide();
-                       $("#jot-title").show();
-                       $("#jot-title").focus();
-               });             
-
-               $("#jot-title-desc").click(function() {
-                       $("#jot-title-desc").hide();
-                       $("#jot-title").show();
-                       $("#jot-title").focus();
-               });             
-
                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();
                                }                                
                        }
@@ -166,7 +171,7 @@ function initEditor(cb) {
                                name: 'userfile',
                                onSubmit: function(file,ext) { $('#profile-rotator').show(); },
                                onComplete: function(file,response) {
-                                       tinyMCE.execCommand('mceInsertRawHTML',false,response);
+                                       addeditortext(response);
                                        $('#profile-rotator').hide();
                                }                                
                        }
@@ -190,21 +195,26 @@ function initEditor(cb) {
        });
 
        function deleteCheckedItems() {
-               var checkedstr = '';
-
-               $('.item-select').each( function() {
-                       if($(this).is(':checked')) {
-                               if(checkedstr.length != 0) {
-                                       checkedstr = checkedstr + ',' + $(this).val();
-                               }
-                               else {
-                                       checkedstr = $(this).val();
-                               }
-                       }       
-               });
-               $.post('item', { dropitems: checkedstr }, function(data) {
-                       window.location.reload();
-               });
+               if(confirm('$delitems')) {
+                       var checkedstr = '';
+
+                       $("#item-delete-selected").hide();
+                       $('#item-delete-selected-rotator').show();
+
+                       $('.item-select').each( function() {
+                               if($(this).is(':checked')) {
+                                       if(checkedstr.length != 0) {
+                                               checkedstr = checkedstr + ',' + $(this).val();
+                                       }
+                                       else {
+                                               checkedstr = $(this).val();
+                                       }
+                               }       
+                       });
+                       $.post('item', { dropitems: checkedstr }, function(data) {
+                               window.location.reload();
+                       });
+               }
        }
 
        function jotGetLink() {
@@ -213,7 +223,7 @@ function initEditor(cb) {
                        reply = bin2hex(reply);
                        $('#profile-rotator').show();
                        $.get('parse_url?binurl=' + reply, function(data) {
-                               tinyMCE.execCommand('mceInsertRawHTML',false,data);
+                               addeditortext(data);
                                $('#profile-rotator').hide();
                        });
                }
@@ -222,14 +232,14 @@ function initEditor(cb) {
        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]');
                }
        }
 
@@ -253,7 +263,7 @@ function initEditor(cb) {
                $.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);
                                });
@@ -276,7 +286,7 @@ function initEditor(cb) {
                        $.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();
                                });
                        });
@@ -299,12 +309,57 @@ function initEditor(cb) {
                        }
                }
        }
+       
+       function itemFiler(id) {
+               
+               var bordercolor = $("input").css("border-color");
+               
+               $.get('filer/', function(data){
+                       $.colorbox({html:data});
+                       $("#id_term").keypress(function(){
+                               $(this).css("border-color",bordercolor);
+                       })
+                       $("#select_term").change(function(){
+                               $("#id_term").css("border-color",bordercolor);
+                       })
+                       
+                       $("#filer_save").click(function(e){
+                               e.preventDefault();
+                               reply = $("#id_term").val();
+                               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;
+                                       $.colorbox.close();
+                               } else {
+                                       $("#id_term").css("border-color","#FF0000");
+                               }
+                               return false;
+                       });
+               });
+               
+       }
+
+       
 
        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>