2014-05-18 23:10:00 +02:00
|
|
|
<!--
|
2014-05-24 17:38:35 +02:00
|
|
|
|
2015-02-06 22:10:14 +01:00
|
|
|
Copyright 2014, 2015 Charalampos Doukas, @BuildingIoT
|
2014-05-18 23:10:00 +02:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
2014-05-19 11:08:15 +02:00
|
|
|
<script type="text/x-red" data-template-name="pusher in">
|
2014-05-18 23:10:00 +02:00
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
|
2014-05-24 19:29:27 +02:00
|
|
|
<input type="text" id="node-input-channel" placeholder="my_channel">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
|
2014-05-24 19:29:27 +02:00
|
|
|
<input type="text" id="node-input-eventname" placeholder="test_event_name">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-appkey_sub"><i class="fa fa-lock"></i> App Key</label>
|
2015-02-06 22:10:14 +01:00
|
|
|
<input type="text" id="node-input-pusherappkey_sub" placeholder="key">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
2014-05-18 23:10:00 +02:00
|
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
2014-05-19 11:08:15 +02:00
|
|
|
<script type="text/x-red" data-help-name="pusher in">
|
2015-04-24 22:17:02 +02:00
|
|
|
<p>Pusher input mode. Use this node to subscribe to a Pusher channel/event.</p>
|
|
|
|
<p>You need a valid Pusher App key.</p>
|
2014-05-18 23:10:00 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2014-05-19 11:08:15 +02:00
|
|
|
RED.nodes.registerType('pusher in',{
|
2015-04-24 22:17:02 +02:00
|
|
|
category: 'social-input',
|
2014-05-18 23:10:00 +02:00
|
|
|
color:"#A9D0F5",
|
2015-04-24 22:17:02 +02:00
|
|
|
defaults: {
|
|
|
|
name: {value:""},
|
2014-05-18 23:10:00 +02:00
|
|
|
channel: {value:"", required:true},
|
|
|
|
eventname: {value:"", required:true}
|
|
|
|
},
|
2015-02-06 22:10:14 +01:00
|
|
|
credentials: {
|
|
|
|
pusherappkey_sub: "text"
|
|
|
|
},
|
2015-04-24 22:17:02 +02:00
|
|
|
inputs:0,
|
|
|
|
outputs:1,
|
|
|
|
icon: "pusher.png",
|
|
|
|
label: function() {
|
2014-05-24 17:38:35 +02:00
|
|
|
return this.name||"pusher";
|
2014-05-18 23:10:00 +02:00
|
|
|
},
|
2015-04-24 22:17:02 +02:00
|
|
|
labelStyle: function() {
|
2014-05-18 23:10:00 +02:00
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2015-04-24 22:17:02 +02:00
|
|
|
|
2014-05-19 11:08:15 +02:00
|
|
|
<script type="text/x-red" data-template-name="pusher out">
|
2014-05-18 23:10:00 +02:00
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
|
2014-05-24 19:29:27 +02:00
|
|
|
<input type="text" id="node-input-channel" placeholder="my_channel">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
|
2014-05-24 19:29:27 +02:00
|
|
|
<input type="text" id="node-input-eventname" placeholder="test_event_name">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-appid"><i class="fa fa-tag"></i> App ID</label>
|
2015-02-06 22:10:14 +01:00
|
|
|
<input type="text" id="node-input-pusherappid" placeholder="app_id">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-appkey"><i class="fa fa-lock"></i> App Key</label>
|
2015-02-06 22:10:14 +01:00
|
|
|
<input type="text" id="node-input-pusherappkey" placeholder="key">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-topic"><i class="fa fa-asterisk"></i> App Secret</label>
|
2015-02-06 22:10:14 +01:00
|
|
|
<input type="password" id="node-input-pusherappsecret" placeholder="secret">
|
2014-05-18 23:10:00 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
2014-09-03 17:12:26 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
2014-05-18 23:10:00 +02:00
|
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
2015-04-24 22:17:02 +02:00
|
|
|
|
2014-05-19 11:08:15 +02:00
|
|
|
<script type="text/x-red" data-help-name="pusher out">
|
2015-04-24 22:17:02 +02:00
|
|
|
<p>Pusher output node for sending messages to a specific channel/event.</p>
|
|
|
|
<p>You need an App key, secret and ID of a Pusher app.</p>
|
|
|
|
<p>The node will send the <b>msg.payload</b> of the incoming message.</p>
|
|
|
|
<p>If you leave the eventname blank you can set it using <b>msg.topic</b>.</p>
|
2014-05-18 23:10:00 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2014-05-19 11:08:15 +02:00
|
|
|
RED.nodes.registerType('pusher out',{
|
2015-04-24 22:17:02 +02:00
|
|
|
category: 'social-output',
|
2014-05-18 23:10:00 +02:00
|
|
|
color:"#A9D0F5",
|
2015-04-24 22:17:02 +02:00
|
|
|
defaults: {
|
|
|
|
name: {value:""},
|
2014-05-18 23:10:00 +02:00
|
|
|
channel: {value:"", required:true},
|
2015-04-24 22:17:02 +02:00
|
|
|
eventname: {value:""}
|
2014-05-18 23:10:00 +02:00
|
|
|
},
|
2015-02-06 22:10:14 +01:00
|
|
|
credentials: {
|
|
|
|
pusherappid: {type:"text"},
|
|
|
|
pusherappkey: {type:"text"},
|
|
|
|
pusherappsecret: {type:"password"}
|
|
|
|
},
|
2015-04-24 22:17:02 +02:00
|
|
|
inputs:1,
|
|
|
|
outputs:0,
|
|
|
|
icon: "pusher.png",
|
2014-05-18 23:10:00 +02:00
|
|
|
align: "right",
|
2015-04-24 22:17:02 +02:00
|
|
|
label: function() {
|
2014-05-24 17:38:35 +02:00
|
|
|
return this.name||"pusher";
|
2014-05-18 23:10:00 +02:00
|
|
|
},
|
2015-04-24 22:17:02 +02:00
|
|
|
labelStyle: function() {
|
2014-05-18 23:10:00 +02:00
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|