From d6987088c305af26a79f65d3fe4139e9bd99da3d Mon Sep 17 00:00:00 2001 From: shy Date: Fri, 19 Jul 2024 18:11:07 +0800 Subject: [PATCH] add some --- frame.js | 6 ++++++ index.css | 4 ++-- lib/page.js | 2 +- lib/user.js | 3 ++- panel/header.js | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frame.js b/frame.js index 730f32e8..2b308915 100644 --- a/frame.js +++ b/frame.js @@ -195,6 +195,11 @@ Volcanos(chat.ONAPPEND, { }), can.base.isFunc(cb) && cb(sub) if (sub.isOutputStyle()) { return } if (can.user.isMobile && !can.user.isLandscape()) { return } sub.isCmdMode() && !can.base.isIn(meta.index, web.CODE_VIMER, web.CODE_INNER, web.CHAT_MACOS_DESKTOP) && can.page.insertBefore(can, [{view: "header", list: can.user.header(sub)}], sub._output, sub._fields||sub._target) + sub.isCmdMode() && can.onmotion.delay(can, function() { wx.ready(function () { + wx.updateAppMessageShareData({title: sub.Conf("help"), desc: "", link: location.href, imgUrl: sub.Conf(mdb.ICONS)}) + wx.updateTimelineShareData({title: sub.Conf("help"), link: location.href, imgUrl: sub.Conf(mdb.ICONS)}) + }) }, 300) + }); return sub }, _option: function(can, meta, option, skip) { var index = -1, args = can.base.Obj(meta.args||meta.arg, []), opts = can.base.Obj(meta.opts, {}) @@ -613,6 +618,7 @@ Volcanos(chat.ONAPPEND, { function img(p) { return !msg.IsDetail()? can.page.Format(html.IMG, p, 48, 48): can.user.isMobile? can.page.Format(html.IMG, p, null, 320): can.page.Format(html.IMG, p, 320, null) } if (key == mdb.ICON && value) { _value = can.base.contains(value, ".ico", ".png", ".jpg")? img(can.misc.Resource(can, data[key], data[ice.POD]||data[web.SPACE])): "" } if (key == mdb.ICONS && value) { _value = img(can.misc.Resource(can, data[key])) } + if (key == aaa.AVATAR && value) { _value = img(can.misc.Resource(can, data[key])) } if (key == nfs.IMAGE && value) { _value = can.core.List(can.core.Split(data[key]), function(item) { return img(can.misc.ShareCache(can, item, data.space)) }).join("") } // if (key == web.SPACE && value) { _value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) } // if (key == mdb.NAME && value) { _value = can.user.trans(can, value, null, html.INPUT) } diff --git a/index.css b/index.css index a916f389..367146d9 100644 --- a/index.css +++ b/index.css @@ -454,7 +454,7 @@ fieldset.vimer>div.output div.project fieldset.plug div.output.card>div.item { m div.float { position:fixed; } div.output { position:relative; } div.content { position:relative; } div.output>div.code { position:sticky; left:0; } -div.output>div.code>img { margin:5px; } +div.output>div.code>img { margin:5px; max-width:100%; } div.output.flex { overflow:hidden; align-items:flex-start; justify-content: flex-start; } div.layout.flex>* { float:left; clear:none; } div.flex:not(.hide) { display:flex; align-items:center; justify-content:center; } @@ -484,7 +484,7 @@ input[type=button] { border:var(--input-border); border-radius:var(--button-radi input[type=button]:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); } input[type=button].danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } input[type=button].notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } -input[type=button].danger { border:var(--box-danger); } +input[type=button].danger { color:var(--danger-bg-color) !important; } input[type=button].notice { border:var(--box-notice); } table.content tr:hover { background-color:var(--tr-hover-bg-color); } table.content tr.select { background-color:var(--tr-hover-bg-color); } diff --git a/lib/page.js b/lib/page.js index b5f49482..37947073 100644 --- a/lib/page.js +++ b/lib/page.js @@ -483,7 +483,7 @@ Volcanos("page", { }, buttonStyle: function(can, name) { return can.core.Value(can.onaction, ["_trans", "style", name])||(can.base.isIn(name, mdb.CREATE, mdb.INSERT, mdb.IMPORT, nfs.CLONE, cli.START, ctx.RUN, web.UPLOAD, web.CONFIRM, aaa.LOGIN, code.AUTOGEN, "sso", "add", "pull", "push", "commit", "preview", "auto-preview", ice.APP)? html.NOTICE: - can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, cli.RESTART, cli.STOP, cli.CLOSE, cli.REBOOT, web.CANCEL, code.UPGRADE, "del", "drop", "access", "kill", "prockill")? html.DANGER: "") + can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, cli.RESTART, cli.STOP, cli.CLOSE, cli.REBOOT, web.CANCEL, code.UPGRADE, "reject", "del", "drop", "access", "kill", "prockill")? html.DANGER: "") }, exportValue: function(can, msg, target) { target = target||can._output msg.OptionDefault(ice.MSG_THEME, can.getHeaderTheme()) diff --git a/lib/user.js b/lib/user.js index f100a53e..547d6156 100644 --- a/lib/user.js +++ b/lib/user.js @@ -90,8 +90,9 @@ Volcanos("user", { toastFailure: function(can, content, title) { return can.user.toast(can, {content: "❌ "+(content||ice.FAILURE), title: title, duration: -1}) }, toastSuccess: function(can, content, title) { return can.user.toast(can, {content: "✅ "+(content||ice.SUCCESS), title: title, duration: 3000}) }, toast: function(can, content, title, duration, progress, hash) { can = can._fields? can.sup: can + if (title == can.ConfIndex()) { title = can.user.trans(can, title, can.Conf("help")) } var meta = can.base.isObject(content)? content: {content: content, title: title, duration: duration, progress: progress, hash: hash} - meta.title = meta.title||can.core.Keys(can.ConfSpace(), can.ConfIndex())||can._name.split(nfs.PS).slice(-2).join(nfs.PS) + meta.title = meta.title||can.user.trans(can, can.core.Keys(can.ConfSpace(), can.ConfIndex()), can.Conf("help"))||can._name.split(nfs.PS).slice(-2).join(nfs.PS) meta.hash && can.misc.isDebug(can) && (meta.title += " "+meta.hash.slice(0, 6)), meta.action = meta.action||[""] var width = meta.width||(html.QRCODE_WIDTH+2*html.PLUGIN_PADDING+10); if (width < 0) { width = can.page.width() + width } meta.title = can.base.replaceAll(meta.title||"", "%2F", "/") diff --git a/panel/header.js b/panel/header.js index e8e64acd..144fd858 100644 --- a/panel/header.js +++ b/panel/header.js @@ -94,7 +94,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, can.user.info.email = msg.Option(aaa.EMAIL) can.user.info.avatar = msg.Option(aaa.AVATAR) can.user.info.background = msg.Option(aaa.BACKGROUND) - can.user.info.titles = msg.Option("titles") + can.user.info.titles = msg.Option("titles")||document.title can.user.info.favicon = msg.Option("favicon") lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) }) }