diff --git a/const.js b/const.js index 4fc0ab8e..d93bf455 100644 --- a/const.js +++ b/const.js @@ -285,12 +285,10 @@ var chat = { HEADER: "Header", ACTION: "Action", FOOTER: "Footer", libs: ["base.js", "core.js", "date.js", "misc.js", "page.js", "user.js"].map(function(p) { return "/lib/"+p }), panel_list: [{name: "Header", style: "head"}, {name: "River", style: "left"}, {name: "Action", style: "main"}, {name: "Search", style: "auto"}, {name: "Footer", style: "foot"}], - plugin_list: [ - "state.js", - "input.js", - "table.js", + plugin_list: ["state.js", "input.js", "table.js", "input/key.js", "input/date.js", + ].concat(navigator.userAgent.indexOf("Mobile") > -1? []: [ "story/json.js", "story/stats.js", "story/spides.js", @@ -304,7 +302,7 @@ var chat = { "local/wiki/feel.js", "local/wiki/word.js", "local/team/plan.js", - ].map(function(p) { return "/v/plugin/"+p }), + ]).map(function(p) { return "/v/plugin/"+p }), PLUGIN_LOCAL: "/plugin/local/", PLUGIN_STORY: "/plugin/story/", PLUGIN_INPUT: "/plugin/input/", PLUGIN_INPUT_JS: "/plugin/input.js", PLUGIN_TABLE_JS: "/plugin/table.js", PLUGIN_STATE_JS: "/plugin/state.js", FRAME_JS: "/v/frame.js", diff --git a/frame.js b/frame.js index dffc33d8..0a183aeb 100644 --- a/frame.js +++ b/frame.js @@ -711,7 +711,7 @@ Volcanos(chat.ONAPPEND, { can.page.SelectChild(can, can._option, html.DIV_ITEM_TEXT, function(target) { can.page.ClassList.set(can, target, "will", can.page.ClassList.has(can, target, key)) }) }, _init: function(target) { if (msg.IsDetail() && key != "key") { can.onappend.style(can, key, target.parentNode) } - if (option.indexOf(key) > -1) { can.onappend.style(can, "k-"+value, target.parentNode) } + if (option.indexOf(key) > -1) { can.onappend.style(can, "k-"+(value.split(">").pop()), target.parentNode) } if (key == mdb.TYPE) { can.onappend.style(can, value, target.parentNode) } if (key == mdb.STATUS) { can.onappend.style(can, value, target.parentNode) } if (key == mdb.ENABLE) { can.onappend.style(can, value == ice.FALSE? mdb.DISABLE: mdb.ENABLE, target.parentNode) } diff --git a/index.css b/index.css index 1cd59d50..d032e74c 100644 --- a/index.css +++ b/index.css @@ -119,6 +119,12 @@ table.content th.select[data-asc="0"] i.bi-sort-up { display:none; } table.content th.select[data-asc="1"] i.bi-sort-down-alt { display:none; } table.content td.option { cursor:pointer; } table.content td { padding:var(--table-padding); } +fieldset.log.debug table.content td:last-child { + // white-space:pre-line; + // word-break:break-all; + white-space:pre; + max-width:800px; min-width:600px; +} table.content td i { padding:var(--input-padding); } table.content:not(.detail) td img { height:48px; width:auto; } table.content:not(.detail) td input.icons { display:none; } @@ -195,7 +201,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; } +div.item.card div.title div.action { top: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) } diff --git a/lib/user.js b/lib/user.js index 31325d54..241b15cf 100644 --- a/lib/user.js +++ b/lib/user.js @@ -16,10 +16,7 @@ Volcanos("user", { connectWifi: function(can, ssid, password, cb, cbs) {}, getClipboard: function(can, cb) {}, enableDebug: function(can) {}, - init: function(can, content, icons) { - can.user.agent.cmd = can, can.user.agent._init_content = content - can.user.agent._init_icons = icons - }, _init_content: [], + init: function(can, content, icons) { can.user.agent.cmd = can, can.user.agent._init_content = content, can.user.agent._init_icons = icons }, _init_content: [], }, info: {}, isIPad: false, isTesla: navigator.userAgent.indexOf("Tesla") > -1, diff --git a/panel/header.js b/panel/header.js index ab77ccd8..d3aea1de 100644 --- a/panel/header.js +++ b/panel/header.js @@ -106,6 +106,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: can.__theme = can.onimport._theme(can, theme)})), can.onimport.theme(can) })), can.onimport.theme(can, can.misc.Search(can, "theme")||"") can.onaction._menus[3] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, nfs._JS) })) + can.user.isMobile && (msg["theme.list"] = ["dark.css", "light.css"]) can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) })) can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() { if (can.base.beginWith(location.pathname, nfs.WIKI_PORTAL, web.CHAT_CMD+web.WIKI_PORTAL, web.CHAT_CMD+web.CHAT_OAUTH_CLIENT)) { return show(msg) } diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 9459cec6..38d37768 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -51,7 +51,7 @@ fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div.avatar { padding: fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div.qrcode i { margin-top:3px; } fieldset.inner.cmd>div.output>div.layout>div.tabs>div.head>div.avatar>img { height:32px; clip-path:circle(40%); } fieldset.inner.cmd>div.output>div.layout>div.path:not(.hide) { display:flex; } -fieldset.inner.cmd>div.output>div.layout>div.plug { box-shadow:var(--th-box-shadow); height:var(--action-height); overflow:auto; } +fieldset.inner.cmd>div.output>div.layout>div.plug { box-shadow:var(--th-box-shadow); background-color:var(--plugin-bg-color); height:var(--action-height); overflow:auto; } fieldset.inner.cmd>div.output>div.layout>div.plug>legend { padding:0 var(--input-padding); padding-right:0; margin-right:0; float:right; } fieldset.inner.cmd>div.output>div.layout>div.plug>legend:hover { box-shadow:var(--notice-box-shadow); } fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove { padding:0 var(--input-padding); } diff --git a/plugin/table.js b/plugin/table.js index 4f0eec99..32bc113e 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -290,6 +290,7 @@ Volcanos(chat.ONIMPORT, { }, myField: function(can, sub) { sub.onexport._output = function(_sub) { + _sub._stacks_current = can._stacks_current, _sub._stacks_root = can._stacks_root can.core.Item(can.onimport, function(key, value) { _sub.onimport[key] = _sub.onimport[key]||value }) can.core.Item(can.onaction, function(key, value) { _sub.onaction[key] = _sub.onaction[key]||value }) can.core.Item(can.onexport, function(key, value) { _sub.onexport[key] = _sub.onexport[key]||value }) @@ -334,15 +335,15 @@ Volcanos(chat.ONIMPORT, { }, can.base.Obj(sub.Conf("field.option"))), cmds, cb) } can.onimport.myField(can, sub), can.onmotion.slideIn(sub) - sub.onexport.output = function(_sub, msg) { _sub._stacks_current = can._stacks_current, _sub._stacks_root = can._stacks_root + sub.onexport.output = function(_sub, msg) { sub._select(), msg.Option(ice.MSG_ACTION) && can.onappend._action(sub, msg.Option(ice.MSG_ACTION), _action, null, true) sub.sub.onaction._goback = goback } sub.onimport._field = function(msg) { var sup = sub; can.onmotion.clear(can, sub._output) msg.Table(function(value) { value.style = html.OUTPUT can.onappend.plugin(can, value, function(sub) { + can.onimport.myField(can, sub) sub.onexport.output = function(_sub, msg) { - _sub._stacks_current = can._stacks_current, _sub._stacks_root = can._stacks_root can.onimport.myOption(sub) } var run = sub.run; sub.run = function(event, cmds, cb) { @@ -438,7 +439,7 @@ Volcanos(chat.ONIMPORT, { authView: function(can, value) { return can.base.isIn(value.auth_status, "issued", "2") && {view: [aaa.AUTH, html.SPAN], list: [{icon: "bi bi-patch-check-fill", style: {color: "var(--notice-bg-color)"}}]} }, timeView: function(can, value, key) { if (key) { return {text: [can.user.trans(can, key, null, html.INPUT)+": "+can.base.TimeTrim(value[key]), "", mdb.TIME]} } - return {text: [can.base.TimeTrim(value[key]||value.updated_at||value.created_at), "", mdb.TIME]} + return {text: [can.base.TimeTrim(value[key]||value.updated_at||value.created_at||value.time), "", mdb.TIME]} }, unitView: function(can, value, key, unit) { if (!value[key]) { return } return {text: [[can.user.trans(can, key, null, html.INPUT)+":", value[key]].concat(unit? [unit]: []).join(" "), "", key]} @@ -504,6 +505,7 @@ Volcanos(chat.ONACTION, { can.onaction._goback && can.onaction._goback(event) }, onslideleft: function(event, can, data, direction) { + return var button = can.base.Obj(can._msg.Option("_action"), [])[0]; if (!button) { return } can.run({}, [ctx.ACTION, button].concat(can.base.trim(can.core.Item(can.Option(), function(key, value) { return value })))) }, diff --git a/proto.js b/proto.js index 174830e0..ba6cbee6 100644 --- a/proto.js +++ b/proto.js @@ -116,6 +116,7 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {}, ConfDefault: function(value) { can.core.Item(value, function(k, v) { can.Conf(k) || can.Conf(k, v) }) }, ConfSpace: function(space) { if (space) { can.Conf(web.SPACE, space) } return can.Conf("_space")||can.Conf(web.SPACE)||can.Conf("pod")||"" }, ConfIndex: function(index) { if (index) { can.Conf(ctx.INDEX, index) } return can.Conf("_command")||can.Conf(ctx.INDEX)||can.Conf("_index") }, + ConfIcons: function() { return can.Conf(mdb.ICONS) }, ConfHeight: function(value) { return can.Conf(html.HEIGHT, value) }, ConfWidth: function(value) { return can.Conf(html.WIDTH, value)||can._output.offsetWidth }, ConfHelp: function() { return can.Conf("help") },