forked from x/volcanos
opt cmd
This commit is contained in:
parent
b4139813f4
commit
4f9380d82c
2
frame.js
2
frame.js
@ -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,
|
||||
})._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)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
})
|
||||
|
25
panel/cmd.js
25
panel/cmd.js
@ -1,14 +1,25 @@
|
||||
|
||||
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()
|
||||
},
|
||||
onmain: function(can, msg) {
|
||||
var args = location.pathname.split("/").slice(1)
|
||||
can.onappend.plugin(can, {index: args[2], args: args.slice(3), opts: can.user.Search(), width: window.innerWidth}, function(sub, meta) {
|
||||
sub.run = function(event, cmds, cb) { can.run(event, [ctx.ACTION, "run", args[2]].concat(cmds), cb) }
|
||||
can.onmotion.hidden(can, sub._legend)
|
||||
onmain: function(can) {
|
||||
var msg = can.request({}, {_names: location.pathname})
|
||||
can.run(msg._event, [ctx.ACTION, ctx.COMMAND], function(msg) {
|
||||
can.core.Next(msg.Table(), function(line, next) {
|
||||
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)
|
||||
next()
|
||||
})
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user