mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 17:44:05 +08:00
opt chat.div
This commit is contained in:
parent
39980c4be4
commit
a6af733c9d
@ -154,6 +154,17 @@ func selectAction(list map[string]*ice.Action, fields ...string) map[string]*ice
|
||||
}
|
||||
return res
|
||||
}
|
||||
func CmdAction(fields ...string) map[string]*ice.Action {
|
||||
return selectAction(map[string]*ice.Action{
|
||||
"command": {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy("command", arg)
|
||||
}},
|
||||
"run": {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(arg)
|
||||
}},
|
||||
}, fields...)
|
||||
}
|
||||
|
||||
func HashAction(fields ...string) map[string]*ice.Action {
|
||||
return selectAction(map[string]*ice.Action{
|
||||
CREATE: {Name: "create type name text", Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||
@ -186,7 +197,7 @@ func HashAction(fields ...string) map[string]*ice.Action {
|
||||
INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(INPUTS, m.PrefixKey(), "", HASH, arg)
|
||||
}},
|
||||
})
|
||||
}, fields...)
|
||||
}
|
||||
|
||||
const HASH = "hash"
|
||||
|
@ -20,12 +20,12 @@ func init() {
|
||||
kit.MDB_PATH, ice.USR_PUBLISH,
|
||||
)},
|
||||
}, Commands: map[string]*ice.Command{
|
||||
DIV: {Name: "div hash auto create", Help: "定制", Action: ice.MergeAction(map[string]*ice.Action{
|
||||
DIV: {Name: "div hash auto", Help: "定制", Action: ice.MergeAction(map[string]*ice.Action{
|
||||
mdb.CREATE: {Name: "create type=page name=hi.html text", Help: "创建"},
|
||||
cli.MAKE: {Name: "make", Help: "生成", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(nfs.SAVE, path.Join(m.Conf(DIV, kit.META_PATH), m.Option(kit.MDB_NAME)), m.Option(kit.MDB_TEXT))
|
||||
}},
|
||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
}, mdb.HashAction(), mdb.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Fields(len(arg), m.Conf(DIV, kit.META_FIELD))
|
||||
m.Cmdy(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, kit.MDB_HASH, arg)
|
||||
m.Table(func(index int, value map[string]string, head []string) {
|
||||
@ -33,6 +33,9 @@ func init() {
|
||||
})
|
||||
if m.PushAction(cli.MAKE, mdb.REMOVE); len(arg) > 0 {
|
||||
m.Option(ice.MSG_DISPLAY, "/plugin/local/chat/div.js")
|
||||
m.Action("添加", "保存", "预览")
|
||||
} else {
|
||||
m.Action(mdb.CREATE)
|
||||
}
|
||||
}},
|
||||
"/div": {Name: "/div", Help: "定制", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user