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

Update Twilio to fa -icons - correct minor spelling

This commit is contained in:
Dave C-J 2014-07-27 20:09:19 +01:00
parent 434d9808a9
commit cef9e093e2
4 changed files with 98 additions and 97 deletions

View File

@ -17,22 +17,22 @@
<script type="text/x-red" data-template-name="twilio out">
<div class="form-row" id="node-input-credentials-row">
<label for="node-input-creds"><i class="icon-folder-close"></i> Credentials</label>
<label for="node-input-creds"><i class="fa fa-folder-o"></i> Credentials</label>
<select id="node-input-creds">
<option value="global">Use global credentials</option>
<option value="local">Use local credentials</option>
</select>
</div>
<div class="form-row" id="node-input-twilio-row">
<label for="node-input-twilio"><i class="icon-user"></i> Twilio</label>
<label for="node-input-twilio"><i class="fa fa-user"></i> Twilio</label>
<input type="text" id="node-input-twilio">
</div>
<div class="form-row">
<label for="node-input-number"><i class="icon-envelope"></i> SMS to</label>
<label for="node-input-number"><i class="fa fa-envelope-o"></i> SMS to</label>
<input type="text" id="node-input-number" placeholder="01234 5678901">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>

View File

@ -15,36 +15,36 @@
* limitations under the License.
**/
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require('util');
var twilio = require('twilio');
module.exports = function(RED) {
"use strict";
var twilio = require('twilio');
try {
try {
var twiliokey = RED.settings.twilio || require(process.env.NODE_RED_HOME+"/../twiliokey.js");
}
catch(err) {
}
}
catch(err) {
}
var querystring = require('querystring');
var querystring = require('querystring');
RED.httpAdmin.get('/twilio-api/global',function(req,res) {
RED.httpAdmin.get('/twilio-api/global',function(req,res) {
res.send(JSON.stringify({hasToken:!(twiliokey && twiliokey.account && twiliokey.authtoken)}));
});
RED.httpAdmin.get('/twilio-api/:id',function(req,res) {
});
RED.httpAdmin.get('/twilio-api/:id',function(req,res) {
var credentials = RED.nodes.getCredentials(req.params.id);
if (credentials) {
res.send(JSON.stringify({hasToken:(credentials.token&&credentials.token!="")}));
res.send(JSON.stringify({hasToken:(credentials.token&&credentials.token!=="")}));
} else {
res.send(JSON.stringify({}));
}
});
});
RED.httpAdmin.delete('/twilio-api/:id',function(req,res) {
RED.httpAdmin.delete('/twilio-api/:id',function(req,res) {
RED.nodes.deleteCredentials(req.params.id);
res.send(200);
});
});
RED.httpAdmin.post('/twilio-api/:id',function(req,res) {
RED.httpAdmin.post('/twilio-api/:id',function(req,res) {
var body = "";
req.on('data', function(chunk) {
body+=chunk;
@ -60,9 +60,9 @@ RED.httpAdmin.post('/twilio-api/:id',function(req,res) {
RED.nodes.addCredentials(req.params.id,credentials);
res.send(200);
});
});
});
function TwilioAPINode(n) {
function TwilioAPINode(n) {
RED.nodes.createNode(this,n);
this.sid = n.sid;
this.from = n.from;
@ -71,11 +71,11 @@ function TwilioAPINode(n) {
if (credentials) {
this.token = credentials.token;
}
}
RED.nodes.registerType("twilio-api",TwilioAPINode);
}
RED.nodes.registerType("twilio-api",TwilioAPINode);
function TwilioOutNode(n) {
function TwilioOutNode(n) {
RED.nodes.createNode(this,n);
this.number = n.number;
@ -110,5 +110,6 @@ function TwilioOutNode(n) {
node.error(err);
}
});
}
RED.nodes.registerType("twilio out",TwilioOutNode);
}
RED.nodes.registerType("twilio out",TwilioOutNode);

View File

@ -1,5 +1,5 @@
node-red-node-pushbullet
========================
node-red-node-twilio
====================
A <a href="http://nodered.org" target="_new">Node-RED</a> node to send SMS messages via the <a href="http://twilio.com" target="_new">Twilio</a> service.

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-twilio",
"version" : "0.0.3",
"version" : "0.0.4",
"description" : "A Node-RED node to send SMS messages via the Twilio service.",
"dependencies" : {
"twilio" : "1.6.0"