-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
62 lines (54 loc) · 1.61 KB
/
script.js
File metadata and controls
62 lines (54 loc) · 1.61 KB
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
// Open URL
function process_function_openURL(task, value, callback = null){
// Open the URL in a new tab
window.open(value, '_blank');
// Execute Callback
if(typeof callback === "function"){
callback(task, {status: 'success'});
}
}
function process_meta_openURL(key = null){
const metadata = {
label: "Open an URL",
description: "Open an URL",
type: "none",
};
return metadata[key] ? metadata[key] : metadata;
}
// Request Confirmation from User
function process_function_requestConfirmation(task, value, callback = null){
// Create the Modal
builder.Component(
"modal",
{
icon: "question-circle",
title: builder.Locale.get("Confirm"),
body: builder.Locale.get(value),
color: 'info',
callback: {
submit: function(element,modal){
// Show the modal spinner
modal.spinner(true);
// Execute Callback
if(typeof callback === "function"){
callback(task, {status: 'success'});
}
// Close the modal
modal.hide();
},
},
},
function(modal,component){
// Show the modal
modal.show();
},
);
}
function process_meta_requestConfirmation(key = null){
const metadata = {
label: "Request Confirmation",
description: "Request Confirmation from User",
type: "none",
};
return metadata[key] ? metadata[key] : metadata;
}