From e8b9bab468ef4735ad767ffdb8695aad8c25990d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 18 Jan 2017 02:02:00 +0000 Subject: [PATCH] Removed some remnants of the old editor. Fixed an encoding bug. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3381 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/terminal.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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") {