forked from x/volcanos
opt some
This commit is contained in:
parent
fcbbf271a3
commit
4c5b658c4c
10
frame.js
10
frame.js
@ -179,10 +179,12 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
|
||||
]},
|
||||
}},
|
||||
"project": {name: "研发群", storm: {
|
||||
"studio": {name: "studio", index: [
|
||||
"web.code.vimer",
|
||||
"web.code.git.total",
|
||||
"web.code.git.status",
|
||||
"studio": {name: "studio", action: [
|
||||
{name: "vimer", help: "编辑器", index: "web.code.vimer"},
|
||||
{name: "paste", help: "粘贴板", index: "web.code.tmux.text"},
|
||||
{name: "favor", help: "收藏夹", index: "web.wiki.word", args: ["usr/learning/favor.shy"]},
|
||||
{name: "total", help: "代码统计", index: "web.code.git.total"},
|
||||
{name: "status", help: "代码状态", index: "web.code.git.status"},
|
||||
]},
|
||||
"cli": {name: "cli", action: [
|
||||
{name: "tmux", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/tmux/tmux.shy"]},
|
||||
|
@ -1,8 +1,23 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, meta, list, cb, target) {
|
||||
typeof cb == "function" && cb()
|
||||
can.sublist = {}
|
||||
},
|
||||
storm: function(event, can, river) {
|
||||
river: function(can) { var key = "river"
|
||||
var main = can.user.Search(can, key) || "研发群"
|
||||
can.sublist = {}
|
||||
can.run({}, [], function(sup) { can._output.innerHTML = ""; var select; sup.Table(function(value, index, array) {
|
||||
var view = can.onappend.item(can, can._output, "item", value, function(event, item) { var msg = can.request(event, {_msg: sup})
|
||||
can.onimport.storm(can, value.key)
|
||||
return
|
||||
// 左键点击
|
||||
msg.Option(key, can.Conf(key, value.key)), can.run(event, ["search", "Storm.onaction._init"])
|
||||
}, function(event) {
|
||||
// 右键点击
|
||||
can.onappend.menu(can, msg, value)
|
||||
})
|
||||
|
||||
if (index == 0 || [value.key, value.name].indexOf(main) > -1) { select = view }
|
||||
}); select && select.click(), typeof cb == "function" && cb(sup) })
|
||||
},
|
||||
storm: function(can, river) {
|
||||
var list = can.sublist[river]; if (list) { var hide = list.style.display == "none"
|
||||
return can.page.Modify(can, list, {style: {display: hide? "": "none"}})
|
||||
}
|
||||
@ -51,7 +66,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, meta,
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "控件交互", list: ["创建", "刷新"], _init: function(can, msg, list, cb, target) {
|
||||
can.onexport._init(can, msg, list, cb, target)
|
||||
can.onimport.river(can)
|
||||
},
|
||||
create: function(can) {
|
||||
can.user.input(event, can, [
|
||||
@ -142,24 +157,5 @@ Volcanos("ondetail", {help: "菜单交互", list: ["添加应用", "添加设备
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, list, cb, target) { var key = "river"
|
||||
can.run({}, [], function(sup) { can._output.innerHTML = ""; var select; sup.Table(function(value, index, array) {
|
||||
var view = can.onappend.item(can, can._output, "item", value, function(event, item) { var msg = can.request(event, {_msg: sup})
|
||||
can.onimport.storm(event, can, value.key)
|
||||
return
|
||||
// 左键点击
|
||||
msg.Option(key, can.Conf(key, value.key)), can.run(event, ["search", "Storm.onaction._init"])
|
||||
}, function(event) {
|
||||
// 右键点击
|
||||
can.onappend.menu(can, msg, value)
|
||||
})
|
||||
|
||||
if (index == 0 || [value.key, value.name].indexOf(can.user.Search(can, key)) > -1) { select = view }
|
||||
}); select && select.click(), typeof cb == "function" && cb(sup) })
|
||||
},
|
||||
key: function(can, msg) {
|
||||
msg.Option("river", can.Conf("river"))
|
||||
msg.Option("storm", can.Conf("storm"))
|
||||
},
|
||||
})
|
||||
Volcanos("onexport", {help: "导出数据", list: []})
|
||||
|
||||
|
@ -48,7 +48,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
||||
can._msg = can.tabview[path+file]
|
||||
|
||||
can.Option({path: path, file: file, line: line||parseInt(can._msg.Option("line"))})
|
||||
can.file = file, can.parse = can.base.Ext(file), can.max = 0
|
||||
can.file = file, can.parse = can.base.Ext(file||path), can.max = 0
|
||||
can.onsyntax._init(can, can._msg)
|
||||
|
||||
var width = can._target.offsetWidth - can.ui.project.offsetWidth - can.ui.preview.offsetWidth - 40
|
||||
@ -57,7 +57,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
||||
}
|
||||
if (can.tabview[path+file]) { return show() }
|
||||
|
||||
can.run({}, ["action", "render", can.base.Ext(file), file, path], function(msg) {
|
||||
can.run({}, ["action", "render", can.base.Ext(file||path), file, path], function(msg) {
|
||||
msg.Option({path: path, file: file, line: line||1})
|
||||
can.tabview[path+file] = msg
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user