function puts(){
  console.log.apply(console, arguments);
}

function _api(method, url, params, fnOk, fnNg){
  $.post(url, {
    _method: method,
    apiParams: JSON.stringify(params)
  }, function(data){
    if(data.status !== "OK"){
      fnNg(data.data);
      return;
    }
    fnOk(data.data);
  });
}

$(function(){
  _api("get", "/api/graph", {
    dir: "TODO"
  }, function(data){
    puts("OK", data);
  }, function(data){
    puts("NG", data);
  });
});

@@ -1,16 +1,29 @@
+var Commit;%0A%0A
 function puts()%7B
@@ -67,16 +67,321 @@
 ts);%0A%7D%0A%0A
+%0ACommit = (function()%7B%0A  %0A  function Commit()%7B%7D%0A  var __ = Commit.prototype;%0A%0A  Commit.fromObject = function(o)%7B%0A    var c = new Commit();%0A    c.author = o.author;%0A    c.committer = o.committer;%0A    c.msg = o.msg;%0A    c.cid = o.cid;%0A    c.parents = o.parents;%0A    return c;%0A  %7D;%0A%0A  return Commit;%0A%7D)();%0A%0A%0A
 function

add Commit class