mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
When listing icons provided by a module, if there is a png and svg with the same name, only the svg will be listed. If a node asks for a png icon which is not known, but there is a corresponding svg, that will be used instead.
38 lines
1.3 KiB
HTML
38 lines
1.3 KiB
HTML
|
|
<script type="text/x-red" data-template-name="yaml">
|
|
<div class="form-row">
|
|
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span></label>
|
|
<input type="text" id="node-input-property" style="width:70%;"/>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
|
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('yaml',{
|
|
category: 'function',
|
|
color:"#DEBD5C",
|
|
defaults: {
|
|
property: {value:"payload",required:true},
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
icon: "parser-yaml.svg",
|
|
label: function() {
|
|
return this.name||"yaml";
|
|
},
|
|
labelStyle: function() {
|
|
return this.name?"node_label_italic":"";
|
|
},
|
|
oneditprepare: function() {
|
|
if (this.property === undefined) {
|
|
$("#node-input-property").val("payload");
|
|
}
|
|
$("#node-input-property").typedInput({default:'msg',types:['msg']});
|
|
}
|
|
});
|
|
</script>
|