diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm
index 0f8b309e..fb235c92 100644
--- a/wled00/data/settings_leds.htm
+++ b/wled00/data/settings_leds.htm
@@ -389,6 +389,69 @@ ${i+1}:
req.send(formData);
d.Sf.data.value = '';
return false;
+ }
+ // https://stackoverflow.com/questions/7346563/loading-local-json-file
+ function loadCfg(o) {
+ var f, fr;
+
+ if (typeof window.FileReader !== 'function') {
+ alert("The file API isn't supported on this browser yet.");
+ return;
+ }
+
+ if (!o.files) {
+ alert("This browser doesn't seem to support the `files` property of file inputs.");
+ } else if (!o.files[0]) {
+ alert("Please select a file before clicking 'Load'");
+ } else {
+ f = o.files[0];
+ fr = new FileReader();
+ fr.onload = receivedText;
+ fr.readAsText(f);
+ }
+ d.Sf.data2.value = '';
+
+ function receivedText(e) {
+ let lines = e.target.result;
+ var c = JSON.parse(lines);
+ if (c.hw) {
+ //console.log(c.hw);
+ if (c.hw.led) {
+ for (var i=0; i<10; i++) addLEDs(-1);
+ var l = c.hw.led;
+ l.ins.forEach((v,i,a)=>{
+ addLEDs(1);
+ for (var j=0; j
+
+
+
diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 718aa56e..d1affb4b 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -77,7 +77,7 @@ onclick="B()">Back // Autogenerated from wled00/data/settings_leds.htm, do not edit!! const char PAGE_settings_leds[] PROGMEM = R"=====(