X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjot-header.tpl;h=ecfed6c423b23eb179cd45a4b0cc96c529e3bc93;hb=961e34f67f477d18619d7d9a4aa8856a879b679a;hp=8e671a0b3d55aebfc9009c0e764530392fcb63c5;hpb=5c9eb197679fc66378152c891904a0766e1ae621;p=friendica.git diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 8e671a0b3d..ecfed6c423 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -11,6 +11,7 @@ function initEditor(cb){ 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 +30,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 +58,8 @@ function initEditor(cb){ $('#profile-jot-desc').html(' '); } + //Character count + if(textlen <= 140) { $('#character-counter').removeClass('red'); $('#character-counter').removeClass('orange'); @@ -70,8 +90,8 @@ 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(); @@ -79,7 +99,7 @@ function initEditor(cb){ } - +