1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00

opt desktop

This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-12-26 11:43:38 +08:00
parent e2c60c41b1
commit d900548b10
5 changed files with 17 additions and 12 deletions

View File

@ -203,11 +203,10 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
can.run(event, button == mdb.LIST? []: [ctx.ACTION, button].concat(_can.Input()))
}) }
var list = can.page.inputs(can, can.base.getValid(can.base.Obj(list), can.core.Value(can, [chat.ONACTION, mdb.LIST]), meta != can.onaction? can.core.Item(meta): [])||[])
limit = limit||html.ACTION_BUTTON; if (list.length >= limit) { var rest = list.slice(limit-1); list = list.slice(0, limit-1), list.push({type: html.BUTTON, name: "more", onclick: function(event) {
can.user.carte(event, can, {_trans: meta._trans||can._trans}, can.core.List(rest, function(item) { return item.name }), function(event, button) {
run(event, button)
})
}}) }
limit = limit||html.ACTION_BUTTON; if (list.length > limit) {
var rest = list.slice(limit-1); list = list.slice(0, limit-1), list.push({type: html.BUTTON, name: "more", onclick: function(event) {
can.user.carte(event, can, {_trans: meta._trans||can._trans}, can.core.List(rest, function(item) { return item.name }), function(event, button) { run(event, button) })
}}) }
return can.core.List(list, function(item) {
can.base.isUndefined(item) || can.onappend.input(can, item == ""? /* 1.空白 */ {type: html.BR}:
can.base.isString(item)? /* 2.按键 */ {type: html.BUTTON, name: item, value: can.user.trans(can, item, meta._trans), onclick: function(event) {

View File

@ -2,7 +2,9 @@
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM), list = can.misc.SearchHash(can)
can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next) { item.type = chat.PLUGIN, item.mode = can.Mode(); if (item.deleted == ice.TRUE) { return next() }
item.width = can.ConfWidth()-can.Conf(html.MARGIN_X); if (item.style == html.OUTPUT) { item.width = can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING }
if (msg.Length() == 1) { item.height = can.ConfHeight()-(can.user.isMobile? 2: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y) }
if (msg.Length() == 1) {
item.height = can.ConfHeight()-(can.user.isMobile? 1: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y)
}
can.onappend.plugin(can, item, function(sub, meta, skip) { can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next()
sub.onaction._close = function() { can.onengine.signal(can, chat.ONACTION_REMOVE, can.request({river: river, storm: storm}, item)), can.page.Remove(can, sub._target) }
sub.run = function(event, cmds, cb) { return can.run(can.request(event, {pod: meta.space||meta.pod}), [river, storm, meta.id||meta.index].concat(cmds), cb) }
@ -53,7 +55,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
if (list.length == 1) { can.user.mod.cmd = item.index
can.base.isIn(item.index, web.CHAT_MACOS_DESKTOP) || can.user.title(item.index)
can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can)
can.user.mod.isCmd && can.user.isMobile && (can.ConfHeight(can.ConfHeight()-html.ACTION_HEIGHT))
// can.user.mod.isCmd && can.user.isMobile && (can.ConfHeight(can.ConfHeight()-html.ACTION_HEIGHT))
can.onappend.style(can, ice.CMD, document.body), can.onappend.style(can, item.index, document.body)
} return item
}), FLOW).layout(can.page.height(), can.page.width()): can.runAction(can.request(), ctx.COMMAND, [], function(msg) {

View File

@ -44,11 +44,13 @@ fieldset.inner.cmd>div.output>div.layout>div.path>span { padding:var(--input-pad
fieldset.inner.cmd>div.output>div.layout>div.path>span:hover { background-color:var(--hover-bg-color); }
fieldset.inner.cmd>div.output>div.layout>div.path span.func { padding:var(--input-padding); margin-left:80px; }
fieldset.inner.cmd>div.output>div.layout>div.path span.mode { padding:var(--input-padding); margin-left:80px; }
body.mobile fieldset.inner.cmd>div.output>div.layout>div.path span.func { display:none; }
body.mobile fieldset.inner.cmd>div.output>div.layout>div.path span.mode { display:none; }
fieldset.inner.cmd>div.output>div.layout>div.path span.space { flex-grow:1; }
fieldset.inner.cmd>div.output>div.layout>div.path span.view { font-size:22px; padding:0 var(--input-padding); margin-top:-5px; float:right; }
fieldset.inner.cmd>div.output>div.layout>fieldset.plug { bottom:var(--action-height); }
body:not(.mobile) fieldset.inner.cmd>div.output>div.layout>fieldset.plug { bottom:var(--action-height); }
fieldset.inner.cmd>div.output>div.layout>fieldset.plug.output { white-space:pre; }
fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); position:fixed; right:0; bottom:0; }
fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); position:fixed; right:0; bottom:0; overflow:auto; }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { font-size:var(--legend-font-size); font-style:italic; float:right; }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { padding:0 var(--input-padding); }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove { padding:var(--input-padding); }

View File

@ -541,7 +541,9 @@ Volcanos(chat.ONACTION, {
}, true) }}, ctx.ARGS], function(list) { show(list[0], list[1]) })
},
open: function(event, can, button) {
var input = can.user.input(can.request(event, {type: button}), can, [{name: nfs.FILE, style: {width: (can._output.offsetWidth-can.ui.project.offsetWidth)/2}, select: function(item) { input.submit(event, can, web.SUBMIT) }, run: function(event, cmds, cb) {
var left = can.ui.project.offsetWidth+(can._output.offsetWidth)/4-34, width = (can._output.offsetWidth-can.ui.project.offsetWidth)/2
if (can.user.isMobile) { left = 0, width = can.page.width()-40 }
var input = can.user.input(can.request(event, {type: button}), can, [{name: nfs.FILE, style: {width: width}, select: function(item) { input.submit(event, can, web.SUBMIT) }, run: function(event, cmds, cb) {
can.run(can.request(event, {paths: can.db.paths.join(mdb.FS)}), cmds, function(msg) { function push(type, name) { _msg.Push(nfs.PATH, can.core.List(arguments).join(nfs.DF)) }
if (cmds[0] == ctx.ACTION && cmds[1] == mdb.INPUTS) { var _msg = can.onengine.signal(can, "tabview.open.inputs"), func = can.onexport.func(can)
can.core.Item(can.db.tabview, function(key) { var ls = can.core.Split(key, nfs.DF); push(ls[0]+ls[1]) }), _msg.Copy(msg)
@ -558,7 +560,7 @@ Volcanos(chat.ONACTION, {
case cli.OPENS: return can.runAction(event, ls[0], ls[1], null, true)
default: var ls = can.onexport.split(can, list[0]); can.onimport.tabview(can, ls[0], ls[1])
} }); can.page.Modify(can, input._target, {className: "input vimer open float"})
can.page.style(can, input._target, html.LEFT, can.ui.project.offsetWidth+(can._output.offsetWidth)/4-34, html.TOP, can._output.offsetHeight/4, html.RIGHT, "")
can.page.style(can, input._target, html.LEFT, left, html.TOP, can._output.offsetHeight/4, html.RIGHT, "")
},
find: function(event, can) { var last = can.onexport.line(can, can.current.line)
var ui = can.page.Append(can, can._output, [{view: "input vimer find float", list: [html.ACTION, html.OUTPUT],

View File

@ -180,7 +180,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
can.core.Next(list.reverse(), function(meta, next) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
can.onimport.plug(can, meta, function(sub) {
sub.onexport.output = function() { can.page.style(can, sub._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
var height = can.base.Max(html.PLUG_HEIGHT, can._output.offsetHeight, 240), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-html.PROJECT_WIDTH)
var height = can.base.Max(html.PLUG_HEIGHT, can._output.offsetHeight, 240), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-(can.user.isMobile? 0: html.PROJECT_WIDTH))
// var height = can.base.Min(html.PLUG_HEIGHT, 240, can.ConfHeight()-html.ACTION_HEIGHT), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-html.PROJECT_WIDTH)
sub.onimport.size(sub, height, width, false), can.onmotion.delay(can, function() { sub.onimport.size(sub, height, width, false) })
}