mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
34f5b87940
commit
22c2690809
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,8 +1,8 @@
|
||||
pack/
|
||||
*.swp
|
||||
*.swo
|
||||
can.js
|
||||
can.css
|
||||
cache.js
|
||||
cache.css
|
||||
.DS_Store
|
||||
*.swp
|
||||
*.swo
|
||||
pack/
|
||||
|
@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>volcanos</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="/proto.js"></script>
|
||||
<script>
|
||||
Volcanos({name: "cmd", iceberg: "/chat/", volcano: "/frame.js",
|
||||
libs: [
|
||||
"http://localhost:9020/lib/base.js",
|
||||
"http://localhost:9020/lib/core.js",
|
||||
"http://localhost:9020/lib/misc.js",
|
||||
"http://localhost:9020/lib/page.js",
|
||||
"http://localhost:9020/lib/user.js",
|
||||
"http://localhost:9020/page/index.css",
|
||||
],
|
||||
_init: function(can) {
|
||||
can.onappend.plugin(can, {name: "system", help: "命令", inputs: [
|
||||
{type: "text", name: "cmd"},
|
||||
{type: "button", name: "执行"},
|
||||
]}, function(sub, meta) {
|
||||
sub.run = function(event, cmds, cb) {
|
||||
can.run(event, [ctx.ACTION, "run", "cli.system"].concat(cmds), cb)
|
||||
}
|
||||
}, document.body)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
@ -1,17 +1,15 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) {
|
||||
can.onimport.show(can, can.base.Obj(msg.Result(), {}), target)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
can.onimport.show(can, can.base.Obj(msg.Result(), "{}"), target)
|
||||
},
|
||||
show: function(can, data, target) {
|
||||
function show(data, target, index, total) { var list
|
||||
switch (typeof data) {
|
||||
case "object":
|
||||
function toggle(list) {
|
||||
list && can.onmotion.toggle(can, list)
|
||||
}
|
||||
function toggle(list) { list && can.onmotion.toggle(can, list) }
|
||||
function wrap(begin, end, add, cb) {
|
||||
can.page.Append(can, target, [{text: begin}])
|
||||
add && can.page.Append(can, target, [{text: ["...", "span", "nonce"], onclick: function(event) { toggle(list) }}]), cb()
|
||||
add && can.page.Append(can, target, [{text: ["...", "span", "nonce"]}]), cb()
|
||||
can.page.Append(can, target, [{text: end}])
|
||||
}
|
||||
function _node() {
|
||||
@ -42,12 +40,12 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
Volcanos("onaction", {help: "组件菜单", list: ["全部展开", "全部折叠"],
|
||||
"全部展开": function(event, can) {
|
||||
can.page.Select(can, can._output, "div.list div.list", function(list) {
|
||||
can.page.Modify(can, list, {style: {display: "block"}})
|
||||
can.onmotion.hidden(can, list, true)
|
||||
})
|
||||
},
|
||||
"全部折叠": function(event, can) {
|
||||
can.page.Select(can, can._output, "div.list div.list", function(list) {
|
||||
can.page.Modify(can, list, {style: {display: "none"}})
|
||||
can.onmotion.hidden(can, list)
|
||||
})
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user