X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fdispy%2Fjot-header.tpl;h=8dccf71ed09ed3bc11478983b70aecbc228ee86e;hb=58a9c652de09817b9c5d5132de51b8690ed32d53;hp=0093bf82a85b48bfa7323b6a5704864d47f6a09d;hpb=2f5a34ad1791f01cacb3b86c11501f0e11c67df4;p=friendica.git diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl old mode 100644 new mode 100755 index 0093bf82a8..8dccf71ed0 --- a/view/theme/dispy/jot-header.tpl +++ b/view/theme/dispy/jot-header.tpl @@ -8,6 +8,34 @@ var textlen = 0; 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").fancybox({ + 'transitionIn' : 'elastic', + 'transitionOut' : '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", @@ -100,13 +128,38 @@ function initEditor(cb) { $(this).val(""); initEditor(); }); + + $("#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(); } } @@ -117,7 +170,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(); } } @@ -163,8 +216,8 @@ function initEditor(cb) { if(reply && reply.length) { reply = bin2hex(reply); $('#profile-rotator').show(); - $.get('parse_url?url=' + reply, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); + $.get('parse_url?binurl=' + reply, function(data) { + addeditortext(data); $('#profile-rotator').hide(); }); } @@ -173,21 +226,21 @@ function initEditor(cb) { function jotGetVideo() { reply = prompt("$utubeurl"); if(reply && reply.length) { - tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]'); + addeditortext('[youtube]' + reply + '[/youtube]'); } } 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]'); } } @@ -211,7 +264,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); }); @@ -229,11 +282,12 @@ 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); + addeditortext(data); $('#profile-rotator').hide(); }); }); @@ -245,6 +299,15 @@ function initEditor(cb) { $('#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