Allow an unsized iframe, fix a problem with /view, and minor chat fixes.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3374 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2017-01-03 23:23:50 +00:00
parent 20a81dcbd6
commit a60049b6b5
3 changed files with 10 additions and 4 deletions

View File

@ -286,8 +286,12 @@ function printStructured(container, data) {
node.setAttribute("srcdoc", data.iframe);
}
node.setAttribute("sandbox", "allow-forms allow-scripts allow-top-navigation allow-same-origin");
node.setAttribute("width", data.width || 320);
node.setAttribute("height", data.height || 240);
if (data.width !== null) {
node.setAttribute("width", data.width || 320);
}
if (data.height !== null) {
node.setAttribute("height", data.height || 240);
}
if (data.name) {
node.setAttribute("id", "iframe_" + data.name);
}

View File

@ -267,7 +267,7 @@ function handler(request, response, packageOwner, packageName, uri) {
if (!found) {
var process;
if (uri === "/view") {
var data = new TextDecode("UTF-8").decode(File.readFile("packages/" + packageOwner + "/" + packageName + "/" + packageName + ".js"));
var data = new TextDecoder("UTF-8").decode(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") {