X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjot-header.tpl;h=ecfed6c423b23eb179cd45a4b0cc96c529e3bc93;hb=356c05c6b3f1dbd2b74b73610655218972fd5347;hp=5eb07db44c6ee13efce041203904f613aea86193;hpb=939449602a58838f81045c9a0e9a205c8fa9e6bd;p=friendica.git diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 5eb07db44c..ecfed6c423 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -30,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); @@ -41,6 +58,8 @@ function initEditor(cb){ $('#profile-jot-desc').html(' '); } + //Character count + if(textlen <= 140) { $('#character-counter').removeClass('red'); $('#character-counter').removeClass('orange'); @@ -71,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(); @@ -149,13 +168,6 @@ function initEditor(cb){ } } - function jotGetVideo() { - reply = prompt("$utubeurl"); - if(reply && reply.length) { - tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]'); - } - } - function jotVideoURL() { reply = prompt("$vidurl"); if(reply && reply.length) { @@ -210,8 +222,9 @@ function initEditor(cb){ event.target.textContent = reply; event.preventDefault(); if(reply && reply.length) { + reply = bin2hex(reply); $('#profile-rotator').show(); - $.get('parse_url?url=' + reply, function(data) { + $.get('parse_url?binurl=' + reply, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ tinyMCE.execCommand('mceInsertRawHTML',false,data); @@ -221,6 +234,23 @@ function initEditor(cb){ } } + function itemTag(id) { + reply = prompt("$term"); + if(reply && reply.length) { + reply = reply.replace('#',''); + if(reply.length) { + + commentBusy = true; + $('body').css('cursor', 'wait'); + + $.get('tagger/' + id + '?term=' + reply); + if(timer) clearTimeout(timer); + timer = setTimeout(NavUpdate,3000); + liking = 1; + } + } + } + function jotClearLocation() { $('#jot-coord').val(''); $('#profile-nolocation-wrapper').hide();