gtkhotkey-0.2.1-patched.tgz
[gitlive] / Projects.js
index 9849ae4..35f442c 100644 (file)
@@ -18,13 +18,13 @@ Projects = {
     // 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;
@@ -43,9 +43,10 @@ Projects = {
                 //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);
@@ -55,7 +56,7 @@ Projects = {
         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();
@@ -70,19 +71,11 @@ Projects = {
 
 
 
-
  
-
-
-
-
-
-
-
 //-------------- 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