1
0
forked from x/icebergs
icebergs/core/wiki/feel.go
2022-07-09 20:13:21 +08:00

31 lines
1.0 KiB
Go

package wiki
import (
"path"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/lex"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
)
const FEEL = "feel"
func init() {
Index.Merge(&ice.Context{Configs: ice.Configs{
FEEL: {Name: FEEL, Help: "影音媒体", Value: kit.Data(nfs.PATH, ice.USR_LOCAL_IMAGE, lex.REGEXP, ".*.(png|PNG|jpg|JPG|jpeg|mp4|m4v|MOV)")},
}, Commands: ice.Commands{
FEEL: {Name: "feel path auto upload prev next actions", Help: "影音媒体", Meta: kit.Dict(ice.DisplayLocal("")), Actions: ice.Actions{
web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
_wiki_upload(m, m.CommandKey(), m.Option(nfs.PATH))
}},
nfs.TRASH: {Name: "trash", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(nfs.TRASH, path.Join(m.Config(nfs.PATH), path.Join(arg...)))
}},
}, Hand: func(m *ice.Message, arg ...string) {
_wiki_list(m, m.CommandKey(), kit.Select(nfs.PWD, arg, 0))
}},
}})
}