From d377063c0fd5c50a066e5e04047dc9dd2432b1fe Mon Sep 17 00:00:00 2001 From: shy Date: Thu, 26 Sep 2024 13:00:40 +0800 Subject: [PATCH] add some --- const.js | 4 ++++ frame.js | 2 +- index.css | 8 +++++--- plugin/table.js | 12 +++++++----- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/const.js b/const.js index 86258401..a081319d 100644 --- a/const.js +++ b/const.js @@ -229,6 +229,8 @@ var nfs = { CHAT_RIVER: "/chat/river/", CHAT_ACTION: "/chat/action/", DF: ice.DF, PS: ice.PS, PT: ice.PT, + BACKGROUND_JPG: "usr/icons/background.jpg", + AVATAR_JPG: "usr/icons/avatar.jpg", } var cli = { RUNTIME: "runtime", SYSTEM: "system", DAEMON: "daemon", @@ -435,6 +437,8 @@ var html = { DIV_PROFILE: "div.profile", DIV_DISPLAY: "div.display", IMAGE_PNG: "image/png", VIDEO_WEBM: "video/webm", + BACKGROUND_JPG: "usr/icons/background.jpg", + AVATAR_JPG: "usr/icons/avatar.jpg", } var icon = { CHEVRON_DOWN: "bi bi-chevron-down", SEARCH: "bi bi-search", TERMINAL: "bi bi-terminal", SUN: "bi bi-sun", MOON: "bi bi-moon-stars", diff --git a/frame.js b/frame.js index 984e02ff..ff22348d 100644 --- a/frame.js +++ b/frame.js @@ -360,7 +360,7 @@ Volcanos(chat.ONAPPEND, { can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) { can.onappend.style(sub, sub.Conf(ctx.STYLE)), can.onmotion.story.auto(can, can._output), sub.onmotion.touchAction(sub) if (action !== false) { can.onkeymap._build(sub) - var list = can.base.Obj(msg.Option(ice.MSG_ACTION)||can.Conf(ice.MSG_ACTION), [])||[] + var list = can.base.Obj(msg.Option(ice.MSG_ACTION)||can.Conf(ice.MSG_ACTION), sub.onaction.list||[]) can.onmotion.clear(can, can._action), sub.onappend._action(sub, [{view: "_space"}].concat(list), action||can._action) sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS), null, msg), can.user.isMobile || sub.onappend.tools(sub, msg) // if (msg.Option("sess.online") == ice.TRUE) { can.ondaemon._online(can) } diff --git a/index.css b/index.css index 69c571f4..70831961 100644 --- a/index.css +++ b/index.css @@ -70,6 +70,7 @@ body { --button-padding:var(--plugin-padding); --button-margin:var(--button-padding); --input-padding:5px; --input-margin:var(--input-padding); --table-padding:var(--button-padding); + --item-padding:10px; --item-margin:10px; --header-height:48px; --footer-height:var(--action-height); --action-height:32px; --status-height:32px; --textarea-height:96px; @@ -158,8 +159,8 @@ fieldset.plugin.cmd.output>div.output { top:0; } div.output._prepare { position:absolute; } div.output._unload { position:absolute; } fieldset._process input { - border:var(--box-border) !important; - background-color:var(--disable-fg-color) !important; + // border:var(--box-border) !important; + background-color:transparent !important; color:var(--disable-fg-color) !important; } body.mobile table.content.checkbox th:first-child { padding:var(--table-padding) var(--input-padding); } @@ -206,7 +207,8 @@ div.item.card div.title span.status { border:var(--box-notice); color:var(--noti div.item.card div.status { font-size:12px; color:gray; } div.item.card div.status span { margin-right:5px; } div.item.card div.action { max-width:100%; display:flex; align-items:center; } -div.item.card div.action { position:absolute; right:0; } +div.item.card div.action { position:absolute; right:0; } +body:not(.mobile) div.item.card div.action { z-index:1; } div.item.card div.action input[type=button] { background-color:transparent; border:none; color:var(--notice-bg-color); margin-left:5px; } div.item.card div.action input[type=button].danger { color:var(--danger-bg-color) } div.item.card div.action input[type=button]:last-child { margin-right:5px; } diff --git a/plugin/table.js b/plugin/table.js index 699061c4..1ecb1b8f 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -392,10 +392,7 @@ Volcanos(chat.ONIMPORT, { } else { can.page.Append(can, target, msg.Table(function(value) { return can.onimport.itemcard(can, value, cb(value), cbs) - })), msg.Result() && can.onappend.board(can, msg) - if (msg.Option(ctx.STYLE)) { - can.onappend.style(can, msg.Option(ctx.STYLE)) - } + })), msg.Result() && can.onappend.board(can, msg), can.onappend.style(can, msg.Option(ctx.STYLE)) } can.page.Select(can, target, html.INPUT_BUTTON, function(target) { var style = can.Conf("_style."+target.name); style && can.page.ClassList.add(can, target, style) @@ -405,7 +402,12 @@ Volcanos(chat.ONIMPORT, { can.core.List(list, function(item) { if (!item || !item.list) { return } for (var i = 0; i < item.list.length; i++) { if (item.list[i] && typeof item.list[i] == code.STRING) { item.list[i] = {text: item.list[i]} } } }) - cb = cb|| function(event) { if (value.uid) { can.Option(UID, value.uid), can.Update() } } + cb = cb|| function(event) { var done = false + if (value.uid) { return can.Option(UID, value.uid), can.Update() } + can.core.Item(can.Option(), function(k, v) { + if (!done && !v) { done = true, can.Option(k, value[k]), can.Update() } + }) + } return {view: [[html.ITEM_CARD, value._uid? "uid-"+value._uid: ""].concat(value._style||[])], list: [ {view: html.ACTION, _init: function(target) { can.page.appendAction(can, value, target) }}, {view: html.OUTPUT, list: [