feat(apps): minor progress

This commit is contained in:
Torkel Ödegaard
2016-01-12 10:20:04 +01:00
parent 2fe58461d5
commit ffe1407217
2 changed files with 11 additions and 6 deletions

View File

@ -26,13 +26,18 @@ type AppPlugin struct {
Enabled bool `json:"-"`
}
func (p *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error {
if err := decoder.Decode(&p); err != nil {
func (app *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error {
if err := decoder.Decode(&app); err != nil {
return err
}
p.PluginDir = pluginDir
p.initFrontendPlugin()
Apps[p.Id] = p
if app.Css != nil {
app.Css.Dark = evalRelativePluginUrlPath(app.Css.Dark, app.Id)
app.Css.Light = evalRelativePluginUrlPath(app.Css.Light, app.Id)
}
app.PluginDir = pluginDir
app.initFrontendPlugin()
Apps[app.Id] = app
return nil
}