From b147427f0798df2dc033a57d324c68ac28f44b9f Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 9 Mar 2020 14:14:09 -0400 Subject: [PATCH] fix missing let. change code injection api --- js/license.js | 2 +- js/moto-space.js | 2 +- js/web-server.js | 29 ++++++++++++++--------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/js/license.js b/js/license.js index fe50ee56..007da23c 100644 --- a/js/license.js +++ b/js/license.js @@ -1,5 +1,5 @@ var exports = { - COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen - All Rights Reserved", + COPYRIGHT:"Copyright (C) Stewart Allen - All Rights Reserved", LICENSE:"See the license.md file included with the source distribution", VERSION:"1.7.2" }; diff --git a/js/moto-space.js b/js/moto-space.js index c9828ba5..e2bca05f 100644 --- a/js/moto-space.js +++ b/js/moto-space.js @@ -444,7 +444,7 @@ let gs_moto_space = exports; if (platformClick) { let vis = platform.visible; platform.visible = true; - int = intersect([platform], false); + let int = intersect([platform], false); platform.visible = vis; platformClickAt = int && int.length > 0 ? int[0].point : null; } diff --git a/js/web-server.js b/js/web-server.js index 54f86d33..17a56e32 100644 --- a/js/web-server.js +++ b/js/web-server.js @@ -1007,11 +1007,12 @@ function initModule(file, dir) { require(file)({ api: api, const: { - script: script, - rootdir: currentDir, - moddir: dir, args: args, - debug: debug + debug: debug, + script: script, + moddir: dir, + rootdir: currentDir, + version: ver.VERSION }, pkg: { agent, @@ -1033,14 +1034,12 @@ function initModule(file, dir) { api: db, level: level }, - inject: { - kiri: (file, options) => { - let opt = options || {}; - if (opt.end) { - script.kiri.push(dir + "/" + file); - } else { - script.kiri.splice(0, 0, dir + "/" + file); - } + inject: (code, file, options) => { + let opt = options || {}; + if (opt.end) { + script[code].push(dir + "/" + file); + } else { + script[code].splice(0, 0, dir + "/" + file); } }, path: { @@ -1237,12 +1236,12 @@ modPaths.forEach(fn => { // add the rest of the handler chain handler.use(fullpath({ - "/meta/index.html" : redir("/meta/"), "/kiri/index.html" : redir("/kiri/"), "/kiri" : redir("/kiri/"), + "/kiri/" : remap("/kiri/index.html"), + "/meta/index.html" : redir("/meta/"), "/meta" : redir("/meta/"), - "/meta/" : remap("/meta/index.html"), - "/kiri/" : remap("/kiri/index.html") + "/meta/" : remap("/meta/index.html") })) .use(prepath([ [ "/space", redir("/meta/")],