1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-12 03:34:12 +02:00

some cleanup

This commit is contained in:
Pomax
2017-03-26 11:41:20 -07:00
parent 6d5c31517c
commit 7a8413a697
7 changed files with 40 additions and 154 deletions

View File

@@ -21,7 +21,7 @@ Object.keys(index).forEach( section => {
let content = fs.readFileSync(handlerFile).toString();
content = content.replace("module.exports = ","return ");
content = `(function() { ${content} }())`;
let def = ` ${section}: {
let def = ` "${section}": {
handler: ${content}`;
if (content.indexOf('keyHandlingOptions') > -1) { def += `,\n withKeys: true`; }
def += `\n }`;
@@ -29,5 +29,5 @@ Object.keys(index).forEach( section => {
}
});
var masterFile = `module.exports = {\n${ handlers.join(',\n') }\n};\n`;
var masterFile = `window["Bezier Section Handlers"] = {\n${ handlers.join(',\n') }\n};\n`;
fs.writeFileSync(path.join(BASEDIR, "lib/site/handlers.js"), masterFile);