UNPKG

cloud-red

Version:

Harnessing Serverless for your cloud integration needs

50 lines (47 loc) 2.05 kB
<script type="text/x-red" data-template-name="xml"> <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> <hr align="middle"/> <div class="form-row"> <label style="width:100%; border-bottom: 1px solid #eee;"><span data-i18n="xml.label.x2o"></span></label> </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="_"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('xml',{ category: 'function', color:"#DEBD5C", defaults: { name: {value:""}, property: {value:"payload",required:true}, attr: {value:""}, chr: {value:""} }, inputs:1, outputs:1, icon: "parser-xml.png", label: function() { return this.name||"xml"; }, 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>