load of tiny listing fixes, undef, unused, etc

This commit is contained in:
Dave Conway-Jones
2016-04-09 18:00:14 +01:00
parent 37ba29484a
commit 48bcd3c7df
22 changed files with 532 additions and 535 deletions

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red-node-pusher",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "A Node-RED node to send and receive messages using Pusher.com",
"dependencies" : {
"pusher": "1.0.5",

View File

@@ -39,7 +39,7 @@ module.exports = function(RED) {
//create a subscription to the channel and event defined by user
var socket = new PusherClient(''+this.appkey);
var my_channel = socket.subscribe(''+this.channel);
node.channel = socket.subscribe(''+this.channel);
socket.bind(''+this.eventname,
function(data) {
var msg = {topic:this.eventname};
@@ -60,7 +60,6 @@ module.exports = function(RED) {
RED.nodes.createNode(this,n);
var node = this;
var credentials = this.credentials;
if ((credentials) && (credentials.hasOwnProperty("pusherappid"))) { this.appid = credentials.pusherappid; }
@@ -80,25 +79,16 @@ module.exports = function(RED) {
secret: this.appsecret
});
this.on("input", function(msg) {
node.on("input", function(msg) {
pusher.trigger(this.channel, this.eventname, {
"payload": msg.payload
});
});
this.on("close", function() {
node.on("close", function() {
});
}
//debugging on the output:
var displayResult = function(result) {
node.log(result);
};
var displayError = function(err) {
node.log("Error: "+err);
};
RED.nodes.registerType("pusher in",PusherNode,{
credentials: {
pusherappkey_sub: "text"