X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=view%2Fjot-header.tpl;h=352c48647e04a0032609239b3a36a1d1b6210261;hb=a69ecb341371cf0a1c2847ff19abd88f362021c9;hp=8e671a0b3d55aebfc9009c0e764530392fcb63c5;hpb=5c9eb197679fc66378152c891904a0766e1ae621;p=friendica.git diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 8e671a0b3d..352c48647e 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -7,10 +7,12 @@ var textlen = 0; function initEditor(cb){ if (editor==false){ $("#profile-jot-text-loading").show(); + $("#jot-title-desc").show(); tinyMCE.init({ theme : "advanced", mode : "specific_textareas", editor_selector: /(profile-jot-text|prvmail-text)/, + 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 +31,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 +59,8 @@ function initEditor(cb){ $('#profile-jot-desc').html(' '); } + //Character count + if(textlen <= 140) { $('#character-counter').removeClass('red'); $('#character-counter').removeClass('orange'); @@ -61,7 +82,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,27 +91,32 @@ 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(); +} + - +