-
Notifications
You must be signed in to change notification settings - Fork 0
/
confirm.js
49 lines (49 loc) · 890 Bytes
/
confirm.js
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
module.exports = {
name: "confirm",
ns: "dom",
title: "Confirm",
description: "Confirm whether this input is go or no go",
phrases: {
active: "Confirming yes/no"
},
ports: {
input: {
message: {
title: "Message",
type: "any",
required: true
},
"in": {
title: "Input",
type: "any",
"default": ""
}
},
output: {
yes: {
title: "Yes",
type: "any"
},
no: {
title: "No",
type: "any"
}
}
},
fn: function confirm(input, $, output, state, done, cb, on) {
var r = function() {
var r = confirm($.message);
if (r) {
output.yes = $.get('in');
} else {
output.no = $.get('in');
}
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}