1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00
This commit is contained in:
harveyshao 2021-11-19 07:45:07 +08:00
parent 06dc70c4fe
commit 9f37afd1c8
4 changed files with 24 additions and 23 deletions

View File

@ -14,14 +14,14 @@ import (
) )
var _trans_web = map[string]color.Color{ var _trans_web = map[string]color.Color{
BLACK: color.RGBA{0, 0, 0, DARK}, BLACK: color.RGBA{0, 0, 0, DARK},
RED: color.RGBA{DARK, 0, 0, DARK}, RED: color.RGBA{DARK, 0, 0, DARK},
GREEN: color.RGBA{0, DARK, 0, DARK}, GREEN: color.RGBA{0, DARK, 0, DARK},
YELLOW: color.RGBA{DARK, DARK, 0, DARK}, YELLOW: color.RGBA{DARK, DARK, 0, DARK},
BLUE: color.RGBA{0, 0, DARK, DARK}, BLUE: color.RGBA{0, 0, DARK, DARK},
MAGENTA: color.RGBA{DARK, 0, DARK, DARK}, PURPLE: color.RGBA{DARK, 0, DARK, DARK},
CYAN: color.RGBA{0, DARK, DARK, DARK}, CYAN: color.RGBA{0, DARK, DARK, DARK},
WHITE: color.RGBA{DARK, DARK, DARK, DARK}, WHITE: color.RGBA{DARK, DARK, DARK, DARK},
} }
func _parse_color(str string) color.Color { func _parse_color(str string) color.Color {
@ -112,15 +112,15 @@ const (
LIGHT = 127 LIGHT = 127
) )
const ( const (
BLACK = "black" BLACK = "black"
RED = "red" RED = "red"
GREEN = "green" GREEN = "green"
YELLOW = "yellow" YELLOW = "yellow"
BLUE = "blue" BLUE = "blue"
MAGENTA = "magenta" PURPLE = "purple"
CYAN = "cyan" CYAN = "cyan"
WHITE = "white" WHITE = "white"
RANDOM = "random" RANDOM = "random"
) )
const QRCODE = "qrcode" const QRCODE = "qrcode"

View File

@ -4,6 +4,7 @@ import (
"path" "path"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/nfs"
kit "shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
) )
@ -16,11 +17,11 @@ func init() {
}, Commands: map[string]*ice.Command{ }, Commands: map[string]*ice.Command{
DRAW: {Name: "draw path=src/main.svg refresh:button=auto edit save project actions", Help: "思维导图", Meta: kit.Dict( 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"), 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) { 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)) _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...))) { if !_wiki_list(m, DRAW, kit.Select("./", path.Join(arg...))) {
_wiki_show(m, DRAW, path.Join(arg...)) _wiki_show(m, DRAW, path.Join(arg...))
} }

View File

@ -59,7 +59,7 @@ func Dump(w io.Writer, name string, cb func(string)) bool {
} }
return false return false
} }
func Name(name string, value interface{}) string { func name(name string, value interface{}) string {
if s, ok := Info.names[name]; ok { if s, ok := Info.names[name]; ok {
last := "" last := ""
switch s := s.(type) { switch s := s.(type) {

View File

@ -80,9 +80,9 @@ func (c *Context) Server() Server {
return c.server return c.server
} }
func (c *Context) Register(s *Context, x Server, name ...string) *Context { func (c *Context) Register(s *Context, x Server, n ...string) *Context {
for _, n := range name { for _, n := range n {
Name(n, s) name(n, s)
} }
if c.contexts == nil { if c.contexts == nil {