forked from ungerik/go-start
/
config.go
67 lines (57 loc) · 1.5 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package media
import (
// "github.com/ungerik/go-start/debug"
"github.com/ungerik/go-start/model"
)
/*
Check out:
https://github.com/valums/file-uploader
http://deepliquid.com/content/Jcrop.html
*/
var Config = Configuration{
DummyImageColor: "#a8a8a8",
ImagesAdmin: ImagesAdminConfiguration{
ImageEditorClass: "media-image-editor",
ThumbnailSize: 150,
ThumbnailFrameClass: "thumbnail-frame",
ActionsClass: "actions",
},
ImageRefEditor: ImageRefEditorConfiguration{
Class: "media-imageref-editor",
ThumbnailSize: 50,
ThumbnailFrameClass: "thumbnail-frame",
ActionsClass: "actions",
},
}
type ImagesAdminConfiguration struct {
ImageEditorClass string
ThumbnailSize int
ThumbnailFrameClass string
ActionsClass string
ButtonClass string
}
type ImageRefEditorConfiguration struct {
Class string
ThumbnailFrameClass string
ThumbnailSize int
ActionsClass string
}
type Configuration struct {
Backend Backend
NoDynamicStyleAndScript bool
DummyImageColor string // web color
dummyImageURL string
ImagesAdmin ImagesAdminConfiguration
ImageRefEditor ImageRefEditorConfiguration
}
func (self *Configuration) Name() string {
return "media"
}
func (self *Configuration) Init() error {
c := model.NewColor(self.DummyImageColor)
self.dummyImageURL = ColoredImageDataURL(c.RGBA())
return nil
}
func (self *Configuration) Close() error {
return nil
}