diff --git a/const.js b/const.js index 23b34a31..b49f2e39 100644 --- a/const.js +++ b/const.js @@ -365,7 +365,11 @@ var icon = { open: "bi bi-box-arrow-up-right", main: "bi bi-box-arrow-up-right", portal: "bi bi-box-arrow-up-right", push: "bi bi-cloud-upload", pull: "bi bi-cloud-download", start: "bi bi-play-circle", stop: "bi bi-stop-circle", - trash: "bi bi-trash", remove: "bi bi-trash", + trash: "bi bi-trash", + remove: "bi bi-trash", + modify: "bi bi-pencil-square", + install: "bi bi-box-arrow-in-down", + sso: "bi bi-shield-check", record1: "bi bi-images", record2: "bi bi-record-circle", upload: "bi bi-box-arrow-in-up", download: "bi bi-box-arrow-down", "export": "bi bi-box-arrow-up", "import": "bi bi-box-arrow-in-down", diff --git a/frame.js b/frame.js index 6bfb18bd..84e92403 100644 --- a/frame.js +++ b/frame.js @@ -202,7 +202,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { var _can = can._fields? can.sup: can if (!can.page.tagis(_can._target, html.FIELDSET_PLUGIN)) { return } can.user.isMobile || meta._help && add({type: html.BUTTON, name: ice.HELP, onclick: function(event) { can.onappend._float(can, {index: web.WIKI_WORD}, [meta._help]) }}, function() {}) - can.base.isIn(can.ConfIndex(), web.CODE_VIMER) || can.user.isMobile || can.misc.Search(can, ice.MSG_DEBUG) == ice.TRUE && add({type: html.BUTTON, name: "vimer", _trans: "源码", onclick: function(event) { + !can.Conf("_fileline") || can.base.isIn(can.ConfIndex(), web.CODE_VIMER) || can.user.isMobile || can.misc.Search(can, ice.MSG_DEBUG) == ice.TRUE && add({type: html.BUTTON, name: "vimer", _trans: "源码", onclick: function(event) { var value = "查看源码"; _can.onaction[value](event, _can, value, _can.sub) }}, function() {}) }) @@ -231,16 +231,14 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (item.type == html.BUTTON && can.page.isIconInput(can, item.name)) { can.onappend.icons(can, target, item.name) } }), item), "", action) }) - if (list.length == 0 && can.Conf("inputs").length == 0) { return meta } - var _can = can._fields? can.sup: can + if (list.length == 0 && can.Conf("inputs").length == 0) { return meta } var _can = can._fields? can.sup: can can.user.isMobile || can.isCmdMode() || can.base.beginWith(can.ConfIndex(), "can.") || can.page.tagis(can._fields||can._target, html.FIELDSET_PANEL, html.FIELDSET_PLUG) || action == can._action && can.page.Append(can, action, - can.core.Item({full: "切换全屏", open: "打开链接", qrcode: "生成链接"}, function(key, value) { + can.core.Item({full: "切换全屏", qrcode: "生成链接", open: "打开链接"}, function(key, value) { return {view: [[html.ITEM, html.BUTTON, key, "icons"]], list: [{icon: icon[key]}], title: can.user.trans(can, key), onclick: function(event) { _can.onaction[value](event, _can, value, _can.sub) }} }) - ) - return meta + ); return meta }, _output0: function(can, meta, event, cmds, cb, silent) { var msg = can.request(event); meta.feature = meta.feature||{} if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION) { if (msg.RunAction(event, can.sub, cmds)) { return } } diff --git a/index.css b/index.css index d132fddc..b0636a0d 100644 --- a/index.css +++ b/index.css @@ -304,7 +304,7 @@ div.tabs:hover>span.icon { visibility:visible; } 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.tabview>div.output>fieldset.plugin>div.action>div.item.full { 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; } @@ -619,9 +619,9 @@ fieldset.draw>div.output>div.layout>div.layout>div.profile table { width:100%; } fieldset.draw>form.option>div.item.pid>input { width:var(--button-width) !important; } fieldset.draw.trends div.output { overflow:hidden; } fieldset.draw.trends div.output svg { background-color:#1b5b738c; } -fieldset.form>div.output>div.code { text-align:center; } +fieldset.form>div.output>div.code { display:flex; flex-direction:column; justify-content:center; align-items:center; } fieldset.form>div.output>div.code>div.info { font-size:20px; padding:40px 20px; overflow:auto; white-space:break-spaces; } -fieldset.form>div.output>div.code>input[type=button] { font-size:24px; border:var(--notice-bg-color) solid 1px; height:48px; width:240px; margin:40px; } +fieldset.form>div.output>div.code>input[type=button] { font-size:24px; border:var(--notice-bg-color) solid 1px; height:48px; width:240px; margin:20px; display:block; } fieldset>div.output.form { padding:20px; display:flex; flex-direction:column; align-items:center; justify-content:center; } fieldset>div.output.form>div.item { text-align:left; margin:10px; } fieldset>div.output.form>div.item>span { padding:var(--input-padding); } diff --git a/lib/user.js b/lib/user.js index 48b36d86..7e2bfb19 100644 --- a/lib/user.js +++ b/lib/user.js @@ -53,6 +53,7 @@ Volcanos("user", { }, close: function(url) { return window.close() }, theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || [] + can.user.info.userrole && name.push(can.user.info.userrole) can.user.language(can) && name.push(can.core.Split(can.user.language(can), "-")[0]) can.user.mod.isCmd && name.push(chat.CMD), can.user.mod.cmd && name.push(can.user.mod.cmd.replaceAll(".", " ")) can.user.isMobile && name.push(html.MOBILE) && can.user.isLandscape() && name.push(html.LANDSCAPE) diff --git a/panel/action.js b/panel/action.js index c32731c6..72cfcad4 100644 --- a/panel/action.js +++ b/panel/action.js @@ -12,17 +12,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R }) }, 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() + can.onexport.layout(can) && list[0] == river && list[1] == storm && can.core.List(can._plugins, function(sub) { sub.Conf(ctx.INDEX) == list[2] && (sub._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._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) + sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) }, 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 }, _menu: function(can, msg) { if (can.user.isMobile) { return } @@ -104,30 +102,24 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { 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))||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) + can.getActionSize(function(height, width) { var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can, height, width) || can.onlayout._plugin(can, button) }) }, _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) { - 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_ITEM)||0, function(target) { target.click() }); return true + tabs: function(can, height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) }, + tabview: function(can, height, width) { + can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width), can.onmotion.toggle(can, can._header_tabs, true) + can.page.SelectOne(can, can._header_tabs, html.DIV_ITEM_SELECT) || can.page.Select(can, can._header_tabs, html.DIV_ITEM, function(target, index) { index == 0 && target.click() }) }, - 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 + horizon: function(can, height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }, + vertical: function(can, height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }, + grid: function(can, height, width) { var m = can.user.isMobile? 1: 2, n = 2, h = height/n, w = width/m; can.ConfHeight(h+html.ACTION_HEIGHT), can.ConfWidth(w) }, + free: function(can, height, width) { can.ConfHeight(height*3/4), can.ConfWidth(width*3/4), can.onmotion.toggle(can, can._header_tabs, true) + can.core.List(can._plugins, function(sub, index, array) { can.onmotion.move(can, sub._target, {left: (width/array.length/8*5+20)*index, top: (height/array.length/8*5)*index}) }) }, - 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) }) }, - grid: function(can) { can.getActionSize(function(height, width) { var m = can.user.isMobile? 1: 2, n = 2, h = height/n, w = width/m; can.ConfHeight(h+html.ACTION_HEIGHT), can.ConfWidth(w) }) }, - free: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height*3/4), can.ConfWidth(width*3/4) - can.core.List(can._plugins, function(sub, index, array) { can.onmotion.move(can, sub._target, {left: (width/array.length/8*5+20)*index, top: (height/array.length/8*5)*index}) }), can.onmotion.toggle(can, can._header_tabs, true) - }) }, - flow: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }) }, + flow: function(can, height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }, page: function(can) { can.page.styleHeight(can, can._output, ""), can.page.style(can, document.body, kit.Dict(html.OVERFLOW, "")) }, _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) } diff --git a/panel/river.css b/panel/river.css index eaae2143..0be8d5af 100644 --- a/panel/river.css +++ b/panel/river.css @@ -28,3 +28,5 @@ fieldset.River:not(.all):not(.tabs):not(.page)>div.output>div.item>i:first-child 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)); } +fieldset.River.tabs>div.action:not(.hide) { margin-top:0; } +body.void fieldset.River>div.action { display:none; } diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 118ed9ab..cda1a602 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -1,3 +1,4 @@ +fieldset.inner>div.output { justify-content:flex-start; } fieldset.inner>div.output div.content td.text { height:var(--code-line-height); } fieldset.inner>div.output div.content td.text span.comment { color:var(--code-comment); } fieldset.inner>div.output div.content td.text span.keyword { color:var(--code-keyword); box-shadow:var(--box-shadow); }