1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
shaoying 2022-12-20 10:42:43 +08:00
parent bda5e90625
commit 00bf48ccd9
3 changed files with 11 additions and 17 deletions

View File

@ -5,7 +5,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onmotion.clear(can)
can.onappend.plugin(can, item, function(sub, meta, skip) { can.onimport._run(can, sub, function(event, cmds, cb) {
return can.run(event, can.misc.concat(can, river == web.SHARE? [ctx.ACTION]: [], [river, storm, meta.id||meta.index], cmds), cb)
}), can.onimport._tabs(can, sub, meta), skip || next() })
}, function() { can.onaction.layout(can, can.misc.SearchOrConf(can, html.LAYOUT), true) })
}, function() { can.onmotion.delay(can, function() { can.onaction.layout(can, can.misc.SearchOrConf(can, html.LAYOUT), true) }) })
},
_share: function(can, share) { share && can.runAction({}, web.SHARE, [share], function(msg) {
can.Mode(web.SHARE), msg.Length() > 1? can.onlayout._init(can): can.onengine.signal(can, chat.ONACTION_CMD)

View File

@ -62,7 +62,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
})
},
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
function isCommand() { return path == ctx.COMMAND || line == ctx.INDEX || line == code.XTERM }
function isCommand() { return path == ctx.COMMAND || line == ctx.INDEX }
function isDream() { return line == web.DREAM }
function show(skip) { if (can.isCmdMode()) { can.onimport._title(can, path+file) }
can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.tabview[key]
@ -145,8 +145,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
if (msg.Option(ice.MSG_PROCESS) == "_field") {
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY), item.height = height-2*html.ACTION_HEIGHT
can.onimport.plug(can, item, function(sub) {
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
height && sub.ConfHeight(height-2*html.ACTION_HEIGHT), width && sub.ConfWidth(width)
}, target)
})
@ -164,19 +164,16 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
can.onmotion.hidden(can, target)
}
},
toolkit: function(can, meta, cb) { meta.msg = true
toolkit: function(can, meta, cb) { meta._delay_init = true
can.onimport.plug(can, meta, function(sub) {
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
if (can.page.SelectOne(can, can._status, ice.PT+html.SELECT) == event.target) {
can.page.ClassList.del(can, event.target, html.SELECT)
can.page.ClassList.del(can, sub._target, html.SELECT)
can.page.ClassList.del(can, event.target, html.SELECT), can.page.ClassList.del(can, sub._target, html.SELECT)
} else {
can.page.SelectChild(can, can._output, can.core.Keys(html.FIELDSET, "plug"), function(target) {
if (target == sub._target) { can.page.ClassList.neg(can, target, html.SELECT) } else {
can.page.ClassList.del(can, target, html.SELECT)
}
can.page.ClassList.set(can, target, html.SELECT, target == sub._target)
}), can.onmotion.select(can, can._status, html.LEGEND, event.target)
if (meta.msg == true) { meta.msg = false, sub.Update() }
if (meta._delay_init == true) { meta._delay_init = false, sub.Update() }
}
}, sub._legend.onmouseenter = null
sub.onaction.close = sub.select = function() { return sub._legend.click(), sub }
@ -208,9 +205,7 @@ Volcanos(chat.ONFIGURE, {
function show(target, path) { can.run(can.request({}, {dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) {
can.onimport.tree(can, msg.Table(), nfs.PATH, ice.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target)
can.Status("文件数", zone._total(total += msg.Length()))
}, true) }
if (path.length == 1) { return show(target, path[0]) } can.page.Remove(can, target.previousSibling)
}, true) } if (path.length == 1) { return show(target, path[0]) } can.page.Remove(can, target.previousSibling)
can.onimport.zone(can, can.core.List(path, function(path) { return {name: path, _init: function(target) { show(target, path) }} }), target)
},
plugin: function(can, target, zone) { var total = 0
@ -297,8 +292,7 @@ Volcanos(chat.ONACTION, {
}}
]}]); return ui.tr
},
selectLine: function(can, line) {
if (!line) { return can.onexport.line(can, can.page.SelectOne(can, can.ui._content, "tr.select")) }
selectLine: function(can, line) { if (!line) { return can.onexport.line(can, can.page.SelectOne(can, can.ui._content, "tr.select")) }
can.page.Select(can, can.ui._content, "tr>td.line", function(td, index) { var tr = td.parentNode, n = parseInt(td.innerText)
if (!can.page.ClassList.set(can, tr, html.SELECT, tr == line || n == line)) { return }
line = tr, can.Status("当前行", can.onexport.position(can, can.Option(nfs.LINE, n)))

View File

@ -85,7 +85,7 @@ Volcanos(chat.ONFIGURE, {
can.onmotion.hidden(can, zone._target)
}} }), target)
can.sup.onexport.link = function(can) { var meta = can.Conf(), args = can.Option()
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.path = path.join(ice.FS), args.topic = chat.BLACK
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.topic = chat.BLACK
return can.misc.MergePodCmd(can, args, true)
}
},
@ -469,8 +469,8 @@ Volcanos(chat.ONKEYMAP, {
}, _engine: {},
})
Volcanos(chat.ONEXPORT, {
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
text: function(can, line) { return can.core.Value(can.page.Select(can, line, "td.text")[0], "innerText") },
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
})
Volcanos(chat.ONPLUGIN, {
"code.vimer.keymap": shy("按键", {}, ["mode", "key", ice.LIST, ice.BACK], function(can, msg, cmds) {