diff --git a/lib/IconTextLampPlugin/web/IconTextLampPlugin.html b/lib/IconTextLampPlugin/web/IconTextLampPlugin.html index 5004ffa0..6badf554 100644 --- a/lib/IconTextLampPlugin/web/IconTextLampPlugin.html +++ b/lib/IconTextLampPlugin/web/IconTextLampPlugin.html @@ -111,7 +111,7 @@

Text

- +
@@ -276,7 +276,7 @@

Lamp

var justTextInput = document.getElementById(justTextId); var iconFullPathInput = document.getElementById(iconFullPathId); - justTextInput.value = rsp.data.text; + justTextInput.value = rsp.data.text.replaceAll("\n", "\\n"); iconFullPathInput.value = rsp.data.iconFullPath; }).catch(function(rsp) { @@ -289,6 +289,9 @@

Lamp

function setText(pluginUid, justText, iconFullPath) { disableUI(); + justText = justText.replaceAll("\\n", "\n"); + justText = justText.replaceAll("\\r", ""); + return utils.makeRequest({ method: "POST", url: "/rest/api/v1/display/uid/" + pluginUid + "/text", diff --git a/lib/IconTextPlugin/web/IconTextPlugin.html b/lib/IconTextPlugin/web/IconTextPlugin.html index 3b42702b..c1234d5b 100644 --- a/lib/IconTextPlugin/web/IconTextPlugin.html +++ b/lib/IconTextPlugin/web/IconTextPlugin.html @@ -95,7 +95,7 @@

Text

- +
@@ -233,7 +233,7 @@

Text

var justTextInput = document.getElementById(justTextId); var iconFullPathInput = document.getElementById(iconFullPathId); - justTextInput.value = rsp.data.text; + justTextInput.value = rsp.data.text.replaceAll("\n", "\\n"); iconFullPathInput.value = rsp.data.iconFullPath; }).catch(function(rsp) { @@ -246,6 +246,9 @@

Text

function setText(pluginUid, justText, iconFullPath) { disableUI(); + justText = justText.replaceAll("\\n", "\n"); + justText = justText.replaceAll("\\r", ""); + return utils.makeRequest({ method: "POST", url: "/rest/api/v1/display/uid/" + pluginUid + "/text", diff --git a/lib/JustTextPlugin/web/JustTextPlugin.html b/lib/JustTextPlugin/web/JustTextPlugin.html index bf4b1c3e..5b8dacf8 100644 --- a/lib/JustTextPlugin/web/JustTextPlugin.html +++ b/lib/JustTextPlugin/web/JustTextPlugin.html @@ -62,7 +62,7 @@

Text

- +
@@ -156,6 +156,8 @@

Text

justTextInput.value = rsp.data.text; + justTextInput.value = rsp.data.text.replaceAll("\n", "\\n"); + }).catch(function(rsp) { alert("Internal error."); }).finally(function() { @@ -166,6 +168,9 @@

Text

function setText(pluginUid, justText) { disableUI(); + justText = justText.replaceAll("\\n", "\n"); + justText = justText.replaceAll("\\r", ""); + return utils.makeRequest({ method: "POST", url: "/rest/api/v1/display/uid/" + pluginUid + "/text",