forked from x/volcanos
opt cmd.js
This commit is contained in:
parent
73294ce1ef
commit
2dcd8b0760
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,
|
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: msg.Option("_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")||panel._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)
|
||||||
})
|
})
|
||||||
|
@ -1,21 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<head>
|
|
||||||
<link rel="apple-touch-icon-precomposed" href="/page/app.png"/>
|
|
||||||
<link rel="apple-touch-startup-image" href="/page/splash.png"/>
|
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=0.8,user-scalable=no">
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>volcanos</title>
|
|
||||||
<link rel="shortcut icon" type="image/ico" href="favicon.ico">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/page/cache.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="/page/index.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
<body>
|
||||||
<script src="/proto.js"></script>
|
<!-- <script src="/page/can.js"></script><script> -->
|
||||||
<script src="/page/cache.js"></script>
|
<script src="/proto.js"></script><script>
|
||||||
<script src="/page/cmd.js"></script>
|
app("/chat/", [
|
||||||
|
{index: "cli.runtime"},
|
||||||
|
{index: "cli.system"},
|
||||||
|
{index: "hash"},
|
||||||
|
{index: "nav"},
|
||||||
|
])
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
20
page/cmd.js
20
page/cmd.js
@ -1,20 +0,0 @@
|
|||||||
Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js",
|
|
||||||
libs: ["/lib/base.js", "/lib/core.js", "/lib/misc.js", "/lib/page.js", "/lib/user.js"], panels: [
|
|
||||||
{name: "cmd", help: "工作台", pos: "main"},
|
|
||||||
], main: {name: "Header", list: []}, plugin: [
|
|
||||||
"/plugin/state.js",
|
|
||||||
"/plugin/input.js",
|
|
||||||
"/plugin/table.js",
|
|
||||||
"/plugin/input/key.js",
|
|
||||||
"/plugin/input/date.js",
|
|
||||||
"/plugin/story/trend.js",
|
|
||||||
"/plugin/story/spide.js",
|
|
||||||
"/plugin/local/code/inner.js",
|
|
||||||
"/plugin/local/code/vimer.js",
|
|
||||||
"/plugin/local/wiki/draw/path.js",
|
|
||||||
"/plugin/local/wiki/draw.js",
|
|
||||||
"/plugin/local/wiki/word.js",
|
|
||||||
"/plugin/local/team/plan.js",
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
@ -2,9 +2,12 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
|
|||||||
can.onmotion.float.auto(can, can._output, "carte")
|
can.onmotion.float.auto(can, can._output, "carte")
|
||||||
can.base.isFunc(cb) && cb()
|
can.base.isFunc(cb) && cb()
|
||||||
},
|
},
|
||||||
onmain: function(can) {
|
onmain: function(can) { can._names = location.pathname
|
||||||
var msg = can.request({}, {_names: location.pathname})
|
var msg = can.request({}, {_names: location.pathname})
|
||||||
can.run(msg._event, [ctx.ACTION, ctx.COMMAND], function(msg) {
|
can.Conf("tool")? can.core.Next(can.Conf("tool"), function(line, next) {
|
||||||
|
can.onaction._plugin(can, line.index, can.base.Obj(line.args, []), next)
|
||||||
|
|
||||||
|
}): can.run(msg._event, [ctx.ACTION, ctx.COMMAND], function(msg) {
|
||||||
can.core.Next(msg.Table(), function(line, next) {
|
can.core.Next(msg.Table(), function(line, next) {
|
||||||
can.onaction._plugin(can, line.index, can.base.Obj(line.args, []), next)
|
can.onaction._plugin(can, line.index, can.base.Obj(line.args, []), next)
|
||||||
})
|
})
|
||||||
@ -14,7 +17,6 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
|
|||||||
_plugin: function(can, index, args, next) {
|
_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) {
|
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) {
|
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.run(event, (can.onengine[cmds[0]]? []: [ctx.ACTION, "run", index]).concat(cmds), cb)
|
||||||
}
|
}
|
||||||
// can.onmotion.hidden(can, sub._legend)
|
// can.onmotion.hidden(can, sub._legend)
|
||||||
|
@ -6,7 +6,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf,
|
|||||||
return can.core.CallFunc([can.onimport, msg.OptionProcess()], [can, msg])
|
return can.core.CallFunc([can.onimport, msg.OptionProcess()], [can, msg])
|
||||||
},
|
},
|
||||||
|
|
||||||
_rewrite: function(can, msg, _arg) { can.Option(msg._arg[0], msg._arg[1])
|
_location: function(can, msg) {
|
||||||
|
location.href = msg._arg[0]
|
||||||
|
},
|
||||||
|
_rewrite: function(can, msg) { can.Option(msg._arg[0], msg._arg[1])
|
||||||
can.onappend._output(can, can.Conf(), {}, can.Pack())
|
can.onappend._output(can, can.Conf(), {}, can.Pack())
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
23
proto.js
23
proto.js
@ -152,7 +152,7 @@ var Volcanos = shy("火山架", {volcano: "/frame.js", args: {}, pack: {}, libs:
|
|||||||
Config.main = Config.main||{}
|
Config.main = Config.main||{}
|
||||||
|
|
||||||
// 预加载
|
// 预加载
|
||||||
var Preload = []; for (var i = 0; i < Config.panels.length; i++) { var panel = Config.panels[i]
|
var Preload = Config.preload||[]; for (var i = 0; i < Config.panels.length; i++) { var panel = Config.panels[i]
|
||||||
panel && (Preload = Preload.concat(panel.list = panel.list || ["/panel/"+panel.name+".css", "/panel/"+panel.name+".js"]))
|
panel && (Preload = Preload.concat(panel.list = panel.list || ["/panel/"+panel.name+".css", "/panel/"+panel.name+".js"]))
|
||||||
}; Preload = Preload.concat(Config.plugin)
|
}; Preload = Preload.concat(Config.plugin)
|
||||||
|
|
||||||
@ -238,3 +238,24 @@ Volcanos.meta._load = function(url, cb) {
|
|||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function app(name, tool) {
|
||||||
|
Volcanos({name: name, iceberg: "/chat/", volcano: "/frame.js", preload: ["/page/can.css"],
|
||||||
|
libs: ["/lib/base.js", "/lib/core.js", "/lib/misc.js", "/lib/page.js", "/lib/user.js"],
|
||||||
|
panels: [{name: "cmd", help: "工作台", pos: "main", tool: tool}], main: {name: "Header", list: []}, plugin: [
|
||||||
|
"/plugin/state.js",
|
||||||
|
"/plugin/input.js",
|
||||||
|
"/plugin/table.js",
|
||||||
|
"/plugin/input/key.js",
|
||||||
|
"/plugin/input/date.js",
|
||||||
|
"/plugin/story/trend.js",
|
||||||
|
"/plugin/story/spide.js",
|
||||||
|
"/plugin/local/code/inner.js",
|
||||||
|
"/plugin/local/code/vimer.js",
|
||||||
|
"/plugin/local/wiki/draw/path.js",
|
||||||
|
"/plugin/local/wiki/draw.js",
|
||||||
|
"/plugin/local/wiki/word.js",
|
||||||
|
"/plugin/local/team/plan.js",
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user