mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt draw
This commit is contained in:
parent
06dc70c4fe
commit
9f37afd1c8
@ -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"
|
||||
|
||||
|
@ -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...))
|
||||
}
|
||||
|
2
info.go
2
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) {
|
||||
|
6
type.go
6
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user