onseText));
    }
  }

  function httpGet(parent, path){
    requests.add("GET", "/edit", { list: path }, getCb(parent, path));
  }

  httpGet(treeRoot, "/");
  return this;
}

function createEditor(element, file, lang, theme, type){
  function getLangFromFilename(filename){
    var lang = "plain";
    var ext = /(?:\.([^.]+))?$/.exec(filename)[1];
    if(typeof ext !== undefined){
      switch(ext){
        case "txt": lang = "plain"; break;
        case "hex": lang = "plain"; break;
        case "conf": l