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

io and analysis nodes info updates

This commit is contained in:
Dave Conway-Jones 2016-02-12 13:15:53 +00:00
parent 7610b9a975
commit b7a0ad703a
4 changed files with 31 additions and 29 deletions

View File

@ -22,10 +22,11 @@
</script> </script>
<script type="text/x-red" data-help-name="sentiment"> <script type="text/x-red" data-help-name="sentiment">
<p>Analyses the <b>msg.payload</b> and adds a <b>msg.sentiment</b> object that contains the resulting AFINN-111 sentiment score as <b>msg.sentiment.score</b>.</p> <p>Analyses the <code>msg.payload</code> and adds a <code>msg.sentiment</code> object
that contains the resulting AFINN-111 sentiment score as <code>msg.sentiment.score</code>.</p>
<p>A score greater than zero is positive and less than zero is negative.</p> <p>A score greater than zero is positive and less than zero is negative.</p>
<p>The score typically ranges from -5 to +5, but can go higher and lower.</p> <p>The score typically ranges from -5 to +5, but can go higher and lower.</p>
<p>An object of word score overrides can be supplied as <b>msg.overrides</b>.</p> <p>An object of word score overrides can be supplied as <code>msg.overrides</code>.</p>
<p>See <a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_new">the Sentiment docs here</a>.</p> <p>See <a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_new">the Sentiment docs here</a>.</p>
</script> </script>

View File

@ -28,8 +28,8 @@
<script type="text/x-red" data-help-name="mqtt in"> <script type="text/x-red" data-help-name="mqtt in">
<p>MQTT input node. Connects to a broker and subscribes to the specified topic. The topic may contain MQTT wildcards.</p> <p>MQTT input node. Connects to a broker and subscribes to the specified topic. The topic may contain MQTT wildcards.</p>
<p>Outputs an object called <b>msg</b> containing <b>msg.topic, msg.payload, msg.qos</b> and <b>msg.retain</b>.</p> <p>Outputs an object called <code>msg</code> containing <code>msg.topic</code>, <code>msg.payload</code>, <code>msg.qos</code> and <code>msg.retain</code>.</p>
<p><b>msg.payload</b> is usually a string, but can also be a binary buffer.</p> <p><code>msg.payload</code> is usually a string, but can also be a binary buffer.</p>
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
@ -84,9 +84,10 @@
</script> </script>
<script type="text/x-red" data-help-name="mqtt out"> <script type="text/x-red" data-help-name="mqtt out">
<p>Connects to a MQTT broker and publishes <b>msg.payload</b> either to the <b>msg.topic</b> or to the topic specified in the edit window. The value in the edit window has precedence.</p> <p>Connects to a MQTT broker and publishes <code>msg.payload</code> either to the <code>msg.topic</code> or to the topic specified in the edit window. The value in the edit window has precedence.</p>
<p>Likewise QoS and/or retain values in the edit panel will overwrite any <b>msg.qos</b> and <b>msg.retain</b> properties. If nothing is set they default to <i>0</i> and <i>false</i> respectively.</p> <p>Likewise QoS and/or retain values in the edit panel will overwrite any <code>msg.qos</code> and <code>msg.retain</code> properties. If nothing is set they default to <i>0</i> and <i>false</i> respectively.</p>
<p>If <b>msg.payload</b> contains an object it will be stringified before being sent.</p> <p>If <code>msg.payload</code> contains an object it will be stringified before being sent.</p>
<p><code>msg.payload</code> can be a binary Buffer.</p>
</script> </script>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -38,7 +38,7 @@
<script type="text/x-red" data-help-name="websocket in"> <script type="text/x-red" data-help-name="websocket in">
<p>WebSocket input node.</p> <p>WebSocket input node.</p>
<p>By default, the data received from the WebSocket will be in <b>msg.payload</b>. <p>By default, the data received from the WebSocket will be in <code>msg.payload</code>.
The socket can be configured to expect a properly formed JSON string, in which The socket can be configured to expect a properly formed JSON string, in which
case it will parse the JSON and send on the resulting object as the entire message.</p> case it will parse the JSON and send on the resulting object as the entire message.</p>
</script> </script>
@ -48,7 +48,7 @@
(function() { (function() {
function ws_oneditprepare() { function ws_oneditprepare() {
$("#websocket-client-row").hide(); $("#websocket-client-row").hide();
$("#node-input-mode").change(function(){ $("#node-input-mode").change(function(){
if( $("#node-input-mode").val() === 'client') { if( $("#node-input-mode").val() === 'client') {
$("#websocket-server-row").hide(); $("#websocket-server-row").hide();
@ -59,7 +59,7 @@
$("#websocket-client-row").hide(); $("#websocket-client-row").hide();
} }
}); });
if(this.client) { if(this.client) {
$("#node-input-mode").val('client').change(); $("#node-input-mode").val('client').change();
} }
@ -67,24 +67,24 @@
$("#node-input-mode").val('server').change(); $("#node-input-mode").val('server').change();
} }
} }
function ws_oneditsave() { function ws_oneditsave() {
if($("#node-input-mode").val() === 'client') { if($("#node-input-mode").val() === 'client') {
$("#node-input-server").append('<option value="">Dummy</option>'); $("#node-input-server").append('<option value="">Dummy</option>');
$("#node-input-server").val(''); $("#node-input-server").val('');
} }
else { else {
$("#node-input-client").append('<option value="">Dummy</option>'); $("#node-input-client").append('<option value="">Dummy</option>');
$("#node-input-client").val(''); $("#node-input-client").val('');
} }
} }
function ws_label() { function ws_label() {
var nodeid = (this.client)?this.client:this.server; var nodeid = (this.client)?this.client:this.server;
var wsNode = RED.nodes.node(nodeid); var wsNode = RED.nodes.node(nodeid);
return this.name||(wsNode?"[ws] "+wsNode.label():"websocket"); return this.name||(wsNode?"[ws] "+wsNode.label():"websocket");
} }
function ws_validateserver() { function ws_validateserver() {
if($("#node-input-mode").val() === 'client' || (this.client && !this.server)) { if($("#node-input-mode").val() === 'client' || (this.client && !this.server)) {
return true; return true;
@ -93,7 +93,7 @@
return RED.nodes.node(this.server) != null; return RED.nodes.node(this.server) != null;
} }
} }
function ws_validateclient() { function ws_validateclient() {
if($("#node-input-mode").val() === 'client' || (this.client && !this.server)) { if($("#node-input-mode").val() === 'client' || (this.client && !this.server)) {
return RED.nodes.node(this.client) != null; return RED.nodes.node(this.client) != null;
@ -121,7 +121,7 @@
oneditsave: ws_oneditsave, oneditsave: ws_oneditsave,
oneditprepare: ws_oneditprepare oneditprepare: ws_oneditprepare
}); });
RED.nodes.registerType('websocket out',{ RED.nodes.registerType('websocket out',{
category: 'output', category: 'output',
defaults: { defaults: {
@ -141,7 +141,7 @@
oneditsave: ws_oneditsave, oneditsave: ws_oneditsave,
oneditprepare: ws_oneditprepare oneditprepare: ws_oneditprepare
}); });
RED.nodes.registerType('websocket-listener',{ RED.nodes.registerType('websocket-listener',{
category: 'config', category: 'config',
defaults: { defaults: {
@ -152,7 +152,7 @@
outputs:0, outputs:0,
label: function() { label: function() {
var root = RED.settings.httpNodeRoot; var root = RED.settings.httpNodeRoot;
if (root.slice(-1) != "/") { if (root.slice(-1) != "/") {
root = root+"/"; root = root+"/";
} }
if (this.path.charAt(0) == "/") { if (this.path.charAt(0) == "/") {
@ -164,7 +164,7 @@
}, },
oneditprepare: function() { oneditprepare: function() {
var root = RED.settings.httpNodeRoot; var root = RED.settings.httpNodeRoot;
if (root.slice(-1) == "/") { if (root.slice(-1) == "/") {
root = root.slice(0,-1); root = root.slice(0,-1);
} }
if (root == "") { if (root == "") {
@ -188,7 +188,7 @@
return this.path; return this.path;
} }
}); });
})(); })();
</script> </script>
@ -217,15 +217,15 @@
<script type="text/x-red" data-help-name="websocket out"> <script type="text/x-red" data-help-name="websocket out">
<p>WebSocket out node.</p> <p>WebSocket out node.</p>
<p>By default, <b>msg.payload</b> will be sent over the WebSocket. The socket <p>By default, <code>msg.payload</code> will be sent over the WebSocket. The socket
can be configured to encode the entire message object as a JSON string and send that can be configured to encode the entire <code>msg</code> object as a JSON string and send that
over the WebSocket.</p> over the WebSocket.</p>
<p>If the message arriving at this node started at a WebSocket In node, the message <p>If the message arriving at this node started at a WebSocket In node, the message
will be sent back to the client that triggered the flow. Otherwise, the message will be sent back to the client that triggered the flow. Otherwise, the message
will be broadcast to all connected clients.</p> will be broadcast to all connected clients.</p>
<p>If you want to broadcast a message that started at a WebSocket In node, you <p>If you want to broadcast a message that started at a WebSocket In node, you
should delete the <b>msg._session</b> property within the flow</p>. should delete the <code>msg._session</code> property within the flow.</p>
</script> </script>
<!-- WebSocket Server configuration node --> <!-- WebSocket Server configuration node -->

View File

@ -31,11 +31,11 @@
<p>You can enter a list of comma separated directories and/or files. You will <p>You can enter a list of comma separated directories and/or files. You will
need to put quotes "..." around any that have spaces in.</p> need to put quotes "..." around any that have spaces in.</p>
<p>On Windows you must use double back-slashes \\ in any directory names.</p> <p>On Windows you must use double back-slashes \\ in any directory names.</p>
<p>The full filename of the file that actually changed is put into <b>msg.payload</b>, <p>The full filename of the file that actually changed is put into <code>msg.payload</code>,
while a stringified version of the watch list is returned in <b>msg.topic</b>.</p> while a stringified version of the watch list is returned in <code>msg.topic</code>.</p>
<p><b>msg.file</b> contains just the short filename of the file that changed. <p><code>msg.file</code> contains just the short filename of the file that changed.
<b>msg.type</b> has the type of thing changed, usually <i>file</i> or <i>directory</i>, <code>msg.type</code> has the type of thing changed, usually <i>file</i> or <i>directory</i>,
while <b>msg.size</b> holds the file size in bytes.</p> while <code>msg.size</code> holds the file size in bytes.</p>
<p>Of course in Linux, <i>everything</i> is a file and thus can be watched...</p> <p>Of course in Linux, <i>everything</i> is a file and thus can be watched...</p>
<p><b>Note: </b>The directory or file must exist in order to be watched. If the file <p><b>Note: </b>The directory or file must exist in order to be watched. If the file
or directory gets deleted it may no longer be monitored even if it gets re-created.</p> or directory gets deleted it may no longer be monitored even if it gets re-created.</p>