1
0
forked from x/volcanos
This commit is contained in:
harveyshao 2022-07-11 08:41:05 +08:00
parent 72532d6239
commit bdc17cf8d1
2 changed files with 14 additions and 9 deletions

View File

@ -177,7 +177,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
},
profile: function(can, msg) {
var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2
msg && can.onimport.process(can, msg, can.ui.profile_output, width-32)
msg && can.onimport.process(can, msg, can.ui.profile_output, width)
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
},
display: function(can, msg) {
@ -198,16 +198,19 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target)
}
},
toolkit: function(can, meta, cb) {
toolkit: function(can, meta, cb) { meta.msg = true
meta.opts = meta.opts||{repos: can.base.trimSuffix(can.base.trimPrefix(can.Option(nfs.PATH), "usr/"), ice.PS) }
can.onimport.plugin(can, meta, can.ui.toolkit.output, function(sub) {
sub.ConfHeight(can.ConfHeight()-4*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth())
sub.page.style(sub, sub._output, html.MAX_HEIGHT, sub.ConfHeight())
sub.page.style(sub, sub._output, html.MAX_WIDTH, sub.ConfWidth())
sub.select = function() { return sub._legend.click(), sub }
sub.select = function() {
return sub._legend.click(), sub
}
sub.onaction.close = function() { sub.select() }
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
if (meta.msg == true) { meta.msg = false, sub.Update() }
if (can.page.Select(can, can._status, ice.PT+html.SELECT)[0] == event.target) {
can.page.ClassList.del(can, event.target, html.SELECT)
can.page.ClassList.del(can, sub._target, html.SELECT)
@ -256,8 +259,8 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
can.core.Next(sess.plug, function(item, next) { can.onimport.toolkit(can, {index: item}, function(sub) { can.toolkit[item] = sub, next() }) }, function() {
can.core.Next(sess.exts, function(item, next) { can.onimport.exts(can, item, next) }, function() {
var path = can.Option(nfs.PATH), file = can.Option(nfs.FILE), line = can.Option(nfs.LINE)
can.core.Next(sess.tabs, function(item, next) { var ls = item.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2], next) },
function() { can.onimport.tabview(can, path, file, line, cb) })
can.base.getValid(sess.tabs)? can.core.Next(sess.tabs, function(item, next) { var ls = item.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2], next) },
function() { can.onimport.tabview(can, path, file, line, cb) }): can.base.isFunc(cb) && cb()
})
})
},

View File

@ -93,13 +93,15 @@ Volcanos(chat.ONACTION, {help: "交互操作", list: [
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
if (can.page.ClassList.neg(can, can._target, "full")) { sub._height_bak = sub.ConfHeight(), sub._width_bak = sub.ConfWidth()
can._mode = can.Mode(), can.Mode("full"), sub.Mode("full")
if (can.page.ClassList.neg(can, can._target, "full")) {
var height = can._root._height-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT; can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
can._mode = can.Mode(), can._height_bak = sub.ConfHeight(), can._width_bak = sub.ConfWidth()
can.Mode("full"), can.ConfHeight(height), can.ConfWidth(can._root._width)
sub.Mode("full")
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(can._root._width))
} else {
can.Mode(can._mode), sub.Mode(can._mode)
sub.ConfHeight(sub._height_bak), sub.ConfWidth(sub._width_bak)
can.Mode(can._mode), can.ConfHeight(can._height_bak), can.ConfWidth(can._width_bak)
sub.Mode(can._mode), sub.ConfHeight(can._height_bak), sub.ConfWidth(can._width_bak)
can.page.style(can, can._output, html.HEIGHT, "", html.MIN_WIDTH, "")
}
can.core.CallFunc([sub, chat.ONIMPORT, html.LAYOUT], {can: sub})