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 = {
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",
VERSION:"1.7.2"
};

View file

@ -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;
}

View file

@ -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/")],