1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Tweaks to shorten Serialport html names.

and remove redundant code.
This commit is contained in:
Dave C-J 2014-05-06 11:12:42 +01:00
parent d982d02810
commit e47839b7e7

View File

@ -43,7 +43,7 @@
icon: "serial.png", icon: "serial.png",
label: function() { label: function() {
var serialNode = RED.nodes.node(this.serial); var serialNode = RED.nodes.node(this.serial);
return this.name||(serialNode?serialNode.label():"serial"); return this.name||(serialNode?serialNode.label().split(":")[0]:"serial");
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
@ -82,7 +82,7 @@
align: "right", align: "right",
label: function() { label: function() {
var serialNode = RED.nodes.node(this.serial); var serialNode = RED.nodes.node(this.serial);
return this.name||(serialNode?serialNode.label():"serial"); return this.name||(serialNode?serialNode.label().split(":")[0]:"serial");
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
@ -154,35 +154,11 @@
<div class="form-row"> <div class="form-row">
<label for="node-config-input-addchar">&nbsp;</label> <label for="node-config-input-addchar">&nbsp;</label>
<select type="text" id="node-config-input-addchar" style="width: 70%;"> <select type="text" id="node-config-input-addchar" style="width: 70%;">
<option value="false">Don't add 'New Line' to serial output</option> <option value="false">Don't add 'New Line' to any output messages</option>
<option value="true">Add 'New line' to serial output message</option> <option value="true">Add 'New line' to output messages</option>
</select> </select>
</div> </div>
<div class="form-tips">Tip: the new line character is used to split the input into separate messages. It can also be added to every message sent out to the serial port.</div> <div class="form-tips">Tip: the new line character is used to split the input into separate messages. It can also be added to every message sent out to the serial port.</div>
<script>
{
/*
$("#node-config-portlist-button").click(function() {
$.getJSON('serialports',function(data) {
var s = $("#node-config-select-serialport").empty();
$.each(data, function(i, port){
s.append($('<option>').text(port.comName).attr('value', port.comName));
});
$("#node-config-input-serialport").hide();
$("#node-config-select-serialport").show();
});
});
$("#node-config-select-serialport").click(function() {
var p = $("#node-config-select-serialport").val();
$("#node-config-input-serialport").val(p);
$("#node-config-select-serialport").hide();
$("#node-config-input-serialport").show();
});
*/
}
</script>
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
@ -210,12 +186,11 @@
$("#node-config-input-serialport").autocomplete( "destroy" ); $("#node-config-input-serialport").autocomplete( "destroy" );
} catch(err) { } catch(err) {
} }
$("#node-config-lookup-serial").click(function() { $("#node-config-lookup-serial").click(function() {
$("#node-config-lookup-serial-icon").removeClass('icon-search'); $("#node-config-lookup-serial-icon").removeClass('icon-search');
$("#node-config-lookup-serial-icon").addClass('spinner'); $("#node-config-lookup-serial-icon").addClass('spinner');
$("#node-config-lookup-serial").addClass('disabled'); $("#node-config-lookup-serial").addClass('disabled');
$.getJSON('serialports',function(data) { $.getJSON('serialports',function(data) {
$("#node-config-lookup-serial-icon").addClass('icon-search'); $("#node-config-lookup-serial-icon").addClass('icon-search');
$("#node-config-lookup-serial-icon").removeClass('spinner'); $("#node-config-lookup-serial-icon").removeClass('spinner');