From 6c672d2575764b48c8570e8d10d3434abec1ab5e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 10 Aug 2016 19:38:20 -0700 Subject: initialise jot editor if it is used as a file drop target and isn't yet opened. --- view/tpl/jot-header.tpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 9de049b58..fc87c14d7 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -503,6 +503,7 @@ function enableOnUser(){ // cancel event and hover styling DragDropUploadFileHover(e); + if (!editor) $("#profile-jot-text").val(""); // fetch FileList object @@ -527,7 +528,11 @@ function enableOnUser(){ xhr.addEventListener('load', function (e) { //console.log('xhr upload complete', e); window.fileUploadsCompleted = window.fileUploadsCompleted + 1; - addeditortext(xhr.responseText); + + initEditor(function() { + addeditortext(xhr.responseText); + }); + $('#jot-media').val($('#jot-media').val() + xhr.responseText); // When all the uploads have completed, refresh the page if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) { -- cgit v1.2.3 From 2e7f4c1870dcd8ce05329b80d97be1269ff2a1a7 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 14 Aug 2016 06:41:12 -0400 Subject: Added a disable comments setting to the "Additional features" settings with a corresponding post editor toggle button --- view/tpl/jot-header.tpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index fc87c14d7..32d5cae03 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -371,6 +371,19 @@ function enableOnUser(){ } } + function toggleNoComment() { + if($('#jot-nocomment').val() > 0) { + $('#jot-nocomment').val(0); + $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments'); + $('#profile-nocomment-wrapper').attr('title', 'Comments enabled'); + } + else { + $('#jot-nocomment').val(1); + $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o'); + $('#profile-nocomment-wrapper').attr('title', 'Comments disabled'); + } + } + function jotReact(id,icon) { if(id && icon) { $.get('{{$baseurl}}/react?f=&postid=' + id + '&emoji=' + icon); -- cgit v1.2.3 From cb9ac6dd3435a429a58250d326ff76ca5f97398a Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 14 Aug 2016 06:46:48 -0400 Subject: Replace hardcoded button title in javascript to translatable text --- view/tpl/jot-header.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 32d5cae03..3d38df0f0 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -375,12 +375,12 @@ function enableOnUser(){ if($('#jot-nocomment').val() > 0) { $('#jot-nocomment').val(0); $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments'); - $('#profile-nocomment-wrapper').attr('title', 'Comments enabled'); + $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled}}'); } else { $('#jot-nocomment').val(1); $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o'); - $('#profile-nocomment-wrapper').attr('title', 'Comments disabled'); + $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled}}'); } } -- cgit v1.2.3 From 7fc254a81c5648653a03a7a631195d7c5212dcba Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 15 Aug 2016 17:18:42 -0700 Subject: Use double quotes for strings passed via templates to javascript. Some translated strings have unescaped single quotes. --- view/tpl/jot-header.tpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 3d38df0f0..c63aa053e 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -411,7 +411,7 @@ function enableOnUser(){ $.post("embedphotos/album", {name: album}, function(data) { if (data['status']) { - $('#embedPhotoModalLabel').html('{{$modalchooseimages}}'); + $('#embedPhotoModalLabel').html("{{$modalchooseimages}}"); $('#embedPhotoModalBodyAlbumDialog').html('\