mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add link nodes
This commit is contained in:
74
nodes/core/core/60-link.html
Normal file
74
nodes/core/core/60-link.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!--
|
||||
Copyright 2016 IBM Corp.
|
||||
|
||||
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="link in">
|
||||
<div class="form-row">
|
||||
<label for="node-input-event"><i class="fa fa-rss"></i> <span data-i18n="link.label.event"></span></label>
|
||||
<input type="text" id="node-input-event" data-i18n="[placeholder]link.label.event">
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/x-red" data-help-name="link in">
|
||||
<p>Receive messages from any link nodes that send the specified event.</p>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('link in',{
|
||||
category: 'input',
|
||||
color:"#87D8CF",
|
||||
defaults: {
|
||||
event: {value:"",required: true}
|
||||
},
|
||||
inputs:0,
|
||||
outputs:1,
|
||||
icon: "link-out.png",
|
||||
label: function() {
|
||||
return this.event||this._("link.linkIn");
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.event?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="link out">
|
||||
<p>Send a message to any link input nodes listening for a given event.</p>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="link out">
|
||||
<div class="form-row">
|
||||
<label for="node-input-event"><i class="fa fa-rss"></i> <span data-i18n="link.label.event"></span></label>
|
||||
<input type="text" id="node-input-event" data-i18n="[placeholder]link.label.event">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('link out',{
|
||||
category: 'output',
|
||||
color:"#87D8CF",
|
||||
defaults: {
|
||||
event: {value:"",required: true}
|
||||
},
|
||||
align:"right",
|
||||
inputs:1,
|
||||
outputs:0,
|
||||
icon: "link-out.png",
|
||||
label: function() {
|
||||
return this.event||this._("link.linkOut");
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.event?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user