2014-04-29 18:01:30 +02:00
|
|
|
|
2020-01-15 03:40:48 +01:00
|
|
|
<script type="text/html" data-template-name="xml">
|
2018-01-16 22:43:37 +01:00
|
|
|
<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>
|
2014-04-29 18:01:30 +02:00
|
|
|
<div class="form-row">
|
2015-05-10 22:47:22 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
2016-06-27 00:48:59 +02:00
|
|
|
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
2014-04-29 18:01:30 +02:00
|
|
|
</div>
|
2017-05-23 10:35:37 +02:00
|
|
|
<hr align="middle"/>
|
|
|
|
<div class="form-row">
|
2019-05-23 17:39:56 +02:00
|
|
|
<label style="width:100%;"><span data-i18n="xml.label.x2o"></span></label>
|
2017-05-23 15:18:09 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-row" style="padding-left: 20px;">
|
|
|
|
<label style="width:250px;" for="node-input-attr" data-i18n="xml.label.represent"></label> <input type="text" id="node-input-attr" style="text-align:center; width:40px" placeholder="$">
|
|
|
|
</div>
|
|
|
|
<div class="form-row" style="padding-left: 20px;">
|
|
|
|
<label style="width:250px;" for="node-input-chr" data-i18n="xml.label.prefix"></label> <input type="text" id="node-input-chr" style="text-align:center; width:40px" placeholder="_">
|
2014-12-15 18:05:18 +01:00
|
|
|
</div>
|
2014-04-29 18:01:30 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('xml',{
|
2019-06-19 15:31:03 +02:00
|
|
|
category: 'parser',
|
2014-04-29 18:01:30 +02:00
|
|
|
color:"#DEBD5C",
|
|
|
|
defaults: {
|
2015-02-10 17:55:50 +01:00
|
|
|
name: {value:""},
|
2018-01-16 22:43:37 +01:00
|
|
|
property: {value:"payload",required:true},
|
2015-09-26 14:46:35 +02:00
|
|
|
attr: {value:""},
|
|
|
|
chr: {value:""}
|
2014-04-29 18:01:30 +02:00
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:1,
|
2019-06-21 13:36:20 +02:00
|
|
|
icon: "parser-xml.svg",
|
2014-04-29 18:01:30 +02:00
|
|
|
label: function() {
|
|
|
|
return this.name||"xml";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
2018-01-16 22:43:37 +01:00
|
|
|
},
|
|
|
|
oneditprepare: function() {
|
|
|
|
if (this.property === undefined) {
|
|
|
|
$("#node-input-property").val("payload");
|
|
|
|
}
|
|
|
|
$("#node-input-property").typedInput({default:'msg',types:['msg']});
|
2014-04-29 18:01:30 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|