mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			133 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			133 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!--
 | 
						|
 | 
						|
  Copyright 2014, 2015 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 in">
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
 | 
						|
     <input type="text" id="node-input-channel" placeholder="my_channel">
 | 
						|
  </div>
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
 | 
						|
     <input type="text" id="node-input-eventname" placeholder="test_event_name">
 | 
						|
  </div>
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-appkey_sub"><i class="fa fa-lock"></i> App Key</label>
 | 
						|
     <input type="text" id="node-input-pusherappkey_sub" placeholder="key">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
    <label for="node-input-name"><i class="fa fa-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 in">
 | 
						|
    <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 in',{
 | 
						|
        category: 'social-input', // the palette category
 | 
						|
        color:"#A9D0F5",
 | 
						|
        defaults: { // defines the editable properties of the node
 | 
						|
            name: {value:""}, // along with default values.
 | 
						|
            channel: {value:"", required:true},
 | 
						|
            eventname: {value:"", required:true}
 | 
						|
        },
 | 
						|
        credentials: {
 | 
						|
            pusherappkey_sub: "text"
 | 
						|
        },
 | 
						|
        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||"pusher";
 | 
						|
        },
 | 
						|
        labelStyle: function() { // sets the class to apply to the label
 | 
						|
            return this.name?"node_label_italic":"";
 | 
						|
        }
 | 
						|
    });
 | 
						|
</script>
 | 
						|
 | 
						|
<script type="text/x-red" data-template-name="pusher out">
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
 | 
						|
     <input type="text" id="node-input-channel" placeholder="my_channel">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-eventname"><i class="fa fa-tasks"></i> Event</label>
 | 
						|
     <input type="text" id="node-input-eventname" placeholder="test_event_name">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-appid"><i class="fa fa-tag"></i> App ID</label>
 | 
						|
     <input type="text" id="node-input-pusherappid" placeholder="app_id">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-appkey"><i class="fa fa-lock"></i> App Key</label>
 | 
						|
     <input type="text" id="node-input-pusherappkey" placeholder="key">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
     <label for="node-input-topic"><i class="fa fa-asterisk"></i> App Secret</label>
 | 
						|
     <input type="password" id="node-input-pusherappsecret" placeholder="secret">
 | 
						|
  </div>
 | 
						|
 | 
						|
  <div class="form-row">
 | 
						|
    <label for="node-input-name"><i class="fa fa-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 out">
 | 
						|
    <p>Pusher output node for sending messages to a specific channel/event. You need an App key, secret and ID of a Pusher app. The node will send the payload of the incoming message.</p>
 | 
						|
</script>
 | 
						|
 | 
						|
<!-- Finally, the node type is registered along with all of its properties -->
 | 
						|
<script type="text/javascript">
 | 
						|
    RED.nodes.registerType('pusher out',{
 | 
						|
        category: 'social-output', // the palette category
 | 
						|
        color:"#A9D0F5",
 | 
						|
        defaults: { // defines the editable properties of the node
 | 
						|
            name: {value:""}, // along with default values.
 | 
						|
            channel: {value:"", required:true},
 | 
						|
            eventname: {value:"", required:true}
 | 
						|
        },
 | 
						|
        credentials: {
 | 
						|
            pusherappid: {type:"text"},
 | 
						|
            pusherappkey: {type:"text"},
 | 
						|
            pusherappsecret: {type:"password"}
 | 
						|
        },
 | 
						|
        inputs:1, // set the number of inputs - only 0 or 1
 | 
						|
        outputs:0, // set the number of outputs - 0 to n
 | 
						|
        icon: "pusher.png", // set the icon (held in public/icons)
 | 
						|
        align: "right",
 | 
						|
        label: function() { // sets the default label contents
 | 
						|
            return this.name||"pusher";
 | 
						|
        },
 | 
						|
        labelStyle: function() { // sets the class to apply to the label
 | 
						|
            return this.name?"node_label_italic":"";
 | 
						|
        }
 | 
						|
    });
 | 
						|
</script>
 |