forked from x/icebergs
opt onappend
This commit is contained in:
parent
805fe37ec8
commit
0cd92ae347
@ -27,7 +27,7 @@ func _command_list(m *ice.Message, name string) *ice.Message {
|
||||
name = GetFileCmd(name)
|
||||
case nfs.JS:
|
||||
m.Push(DISPLAY, FileURI(name))
|
||||
name = kit.Select(CAN_PLUGIN, GetFileCmd(name))
|
||||
name = kit.Select(ice.CAN_PLUGIN, GetFileCmd(name))
|
||||
default:
|
||||
if msg := m.Cmd(mdb.RENDER, kit.Ext(name)); msg.Length() > 0 {
|
||||
m.Push(ARGS, kit.Format(kit.List(name)))
|
||||
@ -36,7 +36,7 @@ func _command_list(m *ice.Message, name string) *ice.Message {
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(name, "can.") {
|
||||
return m.Push(mdb.INDEX, name)
|
||||
return m.Push(mdb.INDEX, name).Push(mdb.NAME, name).Push(mdb.HELP, "").Push(mdb.META, "").Push(mdb.LIST, "")
|
||||
}
|
||||
m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) {
|
||||
m.Push(mdb.INDEX, kit.Keys(s.Cap(ice.CTX_FOLLOW), key))
|
||||
@ -70,8 +70,6 @@ const (
|
||||
DISPLAY = "display"
|
||||
ACTION = "action"
|
||||
TRANS = "trans"
|
||||
|
||||
CAN_PLUGIN = "can.plugin"
|
||||
)
|
||||
const COMMAND = "command"
|
||||
|
||||
|
4
conf.go
4
conf.go
@ -85,19 +85,19 @@ const ( // DIR
|
||||
PLUGIN = "plugin"
|
||||
STORY = "story"
|
||||
|
||||
PAGE_FAVICON_ICO = "page/favicon.ico"
|
||||
|
||||
INDEX_CSS = "index.css"
|
||||
PROTO_JS = "proto.js"
|
||||
FRAME_JS = "frame.js"
|
||||
INDEX_JS = "index.js"
|
||||
INDEX_SH = "index.sh"
|
||||
|
||||
PAGE_FAVICON_ICO = "page/favicon.ico"
|
||||
PLUGIN_INPUT = "/plugin/input/"
|
||||
PLUGIN_STORY = "/plugin/story/"
|
||||
PLUGIN_LOCAL = "/plugin/local/"
|
||||
NODE_MODULES = "node_modules/"
|
||||
ISH_PLUGED = ".ish/pluged/"
|
||||
CAN_PLUGIN = "can._plugin"
|
||||
|
||||
USR_VOLCANOS = "usr/volcanos/"
|
||||
USR_LEARNING = "usr/learning/"
|
||||
|
@ -25,7 +25,7 @@ func _cmd_file(m *ice.Message, arg ...string) bool {
|
||||
web.RenderCmd(m, ctx.GetFileCmd(p))
|
||||
case nfs.JS:
|
||||
ctx.DisplayBase(m, ctx.FileURI(p))
|
||||
web.RenderCmd(m, kit.Select(ctx.CAN_PLUGIN, ctx.GetFileCmd(p)))
|
||||
web.RenderCmd(m, kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(p)))
|
||||
default:
|
||||
if p = strings.TrimPrefix(p, ice.SRC+ice.PS); nfs.ExistsFile(m, path.Join(ice.SRC, p)) {
|
||||
if msg := m.Cmd(mdb.ENGINE, kit.Ext(p)); msg.Length() > 0 {
|
||||
|
@ -55,7 +55,7 @@ func _website_parse(m *ice.Message, text string, args ...string) (ice.Map, bool)
|
||||
data := kit.Dict()
|
||||
switch kit.Ext(ls[0]) {
|
||||
case nfs.JS:
|
||||
ls[0], data[ctx.DISPLAY] = kit.Select(ctx.CAN_PLUGIN, ctx.GetFileCmd(ls[0])), ctx.FileURI(ls[0])
|
||||
ls[0], data[ctx.DISPLAY] = kit.Select(ice.CAN_PLUGIN, ctx.GetFileCmd(ls[0])), ctx.FileURI(ls[0])
|
||||
case nfs.GO:
|
||||
ls[0] = ctx.GetFileCmd(ls[0])
|
||||
case nfs.SHY:
|
||||
|
@ -59,7 +59,7 @@ func _css_show(m *ice.Message, arg ...string) {
|
||||
func _css_exec(m *ice.Message, arg ...string) {
|
||||
if arg[2] == ice.USR_VOLCANOS && strings.HasPrefix(arg[1], ice.PLUGIN_LOCAL) {
|
||||
key := ctx.GetFileCmd("/require/shylinux.com/x/icebergs/core/" + strings.TrimPrefix(arg[1], ice.PLUGIN_LOCAL))
|
||||
ctx.ProcessCommand(m, kit.Select("can.plugin", key), kit.Simple())
|
||||
ctx.ProcessCommand(m, kit.Select(ice.CAN_PLUGIN, key), kit.Simple())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ func _js_show(m *ice.Message, arg ...string) {
|
||||
func _js_exec(m *ice.Message, arg ...string) {
|
||||
if arg[2] == "usr/volcanos/" && strings.HasPrefix(arg[1], "plugin/local/") {
|
||||
key := "web." + strings.Replace(strings.TrimSuffix(strings.TrimPrefix(arg[1], "plugin/local/"), ".js"), ice.PS, ice.PT, -1)
|
||||
ctx.ProcessCommand(m, kit.Select("can.plugin", key), kit.Simple())
|
||||
ctx.ProcessCommand(m, kit.Select(ice.CAN_PLUGIN, key), kit.Simple())
|
||||
return
|
||||
}
|
||||
ctx.DisplayBase(m, path.Join("/require", path.Join(arg[2], arg[1])))
|
||||
|
Loading…
x
Reference in New Issue
Block a user