mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Update node-red-nodes - clean up lint issues (mainly unused funcs and vars)
This commit is contained in:
@@ -138,7 +138,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
getName(this.credentials.deviceid);
|
||||
}
|
||||
catch(err) {
|
||||
@@ -164,8 +164,8 @@
|
||||
function updateDeviceList() {
|
||||
if(!ddConfig.val()) {
|
||||
ddDevice.children().remove();
|
||||
ddDevice.append('<option value="">All</option>')
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
||||
ddDevice.append('<option value="">All</option>');
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||
var currentDevice;
|
||||
if(node.credentials) {
|
||||
currentDevice = node.credentials.deviceid;
|
||||
@@ -176,15 +176,15 @@
|
||||
}
|
||||
}
|
||||
else {
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||
if(config && config.credentials && config.credentials.apikey) {
|
||||
url += '?apikey='+config.credentials.apikey;
|
||||
}
|
||||
$.getJSON(url, function(data) {
|
||||
ddDevice.children().remove();
|
||||
ddDevice.append('<option value="">All</option>')
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
||||
ddDevice.append('<option value="">All</option>');
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||
var currentDevice, addCurrent = true;
|
||||
if(node.credentials) {
|
||||
currentDevice = node.credentials.deviceid;
|
||||
@@ -203,7 +203,7 @@
|
||||
}
|
||||
ddDevice.val(currentDevice);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="pushbullet in">
|
||||
<script type="text/x-red" data-help-name="pushbullet in">
|
||||
<p>Receives Pushbullets from all devices. Messages contain the following data:</p>
|
||||
<p><code>msg.pushtype</code>: type of message</p>
|
||||
<p><code>msg.topic</code>: topic information from the push</p>
|
||||
@@ -326,7 +326,7 @@
|
||||
var node = this, ddConfig = $('#node-input-config'), ddDevice = $('#node-input-filters');
|
||||
|
||||
function updateDeviceList() {
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||
if(config && config.credentials && config.credentials.apikey) {
|
||||
url += '?apikey='+config.credentials.apikey;
|
||||
@@ -343,7 +343,7 @@
|
||||
for(var i=0; i<data.length; i++) {
|
||||
var dev = data[i];
|
||||
ddDevice.append('<option value="'+dev.iden+'">'+dev.nickname+' ('+dev.kind+')</option>');
|
||||
|
||||
|
||||
idx = addDevices.indexOf(dev.iden);
|
||||
if (idx > -1) {
|
||||
addDevices.splice(idx, 1);
|
||||
@@ -354,7 +354,7 @@
|
||||
ddDevice.append('<option value="'+addDevices[j]+'">'+addDevices[j]+'</option>');
|
||||
}
|
||||
ddDevice.val(currentDevices);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ddConfig.change(function() {
|
||||
|
@@ -153,8 +153,8 @@
|
||||
$("#node-input-credentials-row").hide();
|
||||
}
|
||||
|
||||
if (this.twilioType == null) {
|
||||
if (this.url == "") {
|
||||
if (this.twilioType === null) {
|
||||
if (this.url === "") {
|
||||
this.twilioType = "call";
|
||||
} else {
|
||||
this.twilioType = "sms";
|
||||
|
@@ -18,9 +18,6 @@ module.exports = function(RED) {
|
||||
"use strict";
|
||||
var XMPP = require('simple-xmpp');
|
||||
|
||||
try { var xmppkey = RED.settings.xmpp || require(process.env.NODE_RED_HOME+"/../xmppkeys.js"); }
|
||||
catch(err) { }
|
||||
|
||||
function XMPPServerNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.server = n.server;
|
||||
@@ -73,7 +70,7 @@ function XmppInNode(n) {
|
||||
});
|
||||
|
||||
xmpp.on('groupchat', function(conference, from, message, stamp) {
|
||||
var msg = { topic:from, payload:message, room:conference };
|
||||
var msg = { topic:from, payload:message, room:conference, ts:stamp };
|
||||
if (from != node.nick) { node.send([msg,null]); }
|
||||
});
|
||||
|
||||
@@ -93,7 +90,7 @@ function XmppInNode(n) {
|
||||
console.error("error",err);
|
||||
});
|
||||
|
||||
xmpp.on('close', function(err) {
|
||||
xmpp.on('close', function() {
|
||||
node.log('connection closed');
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
@@ -157,7 +154,7 @@ function XmppOutNode(n) {
|
||||
console.error("error",err);
|
||||
});
|
||||
|
||||
xmpp.on('close', function(err) {
|
||||
xmpp.on('close', function() {
|
||||
node.log('connection closed');
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-xmpp",
|
||||
"version" : "0.0.4",
|
||||
"version" : "0.0.5",
|
||||
"description" : "A Node-RED node to talk to an XMPP server",
|
||||
"dependencies" : {
|
||||
"simple-xmpp" : "0.1.92"
|
||||
|
Reference in New Issue
Block a user