UNPKG

node-red-contrib-require

Version:
68 lines (63 loc) 2.04 kB
<script type="text/html" data-template-name="require"> <div class="form-row"> <label for="node-input-name"> <i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span> </label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> <div class="form-row"> <label for="node-input-module"> <i class="fa fa-file"></i> <span data-i18n="require.label.module"></span> </label> <input type="text" id="node-input-module" data-i18n="[placeholder]require.label.module"> </div> <div class="form-row"> <label for="node-input-field"> <i class="fa fa-sign-out"></i> <span data-i18n="require.label.mounted"></span> </label> <input type="text" id="node-input-field" placeholder="payload" style="width:275px;"> <input type="hidden" id="node-input-fieldType"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('require', { category: 'function', color: '#1b82f1', defaults: { name: { value: "" }, module: { value: "", required: true }, field: { value: "payload", required: true }, fieldType: { value: "msg" }, }, inputs: 1, outputs: 1, icon: "file-out.svg", label: function () { return this.name || this.module || "require"; }, oneditprepare: function () { var that = this; if (!this.fieldType) { this.fieldType = 'msg'; } $("#node-input-field").typedInput({ default: 'msg', types: ['msg', 'flow', 'global'], typeField: $("#node-input-fieldType") }); }, }); </script>