diff --git a/core/terminal.js b/core/terminal.js index 9b47072c..576fd309 100644 --- a/core/terminal.js +++ b/core/terminal.js @@ -2,11 +2,9 @@ var kStaticFiles = [ {uri: '', path: 'index.html', type: 'text/html; charset=UTF-8'}, - {uri: '/edit', path: 'edit.html', type: 'text/html; charset=UTF-8'}, {uri: '/style.css', path: 'style.css', type: 'text/css; charset=UTF-8'}, {uri: '/favicon.png', path: 'favicon.png', type: 'image/png'}, {uri: '/client.js', path: 'client.js', type: 'text/javascript; charset=UTF-8'}, - {uri: '/editor.js', path: 'editor.js', type: 'text/javascript; charset=UTF-8'}, {uri: '/robots.txt', path: 'robots.txt', type: 'text/plain; charset=UTF-8'}, ]; @@ -247,13 +245,6 @@ async function handler(request, response, packageOwner, packageName, uri) { `); } data = data.replace("$(VIEW_SOURCE)", "/~" + packageOwner + "/" + packageName + "/view"); - data = data.replace("$(EDIT_SOURCE)", "/~" + packageOwner + "/" + packageName + "/edit"); - } else if (kStaticFiles[i].uri == "/edit") { - var source = new TextDecoder("UTF-8").decode(File.readFile("packages/" + packageOwner + "/" + packageName + "/" + packageName + ".js")) || ""; - source = source.replace(/([&<>"])/g, function(x, item) { - return {'&': '&', '"': '"', '<': '<', '>': '>'}[item]; - }); - data = data.replace("$(SOURCE)", source); } var raw = new TextEncoder("UTF-8").encode(data); response.writeHead(200, {"Content-Type": kStaticFiles[i].type, "Content-Length": raw.length}); @@ -266,7 +257,7 @@ async function handler(request, response, packageOwner, packageName, uri) { if (!found) { var process; if (uri === "/view") { - var data = new TextDecoder("UTF-8").decode(File.readFile("packages/" + packageOwner + "/" + packageName + "/" + packageName + ".js")); + var data = File.readFile("packages/" + packageOwner + "/" + packageName + "/" + packageName + ".js"); response.writeHead(200, {"Content-Type": "text/javascript; charset=utf-8", "Content-Length": data.length}); response.end(data); } else if (uri == "/save") {