From c230356aa39bc7b8d2969a9f97a079cf562d1e9b Mon Sep 17 00:00:00 2001 From: Christophe Avenel Date: Mon, 4 Dec 2023 14:44:48 +0100 Subject: [PATCH] Fix single replace with multiple replace --- plugins_repo/3.0/Spot_Inspector.js | 4 ++-- plugins_repo/latest/Points2Regions.js | 2 +- plugins_repo/latest/Spot_Inspector.js | 2 +- tissuumaps/static/js/utils/pluginUtils.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins_repo/3.0/Spot_Inspector.js b/plugins_repo/3.0/Spot_Inspector.js index b9f3b58a..dcd9ea96 100644 --- a/plugins_repo/3.0/Spot_Inspector.js +++ b/plugins_repo/3.0/Spot_Inspector.js @@ -564,7 +564,7 @@ Spot_Inspector.loadImages = function (pathFormat) { }, error: function (data) { interfaceUtils.alert( - data.responseText.replace("\n", "
"), + data.responseText.replace(/\n/g, "
"), "Error on the plugin's server response", ); }, @@ -781,7 +781,7 @@ Spot_Inspector.getMatrix = function (bbox, layers, markers, order) { }, error: function (data) { interfaceUtils.alert( - data.responseText.replace("\n", "
"), + data.responseText.replace(/\n/g, "
"), "Error on the plugin's server response", ); }, diff --git a/plugins_repo/latest/Points2Regions.js b/plugins_repo/latest/Points2Regions.js index 71e7d3fd..15d63f92 100644 --- a/plugins_repo/latest/Points2Regions.js +++ b/plugins_repo/latest/Points2Regions.js @@ -1097,7 +1097,7 @@ Points2Regions._api = function (endpoint, data, success, error) { ? error : function (data) { interfaceUtils.alert( - data.responseText.replace("\n", "
"), + data.responseText.replace(/\n/g, "
"), "Error on the plugin's server response:", ); }, diff --git a/plugins_repo/latest/Spot_Inspector.js b/plugins_repo/latest/Spot_Inspector.js index bb8405d3..efb100db 100644 --- a/plugins_repo/latest/Spot_Inspector.js +++ b/plugins_repo/latest/Spot_Inspector.js @@ -268,7 +268,7 @@ Spot_Inspector.loadImages = function (pathFormat) { }, error: function (data) { interfaceUtils.alert( - data.responseText.replace("\n", "
"), + data.responseText.replace(/\n/g, "
"), "Error on the plugin's server response", ); }, diff --git a/tissuumaps/static/js/utils/pluginUtils.js b/tissuumaps/static/js/utils/pluginUtils.js index d50a1a75..400adc46 100644 --- a/tissuumaps/static/js/utils/pluginUtils.js +++ b/tissuumaps/static/js/utils/pluginUtils.js @@ -80,7 +80,7 @@ pluginUtils.loadParameters = function (pluginID, pluginDiv, parameters) { // do something, not critical. }, error: (error) ? error : function (data) { - interfaceUtils.alert(data.responseText.replace("\n","
"),"Error on the plugin's server response:"); + interfaceUtils.alert(data.responseText.replace(/\n/g,"
"),"Error on the plugin's server response:"); }, }); }