-
Notifications
You must be signed in to change notification settings - Fork 2
/
rtmGetLists.js
39 lines (37 loc) · 1.06 KB
/
rtmGetLists.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
// Get the lists available in RTM.
// Note that this only returns active, non-smart, non-deleted lists
//
// Prereqs:
// None
// Results:
// Sets a local tasker variable called lists, that contains an array of list_id|list_name strings
function rtmGetLists(){
lists = getLists();
$.each(lists, function(index, list){
lists[index] = list['id'] + '|' + list['name'];
});
}
// Make sure jQuery is loaded
if( typeof jQuery == 'undefined' ){
tk.flashLong( 'Please make sure that the jQuery library is included.');
exit;
}
// Make sure rtmTasker is loaded
if( RTM_URL == 'undefined'){
tk.flashLong( 'Please make sure the rtmTakser library is included.');
exit;
}
// Make sure we have gotten our FROB
if( tk.global('RTM_FROB') == 'undefined'){
tk.flashLong( 'Please run the rtmAuth_step_1 script first.');
exit;
}
// Make sure we have gotten our TOKEN
if( tk.global('RTM_TOKEN') == 'undefined'){
tk.flashLong( 'Please run the rtmAuth_step_2 script first.');
exit;
}
// create our variable so it is passed back to tasker
var lists = [];
// run our stuff
rtmGetLists();