-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathemberplus.html
83 lines (80 loc) · 3.45 KB
/
emberplus.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<script type="text/javascript">
RED.nodes.registerType('ember+', {
category: 'Ember Plus',
color: '#a6bbcf',
defaults: {
name: { value: "" },
server: { value: "", type: "emberplus-server" },
path: { value: "", required: false },
read: { value: true, required: false },
outputMode: { value: "value", required: true }
},
inputs: 1,
outputs: 1,
icon: "ember-plus-logo-60w.png",
label: function () {
return this.name || this.path || "ember+";
},
oneditprepare(a) {
const self = this;
try {
$('#node-input-path').autocomplete('destroy');
} catch (err) { }
$('#node-lookup-path').click(() => {
$('#node-lookup-path-icon').removeClass('fa-search');
$('#node-lookup-path-icon').addClass('spinner');
$('#node-lookup-path').addClass('disabled');
$.getJSON('emberplus/' + this.server + '/paths', data => {
$('#node-lookup-path-icon').addClass('fa-search');
$('#node-lookup-path-icon').removeClass('spinner');
$('#node-lookup-path').removeClass('disabled');
const paths = [];
$.each(data, (i, path) => {
console.log("paths: " + i + " path:" + JSON.stringify(path));
paths.push(path.id);
});
$('#node-input-path').autocomplete({
source: paths,
minLength: 0,
close(event, ui) {
$('#node-input-path').autocomplete('destroy');
}
}).autocomplete('search', '');
});
});
}
});
</script>
<script type="text/html" data-template-name="ember+">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-server"><i class="fa fa-tasks"></i> Ember+ Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-path"><i class="fa fa-random"></i> path</label>
<input type="text" id="node-input-path" style="width:60%;" placeholder="e.g. 0.1.0"/>
<a id="node-lookup-path" class="btn"><i id="node-lookup-path-icon" class="fa fa-search"></i></a>
</div>
</div>
<div class="form-row">
<label for="node-input-outputMode"><i class="icon-tag"></i> Output Mode:</label>
<select id="node-input-outputMode">
<option value=""></option>
<option value="value">Output plain value</option>
<option value="contents">Output contents object</option>
<option value="full">Output full object</option>
</select>
</div>
<div class="form-row">
<label> </label>
<input type="checkbox" id="node-input-read" style="display:inline-block; width:auto; vertical-align:top;">
<label for="node-input-read" style="width:70%;"><i class="icon-tag"></i> Read initial vale of path on deploy/restart?</label>
</div>
</script>
<script type="text/html" data-help-name="ember+">
<p>A node that sends or receives Ember+ states.</p>
</script>