1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 09:34:05 +08:00

opt inner.js

This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-01-18 00:31:17 +08:00
parent ea1b19f7b0
commit e8623eaba4
2 changed files with 13 additions and 1 deletions

View File

@ -184,7 +184,8 @@ func init() {
}
})
m.Display("/plugin/story/pie.js?field=Size")
m.RenameAppend("Use%", "Use")
m.RenameAppend("%iused", "piused")
m.RenameAppend("Use%", "Usep")
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) > 0 && arg[0] == BOOTINFO {

View File

@ -1,9 +1,12 @@
package wiki
import (
"path"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/lex"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
kit "shylinux.com/x/toolkits"
)
@ -15,6 +18,14 @@ func init() {
DRAW: {Name: DRAW, Help: "思维导图", Value: kit.Data(lex.REGEXP, ".*\\.svg")},
}, Commands: map[string]*ice.Command{
DRAW: {Name: "draw path=src/main.svg pid refresh:button=auto edit save actions", Help: "思维导图", Meta: kit.Dict(ice.DisplayLocal("")), Action: ice.MergeAction(map[string]*ice.Action{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.TYPE, "svg", mdb.NAME, m.Prefix(DRAW))
}},
mdb.RENDER: {Name: "render", Help: "渲染", Hand: func(m *ice.Message, arg ...string) {
m.Echo("<html><body>")
defer m.Echo("</body></html>")
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
}},
nfs.SAVE: {Name: "save", Help: "保存", Hand: func(m *ice.Message, arg ...string) {
_wiki_save(m, DRAW, arg[0], m.Option("content"))
}},