-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser-ini.html
38 lines (37 loc) · 1.16 KB
/
parser-ini.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script type="text/x-red" data-template-name="parser-ini">
<div class="form-row">
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="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">
/* global RED:false, $:false */
RED.nodes.registerType('parser-ini', {
category: 'parser',
color: '#DEBD5C',
defaults: {
property: { value: 'payload', required: true },
name: { value: '' },
},
inputs: 1,
outputs: 1,
icon: 'file.svg',
paletteLabel: 'ini',
label: function () {
return this.name || 'ini';
},
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>