1
0
forked from x/volcanos
This commit is contained in:
shaoying 2021-08-01 14:37:49 +08:00
parent b4139813f4
commit 4f9380d82c
2 changed files with 19 additions and 8 deletions

View File

@ -50,7 +50,7 @@ Volcanos("onengine", {help: "搜索引擎", list: [], _init: function(can, meta,
time: can.base.Time(null, "%H:%M:%S"), follow: panel._follow, msg: msg, commands: cmds, time: can.base.Time(null, "%H:%M:%S"), follow: panel._follow, msg: msg, commands: cmds,
})._event, ["Footer.onimport.ncmd"]) })._event, ["Footer.onimport.ncmd"])
can.misc.Run(event, can, {names: (can.Conf("iceberg")||"/chat/")+panel._name, daemon: can.ondaemon._list[0]+"."+msg._daemon}, cmds, function(msg) { can.misc.Run(event, can, {names: msg.Option("_names")||((can.Conf("iceberg")||"/chat/")+panel._name), daemon: can.ondaemon._list[0]+"."+msg._daemon}, cmds, function(msg) {
Volcanos.meta.pack[key] = msg, delete(msg._handle), delete(msg._toast) Volcanos.meta.pack[key] = msg, delete(msg._handle), delete(msg._toast)
can.base.isFunc(cb) && cb(msg) can.base.isFunc(cb) && cb(msg)
}) })

View File

@ -1,14 +1,25 @@
Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, list, cb, target) { Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, list, cb, target) {
console.log("what") can.onmotion.float.auto(can, can._output, "carte")
can.base.isFunc(cb) && cb() can.base.isFunc(cb) && cb()
}, },
onmain: function(can, msg) { onmain: function(can) {
var args = location.pathname.split("/").slice(1) var msg = can.request({}, {_names: location.pathname})
can.onappend.plugin(can, {index: args[2], args: args.slice(3), opts: can.user.Search(), width: window.innerWidth}, function(sub, meta) { can.run(msg._event, [ctx.ACTION, ctx.COMMAND], function(msg) {
sub.run = function(event, cmds, cb) { can.run(event, [ctx.ACTION, "run", args[2]].concat(cmds), cb) } can.core.Next(msg.Table(), function(line, next) {
can.onmotion.hidden(can, sub._legend) can.onaction._plugin(can, line.index, can.base.Obj(line.args, []), next)
})
})
can.page.ClassList.add(can, can._target, "Action")
},
_plugin: function(can, index, args, next) {
can.onappend.plugin(can, {type: "plugin", index: index, args: args, opts: can.user.Search(), width: window.innerWidth}, function(sub, meta) {
sub.run = function(event, cmds, cb) {
var msg = can.request(event, {_names: location.pathname})
can.run(event, (can.onengine[cmds[0]]? []: [ctx.ACTION, "run", index]).concat(cmds), cb)
}
// can.onmotion.hidden(can, sub._legend)
can.user.title(meta.name) can.user.title(meta.name)
next()
}) })
}, },
}) })