fix codepad extension API bugs

This commit is contained in:
lxsang 2020-12-20 19:38:34 +01:00
parent 7d3ff0f206
commit 235a9334d6
6 changed files with 12 additions and 5 deletions

Binary file not shown.

View File

@ -435,7 +435,13 @@ namespace OS {
`${this.app.currdir.path}/${file}`
.asFileHandle()
.read("json")
.then((data) => resolve(data))
.then((data) => {
if(!data.root && this.app.currdir)
{
data.root = this.app.currdir.path;
}
resolve(data);
})
.catch((e) => {
return reject(
API.throwe(__("Unable to read meta-data"))

View File

@ -293,7 +293,9 @@ namespace OS {
await API.requires(path);
let v: GenericObject<any>;
if (this.app.extensions[meta.meta.name]) {
this.app.extensions[meta.meta.name].child = [];
this.app.extensions[meta.meta.name].text = meta.meta.text;
this.app.extensions[meta.meta.name].nodes = [];
this.app.extensions[meta.meta.name].ext = new App.extensions[meta.meta.name](this.app);
for (v of meta.meta.actions) {
this.app.extensions[meta.meta.name].addAction(v);
}

View File

@ -428,6 +428,7 @@ namespace OS {
stat.column + 1,
stat.line
);
if(stat.langmode)
this.langstat.text = stat.langmode.text;
this.filestat.text = stat.file
}

View File

@ -1,5 +1,4 @@
{
"root": "{1}",
"javascripts": [],
"coffees": ["{0}.coffee"],
"copies": [],

View File

@ -1,6 +1,5 @@
{
"name": "{0}",
"root": "{1}",
"css": [],
"javascripts": [],
"coffees": ["coffees/main.coffee"],