diff --git a/const.js b/const.js index f59c020b..a2baca3f 100644 --- a/const.js +++ b/const.js @@ -20,7 +20,7 @@ var ice = { MODE: "mode", EXEC: "exec", APP: "app", CAN: "can", CAN_PLUGIN: "can._plugin", - DEV: "dev", POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg", + OPS: "ops", DEV: "dev", POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg", NFS: "nfs", USR: "usr", MSG_FIELDS: "fields", MSG_SESSID: "sessid", MSG_METHOD: "method", MSG_DEBUG: "debug", @@ -311,6 +311,7 @@ var html = {value: { PLUGIN_PADDING: 0, PLUGIN_MARGIN: 0, ACTION_BUTTON: 3, TABLE_BUTTON: 5, CODE_FONT_SIZE: 14, + QRCODE_WIDTH: 360, CARD_WIDTH: 320, CARD_HEIGHT: 160, PLUG_WIDTH: 800, PLUG_HEIGHT: 480, STORY_HEIGHT: 480, FLOAT_HEIGHT: 480, FLOAT_WIDTH: 1200, DESKTOP_WIDTH: 1200, DESKTOP_HEIGHT: 684, }, @@ -391,7 +392,7 @@ var icon = { xterm: "bi bi-terminal", cmds: "bi bi-terminal", desktop: "bi bi-window-desktop", admin: "bi bi-window-sidebar", dream: "bi bi-grid-3x3-gap", space: "bi bi-grid-3x3-gap", - config: "bi bi-gear", conf: "bi bi-gear", logs: "bi bi-calendar4-week", + configs: "bi bi-gear", config: "bi bi-gear", conf: "bi bi-gear", logs: "bi bi-calendar4-week", save: "bi bi-floppy", trash: "bi bi-trash", notifications: "bi bi-chat-right-text", diff --git a/frame.js b/frame.js index 49414f09..e1c7b784 100644 --- a/frame.js +++ b/frame.js @@ -243,6 +243,7 @@ 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 (!can.ConfIndex()) { return } var _can = can._fields? can.sup: can can.base.beginWith(can.ConfIndex(), "can.", "web.chat.macos.") || can.page.tagis(can._fields||can._target, html.FIELDSET_PANEL, html.FIELDSET_PLUG) || action == can._action && can.page.Append(can, action, @@ -253,9 +254,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { full: !can.isCmdMode() && "切换全屏", open: !can.isCmdMode() && "打开链接", qrcode: !can.isCmdMode() && "生成链接", - chat: "发送聊天", - help: can.page.ClassList.has(can, can._fields, html.PLUGIN) && can.Conf("_help") && can.Conf("_help") != "" && "查看文档", - vimer: can.page.ClassList.has(can, can._fields, html.PLUGIN) && can.Conf("_fileline") && can.misc.Search(can, ice.MSG_DEBUG) == ice.TRUE && "查看源码", + chat: can.misc.Search(can, ice.MSG_DEBUG) == ice.TRUE && "发送聊天", + help: can.page.ClassList.has(can, can._fields||can._target, html.PLUGIN) && can.Conf("_help") && can.Conf("_help") != "" && "查看文档", + vimer: can.page.ClassList.has(can, can._fields||can._target, html.PLUGIN) && can.Conf("_fileline") && can.misc.Search(can, ice.MSG_DEBUG) == ice.TRUE && "查看源码", }, function(key, value) { return (value || value === "") && {view: [[html.ITEM, html.BUTTON, key, mdb.ICONS, "state"]], list: [{icon: icon[key]}], title: can.user.trans(can, key), onclick: function(event) { var cb = _can.onaction[value]; cb && _can.onaction[value](event, _can, value, _can.sub) @@ -774,9 +775,12 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro return layout }, _float: function(can) { var target = can._fields||can._target, sup = can._fields? can.sup: can - can.onappend.style(can, html.FLOAT), can.onmotion.resize(can, target, function(height, width) { sup.onimport.size(sup, height, width, true) }, html.HEADER_HEIGHT, can.getRiverWidth()) + var height = can.base.Max(html.FLOAT_HEIGHT, can.page.height()-can.getHeaderHeight()-html.ACTION_HEIGHT), + width = can.base.Max(html.FLOAT_WIDTH, can.page.width()-can.getRiverWidth()) + sup.onimport.size(sup, height, width, false), can.onappend.style(can, html.FLOAT) + can.onmotion.resize(can, target, function(height, width) { sup.onimport.size(sup, height, width, false) }, can.getHeaderHeight(), can.getRiverWidth()) var left = can.getRiverWidth()+html.PLUGIN_MARGIN+html.PLUGIN_PADDING+(can.user.mod.isCmd? 0: 120), top = can.page.height()/4; if (can.user.isMobile) { left = 0 } - can.page.style(can, target, html.LEFT, left, html.TOP, top), sup.onimport.size(sup, can.base.Max(600, can.page.height()-top-html.ACTION_HEIGHT), can.base.Max(can.user.mod.isCmd? 1200: 1000, can.page.width()-left), true) + can.page.style(can, target, html.LEFT, can.page.width()-width-html.PLUGIN_MARGIN, html.TOP, can.page.height()-height-html.ACTION_HEIGHT-html.PLUGIN_MARGIN) target.onclick = function(event) { can.onkeymap.prevent(event) can.page.Select(can, document.body, "fieldset.float,div.float", function(target) { can.page.style(can, target, "z-index", 9) }), can.page.style(can, target, "z-index", 10) } @@ -882,9 +886,11 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) { index > 0 && can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(value.toLowerCase()) > -1) { return td } }) == 0) }) }, delayResize: function(can, target, key) { - can.page.Select(can, target, key, function(_target) { _target.onload = function() { var width = _target.offsetWidth+2*html.PLUGIN_PADDING - can.page.style(can, target, html.WIDTH, width, html.LEFT, (window.innerWidth-width)/2, html.TOP, (window.innerHeight-_target.offsetHeight)/4) - } }) + can.page.Select(can, target, key, function(_target) { + _target.onload = function() { var width = _target.offsetWidth+2*html.PLUGIN_PADDING+10 + can.page.style(can, target, html.WIDTH, width, html.LEFT, (window.innerWidth-width)/2, html.TOP, (window.innerHeight-_target.offsetHeight)/4) + } + }) }, delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) }, delayOnce: function(can, cb, interval, list) { diff --git a/index.css b/index.css index 48e5f516..53a2a63e 100644 --- a/index.css +++ b/index.css @@ -41,6 +41,7 @@ body { --code-border-color:var(--notice-bg-color); --plugin-radius:var(--plugin-padding); --button-radius:var(--input-padding); --box-shadow:var(--body-fg-color) 2px 2px 8px; + --notice-box-shadow:var(--notice-bg-color) 2px 2px 8px; --plugin-box-shadow:var(--box-shadow); --legend-box-shadow:var(--box-shadow); --input-box-shadow:var(--box-shadow); --th-box-shadow:var(--box-shadow); @@ -52,7 +53,8 @@ body { --header-height:48px; --footer-height:var(--action-height); --action-height:32px; --status-height:var(--action-height); --river-width:var(--project-width); --project-width:230px; --input-width:120px; --button-width:60px; --form-width:320px; - --textarea-height:96px; --qrcode-height:364px; --iframe-height:420px; + --url-input-width:320px; + --qrcode-height:364px; --qrcode-width:360px; --iframe-height:420px; --textarea-height:96px; --card-height:160px; --card-width:320px; --story-height:var(--float-height); --float-height:480px; --float-width:1200px; --plug-height:var(--float-height); --plug-width:var(--float-width); @@ -69,11 +71,13 @@ body { } body.mobile { --footer-height:60px; --qrcode-height:284px; --svg-font-size:13px; } body.width1 { /* 320-640 手机竖屏 */ + --url-input-width:160px; --river-width:280px; --project-width:120px; --input-width:80px; --river-margin:0; --plugin-margin:0; --button-margin:5px; - --table-button:2; + --table-button:2; } body.width2 { /* 640-960 手机横屏 平板竖屏 笔记本调试 */ + --url-input-width:160px; --input-width:80px; --table-button:3; } @@ -81,6 +85,7 @@ body.width3 { /* 960-1280 平板横屏 */ --table-button:3; } body.width4 { /* 1280-1600 笔记本 显示器调试 */ + --float-width:1000px; --table-button:4; } body.width5 { /* 1600-1920 */ @@ -88,7 +93,7 @@ body.width5 { /* 1600-1920 */ } body.width6 { /* 1920-2240 显示器 */ --river-width:280px; --input-width:180px; - --card-height:160px; + --card-height:160px; } /* element */ * { box-sizing:border-box; padding:0; border:0; margin:0; tab-size:4; } @@ -127,6 +132,7 @@ div.title>div.status { line-height:20px; } div.title>div.status>div.item { font-size:var(--status-font-size); font-weight:normal; margin-right:var(--button-margin); float:left; } div.title>div.status>div.item:not(:hover) { color:var(--disable-fg-color); } div.title>div.status>div.item>i { margin-right:var(--input-margin); } +fieldset.store>div.output>fieldset.story:not(.float) { display:none; } div.output.card>div.item { padding:var(--plugin-padding); margin:var(--plugin-padding); min-width:320px; position:relative; float:left; } div.output.card>div.item { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); } div.output.card>div.item:hover { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); } @@ -209,11 +215,11 @@ fieldset.input.float table.content th { padding:var(--input-padding); } fieldset.input.float table.content td { padding:var(--input-padding); } /* float */ body div.float { padding:var(--plugin-padding); } -body>div.toast div.title { color:var(--notice-bg-color); font-style:italic; white-space:pre; max-width:280px; overflow:auto; float:left; cursor:copy; } +body>div.toast div.title { color:var(--notice-bg-color); font-style:italic; white-space:pre; padding:0 var(--input-padding); max-width:300px; overflow:auto; float:left; cursor:copy; } body>div.toast div.delete { color:var(--notice-bg-color); float:right; cursor:pointer; } body>div.toast div.delete:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); } body>div.toast div.duration { color:var(--disable-fg-color); float:right; } -body>div.toast div.content { color:var(--notice-bg-color); white-space:normal; text-align:center; margin-bottom:5px; min-height:28px; display:block; } +body>div.toast div.content { color:var(--notice-bg-color); white-space:normal; text-align:center; padding:var(--input-padding); margin-bottom:var(--button-margin); min-height:28px; display:block; } body>div.toast div.progress { border:var(--box-notice); margin-left:0px; height:20px; clear:both; } body>div.toast div.progress div.current { background-color:var(--progress-bg-color); height:18px; } body>div.toast div.action:not(.hide) { width:100%; display:block; display:flex; flex-direction:row-reverse; gap:10px; } @@ -248,11 +254,11 @@ body>div.input td span.icon { margin-left:-20px; visibility:hidden; } body>div.input td span.icons { margin-left:-20px; visibility:hidden; } body>div.input td:hover span.icon { visibility:visible; } body>div.input td:hover span.icons { visibility:visible; } -body>div.input textarea { height:var(--textarea-height); width:var(--river-width) !important; } -body>div.input select { width:var(--river-width) !important; } -body>div.input input.select[type=button] { width:var(--river-width) !important; } -body>div.input input:not([type=button]) { width:var(--river-width) !important; } -body>div.input input[type=text] { width:var(--river-width) !important; } +body>div.input textarea { height:var(--textarea-height); width:var(--form-width) !important; } +body>div.input select { width:var(--form-width) !important; } +body>div.input input.select[type=button] { width:var(--form-width) !important; } +body>div.input input:not([type=button]) { width:var(--form-width) !important; } +body>div.input input[type=text] { width:var(--form-width) !important; } body>div.input input[name=cancel] { border:var(--danger-bg-color) solid 1px; } body>div.input input[name=submit] { border:var(--notice-bg-color) solid 1px; } body>div.input input[name=submit]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } @@ -274,7 +280,7 @@ body>div.input.login>div.display div.sso div.item:hover { background-color:var(- body>div.input.login>div.display div.sso div.item>img { height:var(--action-height); width:var(--action-height); } body>div.input.login>div.display div.sso div.item>span { line-height:var(--action-height); padding:var(--input-padding); } body>div.input.simple td:first-child { display:none; } -body>div.upload div.action input[type=file] { width:var(--river-width); } +body>div.upload div.action input[type=file] { width:var(--form-width); } body>div.upload div.output { border:var(--box-notice); } body>div.upload div.output div.progress { background-color:var(--progress-bg-color); height:10px; width:0; } body>div.upload div.status div.cost { float:left; } @@ -358,7 +364,7 @@ div.action div.tabs:hover { } div.action div.tabs.select { background-color:var(--output-bg-color); color:var(--hover-fg-color); - border-top-left-radius:var(--button-margin); border-top-right-radius:var(--button-margin); border-bottom:var(--hover-fg-color) solid 2px; + border-top-left-radius:var(--button-margin); border-top-right-radius:var(--button-margin); border-bottom:var(--hover-fg-color) solid 3px; } div.zone>div.item { background-color:var(--th-bg-color); } div.zone>div.list>div.zone>div.item { background-color:var(--th-bg-color); } @@ -367,10 +373,10 @@ div.tabs div:hover { background-color:var(--hover-bg-color); color:var(--hover-f div.tabs div.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); } div.plug legend { background-color:var(--output-bg-color); } div.plug legend:hover { background-color:var(--hover-bg-color); } -div.plug legend.select { background-color:var(--plugin-bg-color); border-bottom:var(--box-notice); border-bottom-width:2px; } +div.plug legend.select { background-color:var(--plugin-bg-color); border-bottom:var(--notice-bg-color) solid 3px; border-bottom-width:2px; } div.complete>table { background-color:var(--plugin-bg-color); } fieldset>form.option>div.item.text.cmd>input { background-color:var(--code-bg-color); color:var(--code-fg-color); } -fieldset>div.action div.item.select.cmds { border-bottom:var(--notice-bg-color) solid 2px; } +fieldset>div.action div.item.select.cmds { border-bottom:var(--notice-bg-color) solid 3px; } fieldset>div.output { background-color:var(--output-bg-color); } fieldset.panel:not(.main) { background-color:var(--panel-bg-color); color:var(--panel-fg-color); } fieldset.panel:not(.main)>div.output { background-color:var(--panel-output-bg-color); color:var(--panel-output-fg-color); } @@ -410,7 +416,7 @@ input[type=button] { border-radius:var(--button-radius); } fieldset>form.option>div.item.select { border-radius:var(--button-radius); } fieldset>form.option>div.item.button { border-radius:var(--button-radius); } fieldset>div.action div.item.button { border-radius:var(--button-radius); } -fieldset>div.action div.item.select:not(.cmds) { border-radius:var(--button-radius); } +fieldset>div.action div.item.select:not(.button):not(.cmds) { border-radius:var(--button-radius); border-bottom:var(--notice-bg-color) solid 3px; } fieldset:not(.input):not(.panel):not(.full):not(.cmd) { border-radius:var(--plugin-radius); } fieldset>div.status>legend:not(:hover):not(.select) { border-radius:0; } div.plug legend { border-radius:0; } @@ -428,6 +434,7 @@ div.output.card>div.item { box-shadow:var(--box-shadow); } div.output.card>div.item:hover { box-shadow:var(--notice-bg-color) 2px 2px 8px; } div.output.card>div.item>div.action>input { box-shadow:var(--input-box-shadow); } fieldset:not(.panel):not(.full):not(.cmd) { box-shadow:var(--plugin-box-shadow); } +fieldset:not(.panel):not(.full):not(.cmd):hover { box-shadow:var(--notice-box-shadow); } div.float { box-shadow:var(--plugin-box-shadow); } /* font */ body.windows { --code-font-family:"Courier New"; } @@ -477,9 +484,9 @@ i.bi.bi-toggle-on:hover { color:var(--notice-bg-color); } fieldset>legend>i { margin-right:var(--input-margin); } form.option>div.item.icon { position:relative; height:var(--action-height); overflow:hidden; user-select:none; } form.option>div.item.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); } -form.option>div.item.icon.menu { font-size:28px; line-height:26px; display:flex; align-items:flex-start; display:none; } -form.option>div.item.icon.refresh { font-size:28px; line-height:26px; display:flex; align-items:flex-start; } -form.option>div.item.icon.goback { font-size:28px; line-height:26px; display:flex; align-items:flex-start; } +form.option>div.item.icon.menu { font-size:28px; line-height:28px; display:flex; align-items:flex-start; display:none; } +form.option>div.item.icon.refresh { font-size:28px; line-height:28px; display:flex; align-items:flex-start; } +form.option>div.item.icon.goback { font-size:28px; line-height:28px; display:flex; align-items:flex-start; } form.option>div.item.icon.play { font-size:16px; } body.windows form.option>div.item.icon.delete { line-height:31px; display:flex; align-items:flex-start; } body.windows form.option>div.item.icon.menu { font-size:22px; line-height:32px; } @@ -537,7 +544,7 @@ fieldset.plug>form.option>div.button.icons>input { display:none; } fieldset.plug>div.action>div.button.icons>input { display:none; } fieldset.plug>form.option>div.icon:first-child { margin-left:var(--input-margin); } fieldset>form.option>div.text>span.value { line-height:calc(var(--action-height) - 2 * var(--input-padding)); - white-space:pre; padding:var(--input-padding) var(--button-padding); max-width:320px; height:var(--action-height); overflow:auto; } + white-space:pre; padding:var(--input-padding) var(--button-padding); min-width:40px; max-width:var(--url-input-width); height:var(--action-height); overflow:auto; } fieldset.plug>form.option>div.text>span.value { display:none; } fieldset:not(.float)>form.option>div.text>span.value { display:none; } fieldset.float:not(.plug)>form.option>div.text:not(.filter)>input { display:none; } @@ -548,7 +555,8 @@ fieldset.float:not(.plug)>div.action>div.item:last-child { margin-right:var(--ac /* svg */ svg text { font-size:var(--svg-font-size); font-family:var(--svg-font-family); stroke:var(--body-fg-color); fill:var(--body-fg-color); cursor:pointer; } svg text.offline { stroke:var(--disable-fg-color); fill:var(--disable-fg-color); } -svg text:hover { stroke:var(--hover-fg-color); fill:var(--hover-fg-color); cursor:pointer; } +/* svg text:hover { stroke:var(--hover-fg-color); fill:var(--hover-fg-color); cursor:pointer; } */ +svg text:hover { cursor:pointer; } svg rect { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); fill:var(--output-bg-color); } svg rect:hover { stroke:var(--hover-fg-color); fill:var(--hover-bg-color); } svg line { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); } diff --git a/lib/base.js b/lib/base.js index 69a0f596..1684c0b3 100644 --- a/lib/base.js +++ b/lib/base.js @@ -121,7 +121,7 @@ Volcanos("base", { h = parseInt(n/3600000), h > 0 && (res += h+"h"), n = n % 3600000 h = parseInt(n/60000), h > 0 && (res += h+"m"), n = n % 60000 h = parseInt(n/1000), h > 0 && (res += h), n = n % 1000 - return res + (n > 0? nfs.PT+parseInt(n/10): "") + "s" + return res + (n > 0? nfs.PT+this.Number(parseInt(n/10), 2): "") + "s" }, isNight: function() { var now = new Date(); return now.getHours() < 7 || now.getHours() > 17 }, isNumber: function(val) { return typeof val == code.NUMBER }, diff --git a/lib/user.js b/lib/user.js index b3fd4e90..6501d356 100644 --- a/lib/user.js +++ b/lib/user.js @@ -87,8 +87,8 @@ Volcanos("user", { content = {"success": "✅ success", "failure": "❌ failure", "process": "🕑 process"}[content]||content var meta = can.base.isObject(content)? content: {content: content, duration: duration, progress: progress, caller: caller} meta.title = meta.title||can.core.Keys(can.ConfSpace(), can.ConfIndex())||can._name.split(nfs.PS).slice(-2).join(nfs.PS) - var width = meta.width||380; if (width < 0) { width = window.innerWidth + width } meta.action = meta.action||[""] - var ui = can.page.Append(can, document.body, [{view: [[chat.TOAST, chat.FLOAT]], style: {left: (window.innerWidth-width)/2, width: width, top: can.page.height()/2}, list: [ + var width = meta.width||390; if (width < 0) { width = window.innerWidth + width } meta.action = meta.action||[""] + var ui = can.page.Append(can, document.body, [{view: [[chat.TOAST, meta.style, chat.FLOAT]], style: {left: (window.innerWidth-width)/2, width: width, top: can.page.height()/2}, list: [ {text: [meta.title||"", html.DIV, html.TITLE], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }}, {view: ["delete", "", can.page.unicode.delete], title: "点击关闭", onclick: function() { action.close() }}, {view: "duration", title: "点击关闭", onclick: function() { action.close() }}, @@ -116,8 +116,8 @@ Volcanos("user", { template: function(can, file) { return can.base.MergeURL(can.base.Path(nfs.SRC_TEMPLATE, can.Conf(ctx.INDEX), file), ice.POD, can.user.space(can)) }, share: function(can, msg, cmds) { can.page.exportValue(can, msg) can.run(msg, cmds||[ctx.ACTION, chat.SHARE], function(msg) { can.user.copy(msg._event, can, msg.Append(mdb.NAME)) - var ui = can.user.toast(can, {title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG}) - can.page.style(can, ui._target, html.TOP, (can.page.height() - 360)/4) + var ui = can.user.toast(can, {style: cli.QRCODE, title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG}) + // can.page.style(can, ui._target, html.TOP, (can.page.height() - ui._target.offsetHeight)/4) }) }, copy: function(event, can, text) { if (!text) { return } diff --git a/panel/action.css b/panel/action.css index ac84334b..3dbb23b2 100644 --- a/panel/action.css +++ b/panel/action.css @@ -2,7 +2,7 @@ fieldset.Action { min-width:var(--project-width); } fieldset.Action>div.output { overflow-x:hidden; } fieldset.Action>div.action:not(.flex) { width:100%; display:none; background-color:var(--plugin-bg-color); } fieldset.Action>div.action div.item { font-style:italic; font-size:1.1rem; padding:10px 20px; } -fieldset.Action.tabs>div.action { display:block; } +fieldset.Action.tabs>div.action { display:flex; justify-content:center; } 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; } diff --git a/panel/header.js b/panel/header.js index 0d514ca5..e60a4e9f 100644 --- a/panel/header.js +++ b/panel/header.js @@ -127,10 +127,9 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, theme: function(event, can) { can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) { can.onimport.theme(can, can.onimport._theme(can, target.className == icon.SUN? html.DARK: html.LIGHT)) }) }, - qrcode: function(event, can) { can.runAction(event, cli.QRCODE, [], function(msg) { - var ui = can.user.toast(can, {title: msg.Append(web.LINK), duration: -1, content: msg.Result(), action: [cli.CLOSE, cli.OPEN], resize: html.IMG}) - can.page.style(can, ui._target, html.TOP, (can.page.height() - 360)/2) - }) }, + qrcode: function(event, can) { + can.user.share(can, can.request(event, {_handle: ice.TRUE}), [ctx.ACTION, cli.QRCODE]) + }, language: function(event, can) { can.onimport.language(can, can.user.info.language.indexOf("zh") == 0? "en-us": "zh-cn") }, email: function(event, can) { can.user.input(can.request(event, {to: can.user.info.email, subject: can.user.title()}), can, [{name: "to", _trans: "收件人", need: "must"}, "subject","content"], function(args) { can.runAction(event, aaa.EMAIL, args, function() { can.user.toastSuccess(can) }) diff --git a/panel/river.css b/panel/river.css index 373f0c29..6fdfd4f5 100644 --- a/panel/river.css +++ b/panel/river.css @@ -5,14 +5,14 @@ fieldset.River>div.action div.item:hover input { background-color:var(--notice-b fieldset.River>div.output { transition:all .3s; } fieldset.River>div.output div.item { font-family:var(--legend-font-family); padding:var(--legend-padding); border-left:#00ffae solid 3px; } fieldset.River>div.output div.item:hover { color:var(--panel-hover-fg-color); } -fieldset.River>div.output div.item.select { color:var(--panel-hover-fg-color); } +fieldset.River>div.output div.item.select { color:var(--panel-hover-fg-color); border-right:var(--notice-bg-color) solid 3px; } +fieldset.River>div.output div.item>i:first-child { margin-right:var(--button-margin); } fieldset.River>div.output div.list div.item { border-left:#ccdc4c solid 3px; } fieldset.River>div.output div.list { margin-left:var(--legend-padding); } fieldset.River>div.output { margin:var(--river-margin) 0; } fieldset.River>div.toggle { rotate:90deg; right:calc(50% - 5px); } 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(.all):not(.tabs):not(.page) { width:var(--header-height); } fieldset.River:not(.all):not(.tabs):not(.page)>div.action { flex-direction:column; overflow:hidden; } diff --git a/panel/river.js b/panel/river.js index b0249af5..d0244765 100644 --- a/panel/river.js +++ b/panel/river.js @@ -134,10 +134,10 @@ Volcanos(chat.ONEXPORT, {width: function(can) { return can._target.offsetWidth } }) }, }) Volcanos(chat.ONENGINE, {_engine: function(event, can, msg, panel, cmds, cb) { - if (typeof can.river == code.FUNCTION) { can.river = can.river(can) } - var list = can.river + if (typeof can.river == code.FUNCTION) { can.river = can.river(can) } var list = can.river cmds.length == 0 && can.core.ItemOrder(list, mdb.ORDER, function(key, value) { if (!value) { return } - if (can.user.info.userrole == aaa.ROOT || can.base.isIn(value.type||"", "", aaa.VOID, can.user.info.userrole)) { + if (value.debug && can.misc.Search(can, ice.MSG_DEBUG) != ice.TRUE) { return } + if (can.base.isIn(can.user.info.userrole, value.type||aaa.VOID, aaa.TECH, aaa.ROOT)) { can.core.Item(value.storm).length > 0 && msg.Push({hash: key, name: can.user.isEnglish(can)? key: value.name, icon: value.icon||"", main: value.main||false}) } }) diff --git a/plugin/local/team/plan.js b/plugin/local/team/plan.js index 4084ba44..e4aa2a75 100644 --- a/plugin/local/team/plan.js +++ b/plugin/local/team/plan.js @@ -1,6 +1,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can, target), can._display_heights = {}, can.list = {}; var ls = can.misc.SearchHash(can) - can.isCmdMode() || can.onmotion.hidden(can, can._action) - can.ui = can.onappend.layout(can), can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display), can.isCmdMode() || can.onmotion.hidden(can, can.ui.project) + can.onmotion.hidden(can, can._action) + can.ui = can.onappend.layout(can) + can.onmotion.hidden(can, can.ui.project) can.onimport[can.Option("scale")||team.WEEK](can, msg), can.Status(mdb.COUNT, msg.Length()), can.ui.filter.placeholder = `search in ${ msg.Length() } items`, can.onimport.layout(can) var item; if (can.isCmdMode() && ls.length > 0) { item = can.list[can.core.Keys(ls)] } else if (can.sup.task) { item = can.list[can.core.Keys(can.sup.task.space, can.sup.task.zone, can.sup.task.id)] } item && item.click() }, diff --git a/plugin/local/wiki/word.css b/plugin/local/wiki/word.css index 7991fcc7..1a82152d 100644 --- a/plugin/local/wiki/word.css +++ b/plugin/local/wiki/word.css @@ -27,11 +27,11 @@ div.story[data-type=spark_tabs]>div.story:not(.select) { display:none; } fieldset.word.play.float { top:0; } fieldset.word.play.float>div.action { display:contents; } fieldset.word.play.float>div.status { clear:none; display:contents; } -fieldset.word.play.float>div.output>div.project { background-color:#4682b46b; padding:var(--plugin-padding); position:fixed; right:0; top:var(--action-height); z-index:10; } +fieldset.word.play.float>div.output>div.project { background-color:var(--plugin-bg-color); padding:var(--plugin-padding); position:fixed; right:0; top:var(--action-height); z-index:10; } fieldset.word.play.float div.content div.page { display:none; } fieldset.word.play.float div.content div.page.show { display:block; } fieldset.word.play.float div.content div.page ul { text-align:left; } -fieldset.word.play.float div.content.grid div.page { background-color:#a4cbecb5; margin:var(--plugin-padding); height:var(--qrcode-height); width:30%; overflow:auto; display:block; float:left; } +fieldset.word.play.float div.content.grid div.page { background-color:var(--plugin-bg-color); margin:var(--plugin-padding); height:var(--qrcode-height); width:30%; overflow:auto; display:block; float:left; } fieldset.word.play.float h1 { text-align:center; } fieldset.word.play.float h2 { text-align:center; } fieldset.word.play.float h3 { text-align:center; } diff --git a/plugin/local/wiki/word.js b/plugin/local/wiki/word.js index 7d12676d..5aa2692e 100644 --- a/plugin/local/wiki/word.js +++ b/plugin/local/wiki/word.js @@ -88,6 +88,7 @@ Volcanos(chat.ONACTION, { play: function(event, can) { var list = [], current = [] can.page.Select(can, can._output, wiki.STORY_ITEM, function(item) { can.page.tagis(item, "h1", "h2", "h3") && list.push(current = []), current.push(item) }) can.onappend._init(can, {type: "story word play float", height: can.page.height(), width: can.page.width(), padding: 10}, [], function(sub) { sub._legend.onclick = can._legend.onclick + sub._trans = {input: {page: "页码", from: "开始"}} sub.run = can.run, sub.sup = can, can.sub = sub, can.onappend._action(sub, can.user.isMobile && can.page.height() > can.page.width()? [ "大纲", "上一页", "下一页", "结束", ]: [ diff --git a/plugin/state.js b/plugin/state.js index e326b5c9..ef6bce61 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -80,7 +80,7 @@ Volcanos(chat.ONIMPORT, { can.page.Append(can, div, [{text: arg}]), can._output.scrollTop = div.offsetTop, div.scrollBy(0, 10000), true })) { can.onappend.board(can, arg) } }, - _open: function(can, msg, arg) { can.user.open(arg); if (can.ConfIndex() == web.DREAM) { can.Update() } }, + _open: function(can, msg, arg) { can.user.open(arg); if (msg._arg.length > 1 || can.ConfIndex() == web.DREAM) { can.Update() } }, _close: function(can, msg) { can.user.close() || history.back() }, change: function(event, can, name, value, cb, data) { return can.page.SelectArgs(can, can._option, "", function(input) { if (input.name != name || value == input.value) { return } can.page.Select(can, input.parentNode, "span.value", function(target) { target.innerText = value }) diff --git a/plugin/story/studio.js b/plugin/story/studio.js index 036c68f8..43b5c673 100644 --- a/plugin/story/studio.js +++ b/plugin/story/studio.js @@ -2,9 +2,10 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg, cb) { can.isCmdMode() && can.sup.onimport.size(can.sup, can.page.height(), can.page.width()) can.onmotion.clear(can), can.onmotion.hidden(can, can._status), cb && cb(msg) - can.onimport._tabs(can, msg) // can.onimport._full(can, msg) + can.onimport._tabs(can, msg) }, - _tabs: function(can, msg) { can.onappend.style(can, web.STUDIO) + _tabs: function(can, msg) { + can.onappend.style(can, web.STUDIO), can.onmotion.clear(can, can._action) msg.Table(function(value, index) { value.nick = can.user.trans(can, value.index.split(nfs.PT).pop(), value.help) var target = can.onimport.item(can, value, function() { if (value._plugin) { return can.onmotion.select(can, can._output, html.FIELDSET, value._plugin._target) } @@ -15,6 +16,7 @@ Volcanos(chat.ONIMPORT, { }, can._output) }, null, can._action); index == 0 && target.click(), can.onappend.style(can, "cmds", target) }) + can.onappend._action(can, null, null, null, true) }, _full: function(can, msg) { can.ui = can.onappend.layout(can), can.page.style(can, can.ui.content, html.PADDING, 10) diff --git a/plugin/story/trends.js b/plugin/story/trends.js index 63eb9b38..372b07d0 100644 --- a/plugin/story/trends.js +++ b/plugin/story/trends.js @@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(can, function() { can.base.isFunc(cb) && cb(msg) can.Conf(html.VIEW) && can.Action(html.VIEW, can.Conf(html.VIEW)) can.onmotion.toggle(can, can._option, !can.user.isMobile) - can.onmotion.toggle(can, can._action, !can.user.isMobile && can.isCmdMode()) + can.onmotion.toggle(can, can._action, false) can.db.data = msg.Table(), can.onimport.layout(can) }) }, diff --git a/plugin/table.js b/plugin/table.js index 433632b1..1ae45c9f 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -188,7 +188,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { }} }))._target }, tool: function(can, list, cb, target, status) { target = target||can._output, status = status||can._status - var height = can.base.Max(html.PLUG_HEIGHT, can.ConfHeight(), 240), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-(can.user.isMobile? 0: html.PROJECT_WIDTH)) + var height = can.base.Max(html.PLUG_HEIGHT, can.ConfHeight()-2*html.ACTION_HEIGHT, 240), width = can.base.Max(html.PLUG_WIDTH, can.ConfWidth()-(can.user.isMobile? 0: html.PROJECT_WIDTH)) 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, "")