/**
 * JSON config file
 * TODO(cripplet): move to external defaults.json file
 */

var name = "Minke Zhang";
var email = "minke.zhang@gmail.com";

var username = "cripplet-db";
var password = "6f920f50f5c81308ee0" + "aad463a40ac83b4cd5b16";
var repo = "db";

var getEndpoint = function(path) {
  return "https://api.github.com/repos/" + username + "/" + repo + "/contents/" + path;
};

var getMockPath = function() {
  return (Math.random().toString(36)+'00000000000000000').slice(2, 16+2)
};

var getFile = function(path, el_status, el_data) {
  $.ajax({
    type: "GET",
    url: getEndpoint(path),
    dataType: "json",
    contentType: "application/json",
    success: function(resp) {
      el_status.text("success");
      el_data.text(JSON.stringify(resp));
    },
    error: function(req) {
      el_status.text("failure");
      el_data.text(JSON.stringify(req));
    }
  });
}

var addFile = function(path, content, el_status, el_data) {
  path = getMockPath();
  var payload = {
    "path": path,
    "message": "added " + path,
    "committer": {
      "name": name,
      "email": email
    },
    "content": btoa(content)
  }
  
  $.ajax({
    type: "PUT",  // not POST for some reason
    url: getEndpoint(path),
    dataType: "json",
    contentType: "application/json",
    xhrFields: { withCredentials: false },
    headers: { 'Authorization': "Basic " + btoa(username + ":" + password) },
    data: JSON.stringify(payload),
    success: function(resp) {
      el_status.text("success");
      el_data.text(JSON.stringify(resp));
    },
    error: function(req) {
      el_status.text("failure");
      el_data.text(JSON.stringify(req));
    }
  });
};

@@ -519,32 +519,42 @@
 path, el_status,
+ el_debug,
  el_data) %7B%0A  $.
@@ -729,35 +729,36 @@
 ss%22);%0A      el_d
-ata
+ebug
 .text(JSON.strin
@@ -762,32 +762,72 @@
 ringify(resp));%0A
+      el_data.text(atob(resp.content));%0A
     %7D,%0A    error
@@ -879,35 +879,36 @@
 re%22);%0A      el_d
-ata
+ebug
 .text(JSON.strin
@@ -978,24 +978,34 @@
 , el_status,
+ el_debug,
  el_data) %7B%0A
@@ -1564,35 +1564,36 @@
 ss%22);%0A      el_d
-ata
+ebug
 .text(JSON.strin
@@ -1678,27 +1678,28 @@
 ;%0A      el_d
-ata
+ebug
 .text(JSON.s

Update lib.js