fix missing let. change code injection api

This commit is contained in:
Stewart Allen 2020-03-09 14:14:09 -04:00
commit b147427f07
3 changed files with 15 additions and 16 deletions

View file

@ -1,5 +1,5 @@
var exports = { var exports = {
COPYRIGHT:"Copyright (C) 2014-2019 Stewart Allen <sa@grid.space> - All Rights Reserved", COPYRIGHT:"Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE:"See the license.md file included with the source distribution", LICENSE:"See the license.md file included with the source distribution",
VERSION:"1.7.2" VERSION:"1.7.2"
}; };

View file

@ -444,7 +444,7 @@ let gs_moto_space = exports;
if (platformClick) { if (platformClick) {
let vis = platform.visible; let vis = platform.visible;
platform.visible = true; platform.visible = true;
int = intersect([platform], false); let int = intersect([platform], false);
platform.visible = vis; platform.visible = vis;
platformClickAt = int && int.length > 0 ? int[0].point : null; platformClickAt = int && int.length > 0 ? int[0].point : null;
} }

View file

@ -1007,11 +1007,12 @@ function initModule(file, dir) {
require(file)({ require(file)({
api: api, api: api,
const: { const: {
script: script,
rootdir: currentDir,
moddir: dir,
args: args, args: args,
debug: debug debug: debug,
script: script,
moddir: dir,
rootdir: currentDir,
version: ver.VERSION
}, },
pkg: { pkg: {
agent, agent,
@ -1033,14 +1034,12 @@ function initModule(file, dir) {
api: db, api: db,
level: level level: level
}, },
inject: { inject: (code, file, options) => {
kiri: (file, options) => { let opt = options || {};
let opt = options || {}; if (opt.end) {
if (opt.end) { script[code].push(dir + "/" + file);
script.kiri.push(dir + "/" + file); } else {
} else { script[code].splice(0, 0, dir + "/" + file);
script.kiri.splice(0, 0, dir + "/" + file);
}
} }
}, },
path: { path: {
@ -1237,12 +1236,12 @@ modPaths.forEach(fn => {
// add the rest of the handler chain // add the rest of the handler chain
handler.use(fullpath({ handler.use(fullpath({
"/meta/index.html" : redir("/meta/"),
"/kiri/index.html" : redir("/kiri/"), "/kiri/index.html" : redir("/kiri/"),
"/kiri" : redir("/kiri/"), "/kiri" : redir("/kiri/"),
"/kiri/" : remap("/kiri/index.html"),
"/meta/index.html" : redir("/meta/"),
"/meta" : redir("/meta/"), "/meta" : redir("/meta/"),
"/meta/" : remap("/meta/index.html"), "/meta/" : remap("/meta/index.html")
"/kiri/" : remap("/kiri/index.html")
})) }))
.use(prepath([ .use(prepath([
[ "/space", redir("/meta/")], [ "/space", redir("/meta/")],