mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
added pusher node
Added nodes for pushing events to Pusher service and subscribing to notifications from channels/events
This commit is contained in:
68
social/pusher/114-pusher_sub.html
Normal file
68
social/pusher/114-pusher_sub.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--
|
||||
Copyright 2014 Charalampos Doukas, @BuildingIoT
|
||||
|
||||
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.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<script type="text/x-red" data-template-name="Pusher">
|
||||
<div class="form-row">
|
||||
<label for="node-input-topic"><i class="icon-tasks"></i>App Key:</label>
|
||||
<input type="text" id="node-input-apikey" placeholder="apikey">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-topic"><i class="icon-tasks"></i>Channel:</label>
|
||||
<input type="text" id="node-input-channel" placeholder="channel">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-topic"><i class="icon-tasks"></i>Even Name:</label>
|
||||
<input type="text" id="node-input-eventname" placeholder="eventname">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Next, some simple help text is provided for the node. -->
|
||||
<script type="text/x-red" data-help-name="Pusher">
|
||||
<p>Pusher input mode. Use this node to subscribe to a Pusher channel/event. You need a valid Pusher App key.</p>
|
||||
</script>
|
||||
|
||||
<!-- Finally, the node type is registered along with all of its properties -->
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('Pusher',{
|
||||
category: 'social-output', // the palette category
|
||||
color:"#A9D0F5",
|
||||
defaults: { // defines the editable properties of the node
|
||||
name: {value:""}, // along with default values.
|
||||
apikey: {value:"", required:true},
|
||||
channel: {value:"", required:true},
|
||||
eventname: {value:"", required:true}
|
||||
},
|
||||
inputs:0, // set the number of inputs - only 0 or 1
|
||||
outputs:1, // set the number of outputs - 0 to n
|
||||
icon: "pusher.png", // set the icon (held in public/icons)
|
||||
label: function() { // sets the default label contents
|
||||
return this.name||this.topic||"Pusher";
|
||||
},
|
||||
labelStyle: function() { // sets the class to apply to the label
|
||||
return this.name?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user