From ad127f4739b06f59cd3fe06774e0c32d2a0b1111 Mon Sep 17 00:00:00 2001 From: Raroun Date: Fri, 5 May 2023 19:30:26 +0200 Subject: [PATCH 1/3] Fixes #13082 removed $.trim because it removes \n from return value of media/photo/upload --- view/js/dropzone-factory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index 4f14551be8..e0f8e47253 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -26,10 +26,10 @@ var DzFactory = function (max_imagesize) { const targetTextarea = document.getElementById(textareaElementId); if (targetTextarea.setRangeText) { //if setRangeText function is supported by current browser - targetTextarea.setRangeText(' ' + $.trim(serverResponse) + ' '); + targetTextarea.setRangeText(' ' + serverResponse + ' '); } else { targetTextarea.focus(); - document.execCommand('insertText', false /*no UI*/, '\n' + $.trim(serverResponse) + '\n'); + document.execCommand('insertText', false /*no UI*/, '\n' + serverResponse + '\n'); } }); this.on('complete', function(file) { From 789ae23ce596a04e835788e7b11f5f1fa8d9bca6 Mon Sep 17 00:00:00 2001 From: Raroun Date: Fri, 5 May 2023 20:22:37 +0200 Subject: [PATCH 2/3] Update view/js/dropzone-factory.js Co-authored-by: Hypolite Petovan --- view/js/dropzone-factory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index e0f8e47253..160024ed0a 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -29,7 +29,7 @@ var DzFactory = function (max_imagesize) { targetTextarea.setRangeText(' ' + serverResponse + ' '); } else { targetTextarea.focus(); - document.execCommand('insertText', false /*no UI*/, '\n' + serverResponse + '\n'); + document.execCommand('insertText', false /*no UI*/, serverResponse); } }); this.on('complete', function(file) { From 3f2481f424d491a87088f0ccb3f1a9ef8266b098 Mon Sep 17 00:00:00 2001 From: Raroun Date: Fri, 5 May 2023 20:40:59 +0200 Subject: [PATCH 3/3] Update view/js/dropzone-factory.js Co-authored-by: Hypolite Petovan --- view/js/dropzone-factory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index 160024ed0a..f33ec9c6df 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -26,7 +26,7 @@ var DzFactory = function (max_imagesize) { const targetTextarea = document.getElementById(textareaElementId); if (targetTextarea.setRangeText) { //if setRangeText function is supported by current browser - targetTextarea.setRangeText(' ' + serverResponse + ' '); + targetTextarea.setRangeText(serverResponse); } else { targetTextarea.focus(); document.execCommand('insertText', false /*no UI*/, serverResponse);