X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjot-header.tpl;h=ef760abe0fb6409022354f49a3012db2e21e7def;hb=b23ad806ec8cedbc94d721279fd5615f79c4a4c6;hp=795267ee30d925b9e6e071b12cbd9690bae67c3d;hpb=363c4c57986706f6fadac33717759c5ab3ed0b29;p=friendica.git diff --git a/view/jot-header.tpl b/view/jot-header.tpl old mode 100644 new mode 100755 index 795267ee30..ef760abe0f --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -3,14 +3,28 @@ 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", theme_advanced_buttons2 : "", @@ -29,9 +43,26 @@ function initEditor(cb){ content_css: "$baseurl/view/custom_tinymce.css", theme_advanced_path : false, setup : function(ed) { - //Character count + cPopup = null; + ed.onKeyDown.add(function(ed,e) { + if(cPopup !== null) + cPopup.onkey(e); + }); + ed.onKeyUp.add(function(ed, e) { var txt = tinyMCE.activeEditor.getContent(); + match = txt.match(/@([^ \n]+)$/); + if(match!==null) { + if(cPopup === null) { + cPopup = new ACPopup(this,baseurl+"/acl"); + } + if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]); + if(! cPopup.ready) cPopup = null; + } + else { + if(cPopup !== null) { cPopup.close(); cPopup = null; } + } + textlen = txt.length; if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { $('#profile-jot-desc').html(ispublic); @@ -40,6 +71,8 @@ function initEditor(cb){ $('#profile-jot-desc').html(' '); } + //Character count + if(textlen <= 140) { $('#character-counter').removeClass('red'); $('#character-counter').removeClass('orange'); @@ -61,7 +94,7 @@ function initEditor(cb){ ed.onInit.add(function(ed) { ed.pasteAsPlainText = true; $("#profile-jot-text-loading").hide(); - $("#profile-jot-submit-wrapper").show(); + $(".jothidden").show(); if (typeof cb!="undefined") cb(); }); @@ -70,35 +103,38 @@ function initEditor(cb){ editor = true; // setup acl popup $("a#jot-perms-icon").fancybox({ - 'transitionIn' : 'none', - 'transitionOut' : 'none' + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic' }); } else { if (typeof cb!="undefined") cb(); } } +function enableOnUser(){ + if (editor) return; + $(this).val(""); + initEditor(); +} + - +