mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 09:14: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.js
|
||||||
can.css
|
can.css
|
||||||
cache.js
|
cache.js
|
||||||
cache.css
|
cache.css
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.swp
|
pack/
|
||||||
*.swo
|
|
||||||
|
@ -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) {
|
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.base.isFunc(cb) && cb(msg)
|
||||||
can.onimport.show(can, can.base.Obj(msg.Result(), "{}"), target)
|
|
||||||
},
|
},
|
||||||
show: function(can, data, target) {
|
show: function(can, data, target) {
|
||||||
function show(data, target, index, total) { var list
|
function show(data, target, index, total) { var list
|
||||||
switch (typeof data) {
|
switch (typeof data) {
|
||||||
case "object":
|
case "object":
|
||||||
function toggle(list) {
|
function toggle(list) { list && can.onmotion.toggle(can, list) }
|
||||||
list && can.onmotion.toggle(can, list)
|
|
||||||
}
|
|
||||||
function wrap(begin, end, add, cb) {
|
function wrap(begin, end, add, cb) {
|
||||||
can.page.Append(can, target, [{text: begin}])
|
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}])
|
can.page.Append(can, target, [{text: end}])
|
||||||
}
|
}
|
||||||
function _node() {
|
function _node() {
|
||||||
@ -42,12 +40,12 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
Volcanos("onaction", {help: "组件菜单", list: ["全部展开", "全部折叠"],
|
Volcanos("onaction", {help: "组件菜单", list: ["全部展开", "全部折叠"],
|
||||||
"全部展开": function(event, can) {
|
"全部展开": function(event, can) {
|
||||||
can.page.Select(can, can._output, "div.list div.list", function(list) {
|
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) {
|
"全部折叠": function(event, can) {
|
||||||
can.page.Select(can, can._output, "div.list div.list", function(list) {
|
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