diff --git a/frame.js b/frame.js index cd1f098f..6bfb18bd 100644 --- a/frame.js +++ b/frame.js @@ -267,6 +267,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (sub.onimport && can.base.isArray(sub.onimport.list) && sub.onimport.list.length > 0) { can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) }) } + can.page.ClassList.del(can, sub._fields, "form") sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): [] sub._output.className = html.OUTPUT, can.onappend.style(can, sub._args.style, can._output) can.page.style(can, can._output, html.HEIGHT, can._output.offsetHeight) @@ -490,7 +491,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (can.base.endWith(style, ".css")) { return can.require([style]) } can.base.isObject(style) && !can.base.isArray(style)? can.page.style(can, target, style): can.page.ClassList.add(can, target, style) }, - scroll: function(can, target, offset, length) { + scroll: function(can, target, offset, length) { if (!can.user.isChrome) { return } if (offset) { var ui = can.page.Append(can, target, [{view: "scrollbar", style: {height: length*target.offsetHeight*2}}]) target.addEventListener("scroll", function(event) { can.page.style(can, ui.scrollbar, html.TOP, target.scrollTop+offset*target.offsetHeight, html.RIGHT, -target.scrollLeft) }) return ui.scrollbar @@ -553,6 +554,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { can.onmotion.hidden(can, target) can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) item.layout = function(height, width) { sub.onimport.size(sub, height, width) } + can.onmotion.select(can, sub._target.parentNode, html.FIELDSET, sub._target) sub.onexport._output = function() { can.onmotion.toggle(can, target, true) } }, target, ui[item._index] = can.onappend.field(can, item.type, {index: item.index, name: item.index.split(nfs.PT).pop(), help: item.help}, target)._target) } else { can.page.Append(can, target, [item]) } diff --git a/index.css b/index.css index 69278232..d132fddc 100644 --- a/index.css +++ b/index.css @@ -111,8 +111,8 @@ table.content td { padding:var(--table-padding); } table.content td input.icons { display:none; } table.content td i:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; } table.content td i { padding:var(--input-padding); font-size:20px; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.plug):not(.float):not(.full):not(.cmd)>div.output>table.content td input.icons { display:unset; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.plug):not(.float):not(.full):not(.cmd)>div.output>table.content td i { display:none; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.plug):not(.float):not(.full):not(.cmd)>div.output>table.content td input.icons { display:unset; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.plug):not(.float):not(.full):not(.cmd)>div.output>table.content td i { display:none; } table.content.checkbox th:first-child { text-align:center; padding:var(--table-padding); position:sticky; left:2px; z-index:1; } table.content.checkbox td:first-child { background-color:var(--th-bg-color); text-align:center; position:sticky; left:2px; } table.content.detail td:first-child { width:var(--input-width); } @@ -280,7 +280,7 @@ div.item.text { position:relative; } div.item.text>input { width:var(--input-width); height:var(--action-height); } div.item.text.id>input { width:var(--button-width); } div.item.text.url>input { width:var(--river-width); } -div.item.text.path>input { width:var(--project-width); } +fieldset.Action:not(.horizon):not(.grid) div.item.text.path>input { width:var(--project-width); } fieldset.story>form.option>div.item.text.path>input { width:var(--input-width); } div.item.text.line>input { width:var(--button-width) !important; } div.item.text.limit>input { width:var(--button-width); } @@ -305,15 +305,16 @@ fieldset.plugin>legend { font-style:italic; } fieldset.plugin>form.option>div.button.icons>input { display:none; } fieldset.plugin>div.action>div.button.icons>input { display:none; } /* fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; } */ -fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; } +fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; } fieldset.Action.tabview fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon.delete { display:none; } fieldset.Action.grid fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon.delete { display:none; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>input { display:unset; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>span.icon { display:none; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>i { display:none; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>input { display:unset; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>span.icon { display:none; } -body:not(.mobile) fieldset.Action:not(.tabview):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>i { display:none; } +fieldset.Action.horizon fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon.delete { display:none; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>input { display:unset; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>span.icon { display:none; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>i { display:none; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>input { display:unset; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>span.icon { display:none; } +body:not(.mobile) fieldset.Action:not(.tabview):not(.horizon):not(.grid) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>i { display:none; } fieldset.panel>div.action>div.button.icons>span.icon { display:none; } fieldset.plugin.cmd>form.option>div.icon.delete { display:none; } fieldset.story>form.option>div.button.icons>input { display:none; } @@ -634,6 +635,7 @@ fieldset.word>div.output>fieldset.story:not(.full) { margin:var(--title-margin) fieldset.word>div.output fieldset.story:not(.float):not(.full)>form.option>div.icon.delete { display:none; } fieldset.input.icon div.output td { font-size:28px; padding:var(--input-padding); } fieldset.status>div.output table.content { width:100%; } +fieldset.web.stats>div.output { align-items: normal; } fieldset.web.code.git>div.output>fieldset.web.code.inner>div.output { overflow:auto; } fieldset.web.code.git.total.draw div.output { text-align:center; } fieldset.web.code.git.trend>div.output rect { cursor:pointer; } @@ -681,7 +683,7 @@ body.white fieldset.inner.cmd>div.output>div.layout>div.tabs div:not(.select):no body.mobile fieldset.inner>form.option input[name=file] { width:160px; } body.mobile fieldset.word>form.option>div.item>input[name=path] { width:180px; } body.mobile fieldset.word fieldset.inner>form.option input[type=text] { display:none; } -body.mobile fieldset.Action>div.output>fieldset.plugin:not(.output):not(.float):not(.full):not(.cmd) { margin:20px 0; } +body.mobile fieldset.Action>div.output>fieldset.plugin:not(.output):not(.float):not(.full):not(.cmd):not(:first-child) { margin:20px 0; } body.windows fieldset.inner>div.output { overflow:hidden; } body.windows fieldset.inner>div.output>div.layout>div.layout>div.profile { overflow:hidden; } /* scrollbar */ diff --git a/panel/action.css b/panel/action.css index 7a5c26d6..1594a1df 100644 --- a/panel/action.css +++ b/panel/action.css @@ -6,7 +6,7 @@ fieldset.Action.tabs>div.action { display:block; } fieldset.Action.tabs>div.output>fieldset>legend { display:none; } fieldset.Action.tabs>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Header div.Action { display:contents; } -fieldset.Action.tabview>div.output>fieldset.plugin>legend { display:none; } +fieldset.Action.tabview:not(.cmd)>div.output>fieldset.plugin>legend { display:none; } fieldset.Action.tabview>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Action.vertical>div.output>fieldset.plugin { float:left; } fieldset.Action.horizon>div.output>fieldset.plugin { float:left; } @@ -16,15 +16,12 @@ fieldset.Action.free>div.output>fieldset.plugin { position:absolute; } fieldset.Action.free>div.output>fieldset.plugin.select { z-index:10; } fieldset.Action.free>div.output { overflow:hidden; } fieldset.Action.grid>div.output>fieldset.plugin { float:left; } -/* fieldset.Action.grid>div.output>fieldset.plugin>form.option { display:none; } */ -/* fieldset.Action.grid>div.output>fieldset.plugin>div.action { display:none; } */ fieldset.Action.grid>div.output>fieldset.plugin>div.status { display:none; } -/* fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { width:var(--button-width); } */ -fieldset.Action>div.toggle.project { padding-top:50px; height:150px; top:30%; } -body:not(.mobile) fieldset.Action>div.project.toggle { display:none; } fieldset.Action.tabview>div.project.toggle { display:none; } fieldset.Action.vertical>div.project.toggle { display:none; } fieldset.Action.horizon>div.project.toggle { display:none; } fieldset.Action.free>div.project.toggle { display:none; } fieldset.Action.grid>div.project.toggle { display:none; } +fieldset.Action>div.toggle.project { padding-top:50px; height:150px; top:30%; } +body:not(.mobile) fieldset.Action>div.project.toggle { display:none; } body.mobile fieldset.Action>div.project.toggle { top:60%; } diff --git a/panel/action.js b/panel/action.js index f308a806..c32731c6 100644 --- a/panel/action.js +++ b/panel/action.js @@ -1,30 +1,27 @@ -(function() { const TABS = "tabs", TABVIEW = "tabview", HORIZON = "horizon", VERTICAL = "vertical", GRID = "grid", FREE = "free", FLOW = "flow", PAGE = "page", CAN_LAYOUT = "can.layout" +(function() { const ALL = "all", TABS = "tabs", TABVIEW = "tabview", VERTICAL = "vertical", HORIZON = "horizon", GRID = "grid", FREE = "free", FLOW = "flow", PAGE = "page", CAN_LAYOUT = "can.layout" 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, index) { 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.Conf(html.MARGIN_Y) } - can.onappend.plugin(can, item, function(sub, meta, skip) { can.user.isChrome && (can.ondaemon._list[sub._daemon = can.core.Keys(river, storm, index)] = sub) - 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}), - (can.base.beginWith(meta.index, "can.")? []: [river, storm, meta.id||meta.index]).concat(cmds), cb) } + if (msg.Length() == 1) { item.height = can.ConfHeight()-can.Conf(html.MARGIN_Y) } list.length == 0 && item.index == "web.dream" && (list = [river, storm, item.index]) + can.onappend.plugin(can, item, function(sub, meta, skip) { sub.onexport.output = function() { can.page.style(can, sub._output, html.MAX_HEIGHT, "") } + 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}), (can.base.beginWith(meta.index, "can.")? []: [river, storm, meta.id||meta.index]).concat(cmds), cb) } + can.user.isChrome && (can.ondaemon._list[sub._daemon = can.core.Keys(river, storm, index)] = sub) + can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next() }) - }, function() { if (can.isCmdMode()) { return } can.user.mod.isCmd = false, can.page.ClassList.del(can, document.body, "cmd") - can.onmotion.delay(can, function() { - can.onaction.layout(can, list[3]), can.onappend.scroll(can, can._output), can.page.style(can, can._output, "visibility", "visible") - can.onexport.layout(can) && list[0] == river && list[1] == storm && can.core.List(can._plugins, function(sub) { - sub.Conf(ctx.INDEX) == list[2] && can.onmotion.delay(can, function() { sub._tabs.click() }, 0) - }) - }, 0) + }, function() { if (can.isCmdMode()) { return } can.user.mod.isCmd = false, can.page.ClassList.del(can, document.body, ice.CMD) + can.onaction.layout(can, list[3]); if (can.user.isMobile) { return } + var _select = can._plugins[0]; can.onexport.layout(can) && list[0] == river && list[1] == storm && can.core.List(can._plugins, function(sub) { + sub.Conf(ctx.INDEX) == list[2] && (_select = sub) + }) , _select._tabs.click() }) }, _tabs: function(can, sub, meta) { - var tabs = [{view: [html.ITEM, "", can.user.trans(can, meta.name, meta.help)], title: meta.help, onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs) - can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) - var layout = can.onexport.layout(can); - if (sub._delay_refresh || layout == "tabview") { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) } - layout == FREE || (can._output.scrollTop = sub._target.offsetTop-10) + var tabs = [{view: [html.ITEM, "", can.user.trans(can, meta.name, meta.help)], title: meta.help, onclick: function(event) { can._current = sub + can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target), can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs), can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs) + var layout = can.onexport.layout(can); layout == FREE || (can._output.scrollTop = sub._target.offsetTop-10) + if (sub._delay_refresh || layout == TABVIEW) { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) } can.misc.SearchHash(can, can.Conf(chat.RIVER), can.Conf(chat.STORM), meta.index, layout) }, oncontextmenu: sub._legend.onclick}]; sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target }, @@ -36,10 +33,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R Volcanos(chat.ONACTION, {_init: function(can, target) { can.Conf(html.MARGIN_Y, 2*html.PLUGIN_PADDING+2*html.PLUGIN_MARGIN+html.ACTION_HEIGHT) can.Conf(html.MARGIN_X, 2*html.PLUGIN_PADDING+2*html.PLUGIN_MARGIN) - can.onaction.layout(can) can.core.List(["ontouchstart", "ontouchmove", "ontouchend"], function(item) { can.onengine.listen(can, item, function(event, msg) { can.onaction[item](event, can), can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }, target) - }) + }), can.onaction.layout(can) }, onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height, 240), width: width}) }, onlogin: function(can, msg) { @@ -62,12 +58,21 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { 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) { - if (msg.Length() == 1) { can.onaction._onaction_cmd(can) } can.onimport._init(can, msg) }) + if (msg.Length() == 1) { can.onaction._onaction_cmd(can) } can.onimport._init(can, msg) + }) }, onstorm_select: function(can, msg, river, storm) { - if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins}), can._plugins = [] - return load(can.core.Keys(can.Conf(chat.RIVER, river), can.Conf(chat.STORM, storm)), function(bak) { can._plugins = bak.plugins }) - }, can._output, can._action, can._header_tabs)) { if (msg.Option("refresh") != ice.TRUE) { return can.onaction.layout(can) } } + if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins, current: can._current}), can._plugins = [] + return load(can.core.Keys(can.Conf(chat.RIVER, river), can.Conf(chat.STORM, storm)), function(bak) { can._plugins = bak.plugins, can._current = bak.current }) + }, can._output, can._action, can._header_tabs)) { + if (msg.Option(web.REFRESH) != ice.TRUE) { + can._current._tabs.click() + can.onmotion.delay(can, function() { + can.onaction.layout(can) + }) + return + } + } can.run(can.request({}, {_method: http.GET}), [river, storm], function(msg) { if (msg.Length() == 0) { return can.user.isLocalFile? can.user.toastFailure(can, "miss data"): can.onengine.signal(can, chat.ONACTION_NOTOOL, can.request({}, {river: river, storm: storm})) } return can.onimport._init(can, msg) @@ -82,9 +87,6 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { can._keylist = can.onkeymap._parse(msg._event, can, model, can._keylist||[], can._output) }, onresize: function(can) { can.onaction.layout(can) }, - ontitle: function(can, msg) { - // can.onlayout._storage(can, "") - }, ontouchstart: function(event, can) { can.touch = can.touch || {}, can.touch.isStart = true, can.touch.startX = event.touches[0].clientX }, ontouchmove: function(event, can) { can.touch.isMove = true, can.touch.distanceX = event.touches[0].clientX - can.touch.startX }, @@ -94,20 +96,19 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { } can.touch.isMove = false, can.touch.distanceX = 0, can.touch.isStart = false, can.touch.startX = 0 }, - mail: function(can) { can.user.opens("/chat/pod/20230511-golang-story/cmd/web.chat.mail.client") }, dream: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.DREAM})) }, - cloud: function(can) { can.user.opens("https://cloud.shylinux.com/") }, portal: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.PORTAL})) }, desktop: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.DESKTOP})) }, - layout: function(can, button, skip) { var before = can._layout||can.onlayout._storage(can) + layout: function(can, button, skip) { var before = can._layout||can.onlayout._storage(can); button = button||before||(can.user.isMobile? ALL: TABVIEW) + var list = can.misc.SearchHash(can); list.length > 2 && (list[3] = button); can.misc.SearchHash(can, list[0], list[1], list[2], list[3]) can.page.ClassList.del(can, can._target, before), can._header_tabs && can.onmotion.hidden(can, can._header_tabs) - button = (can.onlayout._storage(can, can._layout = button == ice.AUTO? "": button))||can.misc.SearchOrConf(can, html.LAYOUT), can.page.ClassList.add(can, can._target, button) + button = (can.onlayout._storage(can, can._layout = button))||can.misc.SearchOrConf(can, html.LAYOUT), can.page.ClassList.add(can, can._target, button) can.onengine.signal(can, chat.ONLAYOUT, can.request({}, {layout: button, before: before})), can._root.River && can._river_show === false && can.onmotion.hidden(can, can._root.River._target), skip || can.onlayout._init(can) can.isCmdMode() || can.core.List(can._plugins, function(sub) { sub._delay_refresh = false }) var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can) || can.onlayout._plugin(can, button) }, - _menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], web.DREAM, web.DESKTOP, web.PORTAL], - _trans: kit.Dict(web.DREAM, "空间", web.DESKTOP, "桌面", web.PORTAL, "官网", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"), + _menus: [[html.LAYOUT, ALL, TABS, TABVIEW, VERTICAL, HORIZON, GRID, FREE, FLOW, PAGE], web.DREAM, web.DESKTOP, web.PORTAL], + _trans: kit.Dict(web.DREAM, "空间", web.DESKTOP, "桌面", web.PORTAL, "官网", html.LAYOUT, "布局", ALL, "详情布局", TABS, "标签布局", TABVIEW, "标签分屏", VERTICAL, "上下分屏", HORIZON, "左右分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"), }) Volcanos(chat.ONLAYOUT, { tabs: function(can) { @@ -117,8 +118,8 @@ Volcanos(chat.ONLAYOUT, { }, tabview: function(can) { can.onmotion.toggle(can, can._header_tabs, true) can.getActionSize(function(height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) }) - can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }) - can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return true + // can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }) + // can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return true }, horizon: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }) }, vertical: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }) }, @@ -131,7 +132,7 @@ Volcanos(chat.ONLAYOUT, { _plugin: function(can, button) { can.core.List(can._plugins, function(sub) { if (can.page.ClassList.has(can, sub._target, html.OUTPUT)) { return sub.onimport.size(sub, can.ConfHeight()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, true) } if (can._plugins.length == 1) { return sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), false) } - sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button || sub.isCmdMode()? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "") + sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button && button != ALL || sub.isCmdMode()? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "") }) }, _storage: function(can, value) { return can.misc.sessionStorage(can, can.core.Keys(CAN_LAYOUT, location.pathname), value) }, }) @@ -142,7 +143,7 @@ Volcanos(chat.ONEXPORT, { msg.Option(html.MARGIN_Y, can.Conf(html.MARGIN_Y)), msg.Option(html.MARGIN_X, can.Conf(html.MARGIN_X)) }, layout: function(can) { return can._layout||can.onlayout._storage(can)||can.misc.SearchOrConf(can, html.LAYOUT)||"" }, - isauto: function(can) { return ["", FLOW, PAGE].indexOf(can.onexport.layout(can)) > -1 }, + isauto: function(can) { return ["", ALL, FLOW, PAGE].indexOf(can.onexport.layout(can)) > -1 }, args: function(can, msg, cb) { can.core.Next(can._plugins, function(sub, next, index, list) { cb(can.base.trim(can.page.SelectArgs(can, sub._option, "", function(item) { return item.value })), sub, next, index, list) }) }, @@ -161,7 +162,7 @@ Volcanos(chat.ONENGINE, {_engine: function(event, sup, msg, can, cmds, cb) { if (typeof item == code.FUNCTION) { item = item(can) } if (item) { return item.index||item } })), function(msg) { - can.core.List(storm.index, function(item) { + can.core.List(storm.index, function(item) { if (!item || typeof item == code.FUNCTION) { return } msg.Push(ctx.ARGS, JSON.stringify(item.args||[])).Push(ctx.STYLE, item.style||"").Push(ctx.DISPLAY, item.display||"") msg.Push(web.SPACE, item.space||"") msg.Push("_ismain", ice.TRUE) @@ -169,7 +170,8 @@ Volcanos(chat.ONENGINE, {_engine: function(event, sup, msg, can, cmds, cb) { }) } else { can.core.List(storm.list, function(item) { can.base.isString(item) && (item = {index: item}) msg.Push(ctx.INDEX, item.index||"") - msg.Push(mdb.NAME, item.name||"").Push(mdb.HELP, item.help||"").Push(ctx.INPUTS, JSON.stringify(item.inputs)).Push(ctx.FEATURE, JSON.stringify(item.feature)) + msg.Push(mdb.NAME, item.name||"").Push(mdb.HELP, item.help||"") + msg.Push(ctx.INPUTS, JSON.stringify(item.inputs)).Push(ctx.FEATURE, JSON.stringify(item.feature)) msg.Push(ctx.ARGS, item.args||"[]").Push(ctx.STYLE, item.style||"").Push(ctx.DISPLAY, item.display||"") msg.Push(web.SPACE, item.space||"") msg.Push("_ismain", ice.TRUE) @@ -189,25 +191,23 @@ Volcanos(chat.ONKEYMAP, { f: function(event, can, target) { can.onengine.signal(can, chat.ONOPENSEARCH, can.request({}, {type: mdb.FOREACH})) }, }, normal: { - j: function(event, can, target) { target.scrollBy(0, event.ctrlKey? 300: 30) }, - k: function(event, can, target) { target.scrollBy(0, event.ctrlKey? -300: -30) }, - r: function(event, can, target) { can.user.reload(true) }, - t: function(event, can) { can.onkeymap.toggleLayout(can, TABVIEW) }, - h: function(event, can) { can.onkeymap.toggleLayout(can, HORIZON) }, - v: function(event, can) { can.onkeymap.toggleLayout(can, VERTICAL) }, - g: function(event, can) { can.onkeymap.toggleLayout(can, GRID) }, - f: function(event, can) { can.onkeymap.toggleLayout(can, FREE) }, - b: function(event, can) { can.onkeymap.toggleTheme(can, cli.BLACK) }, - w: function(event, can) { can.onkeymap.toggleTheme(can, cli.WHITE) }, - l: function(event, can) { can.onkeymap.toggleTheme(can, html.LIGHT) }, - d: function(event, can) { can.onkeymap.toggleTheme(can, html.DARK) }, - c: function(event, can) { can.user.toimage(can, can.user.title(), can._target.parentNode, true) }, + // j: function(event, can, target) { target.scrollBy(0, event.ctrlKey? 300: 30) }, + // k: function(event, can, target) { target.scrollBy(0, event.ctrlKey? -300: -30) }, + // r: function(event, can, target) { can.user.reload(true) }, + // t: function(event, can) { can.onkeymap.toggleLayout(can, TABVIEW) }, + // h: function(event, can) { can.onkeymap.toggleLayout(can, HORIZON) }, + // v: function(event, can) { can.onkeymap.toggleLayout(can, VERTICAL) }, + // g: function(event, can) { can.onkeymap.toggleLayout(can, GRID) }, + // f: function(event, can) { can.onkeymap.toggleLayout(can, FREE) }, + // b: function(event, can) { can.onkeymap.toggleTheme(can, cli.BLACK) }, + // w: function(event, can) { can.onkeymap.toggleTheme(can, cli.WHITE) }, + // l: function(event, can) { can.onkeymap.toggleTheme(can, html.LIGHT) }, + // d: function(event, can) { can.onkeymap.toggleTheme(can, html.DARK) }, + // c: function(event, can) { can.user.toimage(can, can.user.title(), can._target.parentNode, true) }, ":": function(event, can) { can.onengine.signal(can, chat.ONCOMMAND_FOCUS), can.onkeymap.prevent(event) }, " ": function(event, can) { can.onengine.signal(can, chat.ONSEARCH_FOCUS), can.onkeymap.prevent(event) }, Enter: function(event, can) { can.onengine.signal(can, chat.ONOPENSEARCH, can.request(event)) }, - Escape: function(event, can) { - can.onmotion.clearFloat(can) || can._root.Search && can.onmotion.hidden(can, can._root.Search._target) - }, + Escape: function(event, can) { can.onmotion.clearFloat(can) || can._root.Search && can.onmotion.hidden(can, can._root.Search._target) }, }, }, _engine: {}, toggleTheme: function(can, theme) { can.setHeader(chat.THEME, can.getHeaderTheme() == theme? ice.AUTO: theme) }, diff --git a/panel/footer.js b/panel/footer.js index fa322a4b..5a4c9efa 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -1,9 +1,6 @@ (function() { var NTIP = "ntip", NLOG = "nlog", NCMD = "ncmd", NKEY = "nkey" Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { - if (!can.misc.isDebug(can)) { - can.onmotion.hidden(can) - return - } + if (!can.user.isMobile && !can.misc.isDebug(can)) { can.onmotion.hidden(can); return } can.Conf(nfs.VERSION, can.base.trimPrefix(window._version, "?_v=").split("&")[0]) can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) can.Conf(NKEY, can.core.Item(can.misc.localStorage(can)).length) diff --git a/panel/header.css b/panel/header.css index 217e00f4..89510c1f 100644 --- a/panel/header.css +++ b/panel/header.css @@ -25,8 +25,9 @@ fieldset.Header>div.output div.search>input { padding-left:25px; } fieldset.Header>div.output div.search>span.icon { padding:var(--input-padding) var(--button-padding); } body:not(.mobile) fieldset.Header>div.output div.title:first-child { width:var(--river-width); } body:not(.mobile) fieldset.Header>div.output div.title img { margin-right:var(--button-margin); } +body:not(.mobile) fieldset.Header.tabview>div.output div.title:first-child { padding-left:var(--button-padding); width:unset; } body:not(.width6) fieldset.Header.tabview>div.output>div.Action>div.item.dream { display:none; } body:not(.width6) fieldset.Header.tabview>div.output>div.Action>div.item.desktop { display:none; } body:not(.width6) fieldset.Header.tabview>div.output>div.Action>div.item.portal { display:none; } body:not(.width6) fieldset.Header.tabview>div.output>div.item.language { display:none; } -/* body:not(.width6) fieldset.Header.tabview>div.output>div.item.qrcode { display:none; } */ +body.width2 fieldset.Header.tabview>div.output div.title:first-child span { display:none; } diff --git a/panel/header.js b/panel/header.js index 1f6d0d7b..65d10fa8 100644 --- a/panel/header.js +++ b/panel/header.js @@ -10,7 +10,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.core.CallFunc([can.onaction, item], [event, can, item]) }, _init: function(target) { item == mdb.TIME && can.onimport._time(can, target) item == aaa.AVATAR && can.page.Appends(can, target, [{img: lex.SP}]) - item == aaa.USERNICK && can.page.Appends(can, target, [{text: can.Conf(aaa.USERNICK)}, {icon: icon.CHEVRON_DOWN}]) + item == aaa.USERNICK && !can.user.isMobile && can.page.Appends(can, target, [{text: can.Conf(aaa.USERNICK)}, {icon: icon.CHEVRON_DOWN}]) item == aaa.LANGUAGE && can.page.Appends(can, target, [{text: "EN"}, {text: " / "}, {text: "中"}]) item == chat.THEME && can.page.Appends(can, target, [{icon: icon.SUN}, {text: " / "}, {icon: icon.MOON}]) item == cli.QRCODE && can.page.Appends(can, target, [{icon: icon.qrcode, title: can.user.trans(can, cli.QRCODE)}]) diff --git a/panel/river.css b/panel/river.css index 01d48c53..eaae2143 100644 --- a/panel/river.css +++ b/panel/river.css @@ -14,11 +14,17 @@ fieldset.River>div.toggle.prev { top:-10px; } fieldset.River>div.toggle.next { bottom:-50px; } fieldset.River>div.output div.item>i:first-child { margin-right:var(--button-margin); } fieldset.River.page { display:none; } -fieldset.River:not(.auto):not(.tabs):not(.page) { width:var(--header-height); } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.action { display:none; } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output div.item { padding:var(--button-padding); } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output div.item>span { display:none; } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output>div.item>i:last-child { display:none; } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output>div.item>i:first-child { font-size:24px; } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output div.item>i:first-child { margin-right:0; } -fieldset.River:not(.auto):not(.tabs):not(.page)>div.output>div.list { margin-left:var(--input-margin); } +fieldset.River:not(.all):not(.tabs):not(.page) { width:var(--header-height); } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action { flex-direction:column; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action div.item { margin-right:0; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action div.item.share { display:none; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action div.item.refresh { display:none; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action div.item>input { display:none; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.action div.item>span { display:unset; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output div.item { padding:var(--button-padding); } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output div.item>span { display:none; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output>div.item>i:last-child { display:none; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output>div.item>i:first-child { font-size:24px; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output div.item>i:first-child { margin-right:0; } +fieldset.River:not(.all):not(.tabs):not(.page)>div.output>div.list { margin-left:var(--input-margin); } +fieldset.River.tabview>div.action:not(.hide) { margin-top:calc(var(--plugin-margin) + var(--plugin-padding)); } diff --git a/panel/river.js b/panel/river.js index d777c0e5..5a1333f2 100644 --- a/panel/river.js +++ b/panel/river.js @@ -34,9 +34,7 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func onaction_touch: function(can, msg) { can.user.isMobile && can.onmotion.hidden(can) }, onaction_notool: function(can, msg, river, storm) { can.ondetail["addcmd"](msg._event, can, "addcmd", river, storm) }, onsearch: function(can, msg, arg) { if (arg[0] == chat.STORM) { can.onexport.storm(can, msg, arg) } }, - onlayout: function(can, layout, before) { if (can.user.isMobile) { return } - can.page.ClassList.del(can, can._target, before||"auto"), can.page.ClassList.add(can, can._target, layout||"auto") - }, + onlayout: function(can, layout, before) { can.page.ClassList.del(can, can._target, before), can.page.ClassList.add(can, can._target, layout) }, create: function(event, can) { can.user.input(can.request(event, {title: "创建群组"}), can, [ {name: mdb.TYPE, values: [aaa.TECH, aaa.VOID], _trans: "类型"}, {name: mdb.NAME, value: "hi", _trans: "群名", need: "must"}, diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index aab367c5..118ed9ab 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -20,7 +20,7 @@ fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs:hover { backgrou fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs.select { background-color:var(--output-bg-color); border-top-left-radius:var(--plugin-radius); border-top-right-radius:var(--plugin-radius); border-bottom:lightgray solid 2px; box-shadow:var(--box-shadow);} fieldset.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:none; } fieldset.inner.float>div.output>div.layout>div.path { font-size:var(--code-font-size); display:flex; } -fieldset.Action.tabview fieldset.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:flex; } +fieldset.Action.tabview fieldset.plugin.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:flex; } fieldset.inner>div.output>div.layout>div.display h1 { border-bottom:var(--box-border); margin:var(--title-margin) 0; } fieldset.inner>div.output>div.layout>div.display h2 { border-bottom:var(--box-border); margin:var(--title-margin) 0; } fieldset.inner>div.output>div.layout>div.display pre>code { padding-left:var(--table-padding); border-left:var(--code-border-color) solid 5px; display:block; } diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 0b606c8f..3f2f8714 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -43,7 +43,10 @@ Volcanos(chat.ONFIGURE, { }); cache = can.onimport.tree(can, list, nfs.PATH, nfs.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target, cache) }, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action) can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { - show(target, zone, path), zone._toggle = function() { zone._layout() } + show(target, zone, path), zone._toggle = function() { + can.ui.zone.source && can.ui.zone.source._layout() + zone._layout() + } }) }), target) }, space: function(can, target, zone) { can.onimport._zone(can, zone, web.DREAM, function(sub, msg) { diff --git a/plugin/state.js b/plugin/state.js index c03af678..0bf0a8cb 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -268,7 +268,9 @@ Volcanos(chat.ONEXPORT, { output: function(can, msg) {}, action: function(can, button, data) {}, record: function(can, value, key, data) {}, title: function(can, title) { can.isCmdMode() && can.user.title(title) }, marginTop: function() { return 0 }, marginBottom: function() { return 0 }, - actionHeight: function(can) { return can.page.ClassList.has(can, can._target, html.OUTPUT)? 0: html.ACTION_HEIGHT }, + actionHeight: function(can) { + return (can._option.childElementCount == 1 && can._action.childElementCount == 0 || can.page.ClassList.has(can, can._target, html.OUTPUT))? 0: html.ACTION_HEIGHT + }, outputHeight: function(can) { var height = can.ConfHeight() - can.onexport.outputMargin(can) if (can.user.isMobile) { return can.ConfHeight() - can.onexport.actionHeight(can) - can.onexport.statusHeight(can) } diff --git a/plugin/table.js b/plugin/table.js index 4b5ee8c3..076df573 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -239,7 +239,7 @@ Volcanos(chat.ONEXPORT, { }, board: function(can) { var msg = can._msg; return msg.Result() }, session: function(can, key, value) { return can.misc[can.user.isWebview? "localStorage": "sessionStorage"](can, [can.Conf(ctx.INDEX), key, location.pathname].join(":"), value == ""? "": JSON.stringify(value)) }, - action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key)? def: value }, + action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key, undefined)? def: value }, tool: function(can) { can.misc.sessionStorage(can, [can.ConfIndex(), "tool"], JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) }, tabs: function(can) {}, })