mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-28 10:18:21 +01:00
fix codepad extension API bugs
This commit is contained in:
parent
7d3ff0f206
commit
235a9334d6
Binary file not shown.
@ -435,7 +435,13 @@ namespace OS {
|
|||||||
`${this.app.currdir.path}/${file}`
|
`${this.app.currdir.path}/${file}`
|
||||||
.asFileHandle()
|
.asFileHandle()
|
||||||
.read("json")
|
.read("json")
|
||||||
.then((data) => resolve(data))
|
.then((data) => {
|
||||||
|
if(!data.root && this.app.currdir)
|
||||||
|
{
|
||||||
|
data.root = this.app.currdir.path;
|
||||||
|
}
|
||||||
|
resolve(data);
|
||||||
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
return reject(
|
return reject(
|
||||||
API.throwe(__("Unable to read meta-data"))
|
API.throwe(__("Unable to read meta-data"))
|
||||||
|
@ -293,7 +293,9 @@ namespace OS {
|
|||||||
await API.requires(path);
|
await API.requires(path);
|
||||||
let v: GenericObject<any>;
|
let v: GenericObject<any>;
|
||||||
if (this.app.extensions[meta.meta.name]) {
|
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) {
|
for (v of meta.meta.actions) {
|
||||||
this.app.extensions[meta.meta.name].addAction(v);
|
this.app.extensions[meta.meta.name].addAction(v);
|
||||||
}
|
}
|
||||||
|
@ -428,6 +428,7 @@ namespace OS {
|
|||||||
stat.column + 1,
|
stat.column + 1,
|
||||||
stat.line
|
stat.line
|
||||||
);
|
);
|
||||||
|
if(stat.langmode)
|
||||||
this.langstat.text = stat.langmode.text;
|
this.langstat.text = stat.langmode.text;
|
||||||
this.filestat.text = stat.file
|
this.filestat.text = stat.file
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"root": "{1}",
|
|
||||||
"javascripts": [],
|
"javascripts": [],
|
||||||
"coffees": ["{0}.coffee"],
|
"coffees": ["{0}.coffee"],
|
||||||
"copies": [],
|
"copies": [],
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "{0}",
|
"name": "{0}",
|
||||||
"root": "{1}",
|
|
||||||
"css": [],
|
"css": [],
|
||||||
"javascripts": [],
|
"javascripts": [],
|
||||||
"coffees": ["coffees/main.coffee"],
|
"coffees": ["coffees/main.coffee"],
|
||||||
|
Loading…
Reference in New Issue
Block a user