2 XObject = imports.XObject.XObject;
3 XMLHttpRequest = imports.XMLHttpRequest.XMLHttpRequest;
4 Netrc = imports.Netrc.Netrc;
5 Date = imports.Date.Date;
18 // called on startup..??
19 // clear list, and call again to refresh..
21 fetch: function(callback)
23 // have we got the status in the last 15 mins..
24 // we should not need to get it again... - it's probably not changed.
26 if (this.list.length) {
31 // do the request to get the task..
32 var r = new XMLHttpRequest({
33 onreadystatechange : function() {
35 if (this.status != 4) {
40 var res = JSON.parse(this.responseText);
42 //print(JSON.stringify(res,null,4))
43 //print([ res.success , res.data.length ]);
44 if (!res.success || !res.data.length) {
45 print("NO tasks returned");
46 Projects.list = []; //res.data;
49 Projects.list = res.data;
51 //print("Current task:" + JSON.stringify(_this.curTask,null,4));
56 var netrc = Netrc.forHost('git.roojs.com');
59 "http://roojs.com/admin.php/Roo/Projects?sort=code&dir=ASC&active=1&limit=999"
60 ,true, netrc.login, netrc.password );
61 // print("Getting current task: " + "http://roojs.com/admin.php/Roo/mtrack_ticket?repo_shortname=" + repo.name);
75 //-------------- testing
79 Projects.fetch( function(list) { print(JSON.stringify(list,null,4)); } );