diff --git a/usermods/EXAMPLE_v2/usermod_v2_example.h b/usermods/EXAMPLE_v2/usermod_v2_example.h
index 659d3e58be..8a44619177 100644
--- a/usermods/EXAMPLE_v2/usermod_v2_example.h
+++ b/usermods/EXAMPLE_v2/usermod_v2_example.h
@@ -35,6 +35,7 @@ class MyExampleUsermod : public Usermod {
unsigned long testULong = 42424242;
float testFloat = 42.42;
String testString = "Forty-Two";
+ String testMultilineString = "Forty...\nTwo"; // Key has > as final character, makes it multiline
// These config variables have defaults set inside readFromConfig()
int testInt;
@@ -232,6 +233,7 @@ class MyExampleUsermod : public Usermod {
top["testULong"] = testULong;
top["testFloat"] = testFloat;
top["testString"] = testString;
+ top["testMultilineString>"] = testMultilineString; // Key has > as final character, makes it multiline
JsonArray pinArray = top.createNestedArray("pin");
pinArray.add(testPins[0]);
pinArray.add(testPins[1]);
@@ -267,6 +269,17 @@ class MyExampleUsermod : public Usermod {
configComplete &= getJsonValue(top["testULong"], testULong);
configComplete &= getJsonValue(top["testFloat"], testFloat);
configComplete &= getJsonValue(top["testString"], testString);
+ configComplete &= getJsonValue(top["testMultilineString>"], testMultilineString);
+
+ // Remove any carriage returns (\r) from testMultilineString, leave only newlines (\n)
+ int i=0;
+ int lastI;
+ while(true) {
+ lastI = i;
+ i = testMultilineString.indexOf('\r',lastI);
+ if (i < 0) break;
+ testMultilineString.remove(i,1);
+ }
// A 3-argument getJsonValue() assigns the 3rd argument as a default value if the Json value is missing
configComplete &= getJsonValue(top["testInt"], testInt, 42);
diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm
index abcfef20d2..9b3c55fb4f 100644
--- a/wled00/data/settings_um.htm
+++ b/wled00/data/settings_um.htm
@@ -153,14 +153,19 @@
}
break;
default:
- t = "text"; c = `value="${o}" style="width:250px;"`;
+ if (f.substr(-1)===">") {
+ t = "textarea"; c = `style="width:300px;height:150px;"`;
+ } else {
+ t = "text"; c = `value="${o}" style="width:250px;"`;
+ }
break;
}
urows += ` ${initCap(f)} `; //only show field (key is shown in grouping)
// https://stackoverflow.com/questions/11657123/posting-both-checked-and-unchecked-checkboxes
if (t=="checkbox") urows += ``;
else if (!a) urows += ``;
- urows += `
`;
+ if (t=="textarea") urows += `
`;
+ else urows += `
`;
}
}
function pinDropdowns() {
diff --git a/wled00/data/style.css b/wled00/data/style.css
index 5daca929a4..e4517ad479 100644
--- a/wled00/data/style.css
+++ b/wled00/data/style.css
@@ -67,7 +67,7 @@ button.sml {
.warn {
color: #fa0;
}
-input {
+input, textarea {
background: #333;
color: #fff;
font-family: Verdana, sans-serif;