-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-plugin.js
More file actions
81 lines (69 loc) · 1.61 KB
/
Copy pathtest-plugin.js
File metadata and controls
81 lines (69 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var conversation;
function unassign() {
Front.unassign(conversation);
}
function toggleArchive() {
Front.toggleArchive(conversation);
}
function toggleTrashed() {
Front.toggleTrashed(conversation);
}
function reply() {
Front.reply({
body: 'Template reply',
subject: 'Template subject',
}, false, conversation);
}
function alertDialog() {
Front.dialog('alert', {
title: 'I\'m an alert dialog',
message: 'You are now alerted',
}, function () {
console.log('Alert closed');
});
}
function confirmDialog() {
Front.dialog('confirm', {
title: 'I\'m a confirm dialog',
message: 'Do you confirm',
okTitle: 'OK Button',
cancelTitle: 'Cancel Button'
}, function (confirmed) {
if (confirmed)
console.log('User confirmed');
else
console.log('User cancelled');
});
}
function promptDialog() {
Front.dialog('prompt', {
title: 'I\'m a prompt dialog',
message: 'Please enter something'
}, function (data) {
if (data)
console.log('User input :', data);
else
console.log('User cancelled');
});
}
function fetchTeammates() {
Front.fetchAllowedTeammates(function (teammates) {
if (!teammates)
return;
console.log(teammates);
});
}
function fetchInboxes() {
Front.fetchInboxes(function (inboxes) {
if (!inboxes)
return;
console.log(inboxes);
});
}
Front.on('conversation', function (data) {
console.log('Conversation', data.conversation);
console.log('Contact', data.contact);
console.log('Message', data.message);
console.log('OtherMessages', data.otherMessages);
conversation = data.conversation;
});