neopixel, hide menu options when not red

This commit is contained in:
Dave Conway-Jones 2016-01-13 21:21:17 +00:00
parent 08164b5f9f
commit 3bdacd26e7
2 changed files with 23 additions and 9 deletions

View File

@ -19,14 +19,6 @@
<label for="node-input-pixels"><i class="fa fa-sun-o"></i> LEDs</label> <label for="node-input-pixels"><i class="fa fa-sun-o"></i> LEDs</label>
<input type="text" id="node-input-pixels" placeholder="number" style="width:60px;"> in the string <input type="text" id="node-input-pixels" placeholder="number" style="width:60px;"> in the string
</div> </div>
<div class="form-row">
<label for="node-input-bgnd"><i class="fa fa-picture-o"></i> Background</label>
<input type="text" id="node-input-bgnd" placeholder="HTML colour name or rrr,ggg,bbb">
</div>
<div class="form-row">
<label for="node-input-fgnd"><i class="fa fa-picture-o"></i> Foreground</label>
<input type="text" id="node-input-fgnd" placeholder="HTML colour name or rrr,ggg,bbb">
</div>
<div class="form-row"> <div class="form-row">
<label for="node-input-mode"><i class="fa fa-cogs"></i> Mode</label> <label for="node-input-mode"><i class="fa fa-cogs"></i> Mode</label>
<select id="node-input-mode" style="width:73%"> <select id="node-input-mode" style="width:73%">
@ -38,6 +30,14 @@
<option value="shiftd">Add pixel to end</option> <option value="shiftd">Add pixel to end</option>
</select> </select>
</div> </div>
<div class="form-row" id="bgcol">
<label for="node-input-bgnd"><i class="fa fa-picture-o"></i> Background</label>
<input type="text" id="node-input-bgnd" placeholder="HTML colour name or rrr,ggg,bbb">
</div>
<div class="form-row" id="fgcol">
<label for="node-input-fgnd"><i class="fa fa-picture-o"></i> Foreground</label>
<input type="text" id="node-input-fgnd" placeholder="HTML colour name or rrr,ggg,bbb">
</div>
<div class="form-row"> <div class="form-row">
<label for="node-input-wipe"><i class="fa fa-clock-o"></i> Wipe time</label> <label for="node-input-wipe"><i class="fa fa-clock-o"></i> Wipe time</label>
<input type="text" id="node-input-wipe" placeholder="number" style="width:60px;"> mS <input type="text" id="node-input-wipe" placeholder="number" style="width:60px;"> mS
@ -90,6 +90,20 @@
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
},
oneditprepare: function() {
var setstate = function () {
console.log($('#node-input-mode').val());
if ($('#node-input-mode').val().indexOf("shift") !== -1) {
$("#bgcol").hide();
$("#fgcol").hide();
} else {
$("#bgcol").show();
$("#fgcol").show();
}
};
$("#node-input-mode").change(function () { setstate(); });
setstate();
} }
}); });
</script> </script>

View File

@ -1,6 +1,6 @@
{ {
"name" : "node-red-node-pi-neopixel", "name" : "node-red-node-pi-neopixel",
"version" : "0.0.3", "version" : "0.0.5",
"description" : "A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Raspberry Pi.", "description" : "A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Raspberry Pi.",
"dependencies" : { "dependencies" : {
}, },