diff --git a/base/cli/qrcode.go b/base/cli/qrcode.go index a2c0a0b0..a64459ae 100644 --- a/base/cli/qrcode.go +++ b/base/cli/qrcode.go @@ -14,14 +14,14 @@ import ( ) var _trans_web = map[string]color.Color{ - BLACK: color.RGBA{0, 0, 0, DARK}, - RED: color.RGBA{DARK, 0, 0, DARK}, - GREEN: color.RGBA{0, DARK, 0, DARK}, - YELLOW: color.RGBA{DARK, DARK, 0, DARK}, - BLUE: color.RGBA{0, 0, DARK, DARK}, - MAGENTA: color.RGBA{DARK, 0, DARK, DARK}, - CYAN: color.RGBA{0, DARK, DARK, DARK}, - WHITE: color.RGBA{DARK, DARK, DARK, DARK}, + BLACK: color.RGBA{0, 0, 0, DARK}, + RED: color.RGBA{DARK, 0, 0, DARK}, + GREEN: color.RGBA{0, DARK, 0, DARK}, + YELLOW: color.RGBA{DARK, DARK, 0, DARK}, + BLUE: color.RGBA{0, 0, DARK, DARK}, + PURPLE: color.RGBA{DARK, 0, DARK, DARK}, + CYAN: color.RGBA{0, DARK, DARK, DARK}, + WHITE: color.RGBA{DARK, DARK, DARK, DARK}, } func _parse_color(str string) color.Color { @@ -112,15 +112,15 @@ const ( LIGHT = 127 ) const ( - BLACK = "black" - RED = "red" - GREEN = "green" - YELLOW = "yellow" - BLUE = "blue" - MAGENTA = "magenta" - CYAN = "cyan" - WHITE = "white" - RANDOM = "random" + BLACK = "black" + RED = "red" + GREEN = "green" + YELLOW = "yellow" + BLUE = "blue" + PURPLE = "purple" + CYAN = "cyan" + WHITE = "white" + RANDOM = "random" ) const QRCODE = "qrcode" diff --git a/core/wiki/draw.go b/core/wiki/draw.go index 646de0bf..0ddf02f7 100644 --- a/core/wiki/draw.go +++ b/core/wiki/draw.go @@ -4,6 +4,7 @@ import ( "path" ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/nfs" kit "shylinux.com/x/toolkits" ) @@ -16,11 +17,11 @@ func init() { }, Commands: map[string]*ice.Command{ DRAW: {Name: "draw path=src/main.svg refresh:button=auto edit save project actions", Help: "思维导图", Meta: kit.Dict( ice.Display("/plugin/local/wiki/draw.js"), - ), Action: map[string]*ice.Action{ + ), Action: ice.MergeAction(map[string]*ice.Action{ nfs.SAVE: {Name: "save path", Help: "保存", Hand: func(m *ice.Message, arg ...string) { _wiki_save(m, DRAW, path.Join(arg...), m.Option(kit.MDB_CONTENT)) }}, - }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + }, ctx.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { if !_wiki_list(m, DRAW, kit.Select("./", path.Join(arg...))) { _wiki_show(m, DRAW, path.Join(arg...)) } diff --git a/info.go b/info.go index 5657cb0f..50bf397b 100644 --- a/info.go +++ b/info.go @@ -59,7 +59,7 @@ func Dump(w io.Writer, name string, cb func(string)) bool { } return false } -func Name(name string, value interface{}) string { +func name(name string, value interface{}) string { if s, ok := Info.names[name]; ok { last := "" switch s := s.(type) { diff --git a/type.go b/type.go index ea26251c..429e2369 100644 --- a/type.go +++ b/type.go @@ -80,9 +80,9 @@ func (c *Context) Server() Server { return c.server } -func (c *Context) Register(s *Context, x Server, name ...string) *Context { - for _, n := range name { - Name(n, s) +func (c *Context) Register(s *Context, x Server, n ...string) *Context { + for _, n := range n { + name(n, s) } if c.contexts == nil {