-
Notifications
You must be signed in to change notification settings - Fork 0
/
snooze.js
40 lines (40 loc) · 1.25 KB
/
snooze.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
TrelloPowerUp.initialize({
'card-buttons': function(t, card) {
return [
// Button with a nested popup callback
{
icon: './images/logo.png',
text: "Snooze Card",
callback: function(t, card) {
return t.popup({
title:"Choose date",
url:"./date-picker.html"
})
}
}];
},
'authorization-status': function(t) {
// return a promise that resolves to the object with
// a property 'authorized' being true/false
return new TrelloPowerUp.Promise(function(resolve) {
t.get('board', 'private', 'auth', null).then(function(auth) {
if(auth) {
resolve({ authorized: true })
} else {
resolve({ authorized: false })
}
})
})
},
'show-authorization': function(t) {
// return what to do when a user clicks the 'Authorize Account' link
// from the Power-Up gear icon which shows when 'authorization-status'
// returns { authorized: false }
// in this case we will open a popup
t.popup({
title: 'My Auth Popup',
url: 'authorize.html',
height: 140,
})
},
});