From 2b77002471fc9b2e1ad3e8dd69d373cc910e8834 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 6 Feb 2012 20:28:50 -0800 Subject: basic support for plaintext editor configuration (disable tinymce), currently only zero themes - and not all the post tools currently work (as some of them emit html). --- view/jot-header.tpl | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'view/jot-header.tpl') diff --git a/view/jot-header.tpl b/view/jot-header.tpl index d998e977a..22b434916 100755 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -3,14 +3,27 @@ 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' }); + $(".jothidden").show(); + editor = true; + $("a#jot-perms-icon").fancybox({ + 'transitionIn' : 'elastic', + 'transitionOut' : 'elastic' + }); + 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", @@ -123,7 +136,7 @@ function enableOnUser(){ name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) { - tinyMCE.execCommand('mceInsertRawHTML',false,response); + addeditortext(response); $('#profile-rotator').hide(); } } @@ -134,7 +147,7 @@ function enableOnUser(){ name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) { - tinyMCE.execCommand('mceInsertRawHTML',false,response); + addeditortext(response); $('#profile-rotator').hide(); } } @@ -167,7 +180,7 @@ function enableOnUser(){ reply = bin2hex(reply); $('#profile-rotator').show(); $.get('parse_url?binurl=' + reply, function(data) { - tinyMCE.execCommand('mceInsertRawHTML',false,data); + addeditortext(data); $('#profile-rotator').hide(); }); } @@ -176,14 +189,14 @@ function enableOnUser(){ 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]'); } } @@ -200,7 +213,7 @@ function enableOnUser(){ $.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); }); @@ -224,7 +237,7 @@ function enableOnUser(){ $.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(); }); }); @@ -253,6 +266,15 @@ function enableOnUser(){ $('#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 -- cgit v1.2.3 From ed38808aae6585bb6c31a18788f0290812bae2f8 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 10 Feb 2012 17:30:22 +0100 Subject: hidden jot in "display" to allow reshare --- view/jot-header.tpl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'view/jot-header.tpl') diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 22b434916..482fb0e0d 100755 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -215,6 +215,9 @@ function enableOnUser(){ initEditor(function(){ addeditortext(data); $('#like-rotator-' + id).hide(); + if ($('#jot-popup').length != 0){ + $('#jot-popup').show(); + } $(window).scrollTop(0); }); -- cgit v1.2.3 From 3e664dbdfe4a7b0d27a7dd317ab7e85853822275 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 13 Feb 2012 09:33:20 +0100 Subject: reshare in "display" view --- view/jot-header.tpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'view/jot-header.tpl') diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 482fb0e0d..251b9cdd0 100755 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -209,15 +209,14 @@ function enableOnUser(){ } function jotShare(id) { + if ($('#jot-popup').length != 0) $('#jot-popup').show(); + $('#like-rotator-' + id).show(); $.get('share/' + id, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ addeditortext(data); $('#like-rotator-' + id).hide(); - if ($('#jot-popup').length != 0){ - $('#jot-popup').show(); - } $(window).scrollTop(0); }); -- cgit v1.2.3 From 8369c243b321a421ea2ab92a49d8995b5724244e Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 13 Feb 2012 10:19:10 +0100 Subject: Fix 'item not found' message --- view/jot-header.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view/jot-header.tpl') diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 251b9cdd0..02662d2d4 100755 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -118,7 +118,7 @@ function enableOnUser(){ } - +