// called on startup..??
// clear list, and call again to refresh..
- fetch: function(repo)
+ fetch: function(callback)
{
// have we got the status in the last 15 mins..
// we should not need to get it again... - it's probably not changed.
if (this.list.length) {
- return this.list;
+ callback( this.list);
}
_this = this;
//print([ res.success , res.data.length ]);
if (!res.success || !res.data.length) {
print("NO tasks returned");
- callback([]);
+ Projects.list = []; //res.data;
return;
}
+ Projects.list = res.data;
//print("Current task:" + JSON.stringify(_this.curTask,null,4));
callback(res.data);
var netrc = Netrc.forHost('git.roojs.com');
r.open('GET',
- "http://roojs.com/admin.php/Roo/Projects"
+ "http://roojs.com/admin.php/Roo/Projects?sort=code&dir=ASC&active=1&limit=999"
,true, netrc.login, netrc.password );
// print("Getting current task: " + "http://roojs.com/admin.php/Roo/mtrack_ticket?repo_shortname=" + repo.name);
r.send();
-
-
-
-
-
-
-
-
//-------------- testing
/*
Gtk = imports.gi.Gtk;
Gtk.init(Seed.argv);
-Tasks.notify( { repo : imports.Scm.Repo.Repo.get('gitlive') } );
+Projects.fetch( function(list) { print(JSON.stringify(list,null,4)); } );
Gtk.main();
-*/
\ No newline at end of file
+ */
\ No newline at end of file