From 58d8223aaf29794cf56374c2010ed583b43c002f Mon Sep 17 00:00:00 2001 From: shaoying Date: Sat, 11 Feb 2023 19:37:26 +0800 Subject: [PATCH] opt some --- frame.js | 3 ++- plugin/local/code/inner.css | 2 +- plugin/local/code/inner.js | 6 +++--- plugin/local/code/vimer.js | 2 +- plugin/state.js | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frame.js b/frame.js index 1f41f099..b6e63375 100644 --- a/frame.js +++ b/frame.js @@ -241,8 +241,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { function _bg(color) { return kit.Dict(html.BACKGROUND_COLOR, color, can.core.List(arguments).slice(1)) } function _fg(color) { return kit.Dict(html.COLOR, color, can.core.List(arguments).slice(1)) } function _b_r(size) { return kit.Dict(RADIUS, size) } + const TABLE_COLOR = can.user.isWebview? "#202324": cli.BLACK color = kit.Dict( - chat.PANEL, cli.BLACK, chat.PLUGIN, cli.BLACK, html.LEGEND, INPUT_COLOR, html.INPUT, INPUT_COLOR, html.OUTPUT, OUTPUT_COLOR, html.TABLE, cli.BLACK, + chat.PANEL, TABLE_COLOR, chat.PLUGIN, TABLE_COLOR, html.LEGEND, INPUT_COLOR, html.INPUT, INPUT_COLOR, html.OUTPUT, OUTPUT_COLOR, html.TABLE, TABLE_COLOR, html.HOVER, INPUT_COLOR, html.BORDER, cli.GRAY, html.LABEL, cli.SILVER, html.TEXT, cli.WHITE, log.INFO, cli.BLUE, log.WARN, cli.RED, color, ), style = kit.Dict(LEGEND_STYLE, _bg(color.legend), INPUT_STYLE, _bg(color.input, html.COLOR, color.label, RADIUS, "5px", "outline", html.NONE, "box-shadow", html.NONE), diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 0e77481b..b3702f0d 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -26,7 +26,7 @@ fieldset.inner.cmd>div.output>div.layout.flow>div.tabs.hide { display:none; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div { padding:10px; height:38px; float:left; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span { font-style:italic; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span.icon { padding:0 5px; } -fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.website.icon { font-size:18px; line-height:32px; padding:2px 5px; margin-top:2px; position:sticky; top:0; } +fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.website.icon { font-size:18px; line-height:32px; padding:2px 5px; position:sticky; top:0; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar { padding:0; height:38px; float:right; position:sticky; top:0; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar>img { height:38px; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.time { float:right; position:sticky; top:0; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 24614930..da3bafcd 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -42,15 +42,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl {name: can.page.unicode.menu, onclick: function() { can.user.carte(event, can, can.onaction, can.onaction.list.concat(can.user.isWebview? ["全屏", "录屏", "编辑器", "浏览器"]: [])) }}, - {name: can.page.unicode.back, style: {"font-size": "14px", "margin-top": "3px"}, onclick: function(event) { + {name: can.page.unicode.back, style: {"font-size": "14px", "padding-top": "3px"}, onclick: function(event) { var list = {}; can.user.carte(event, can, {_style: "history"}, can.core.List(can.db.history, function(item) { var value = [item.path, item.file, item.line, ice.TB+(item.text&&item.text.length>30? item.text.slice(0, 30)+"...": item.text||"")].join(ice.DF); if (!list[value]) { list[value] = item; return value } }).reverse(), function(event, button, meta, carte) { carte.close() var ls = button.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2]) }) }}, - {name: can.page.unicode.refresh, style: {"font-size": "24px", "margin-top": "0px"}, onclick: function() { location.reload() }}, - {name: can.page.unicode.reback, style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() { + {name: can.page.unicode.refresh, style: {"font-size": "24px", "padding-top": "1px"}, onclick: function() { location.reload() }}, + {name: can.page.unicode.reback, style: {"font-size": "14px", "padding-top": "3px"}, onclick: function() { var list = {}; can.user.carte(event, can, {_style: "tabview"}, can.core.Item(can.db.tabview), function(event, button, meta, carte) { carte.close() var ls = button.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1]) }) diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index ca9c10ba..22d662b3 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -104,7 +104,7 @@ Volcanos(chat.ONACTION, { "扩展": function(event, can) { can.user.input(can.request(event, {action: "extension"}), can, ["url"], function(list) { var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0]) }) }, - "首页": function(event, can) { can.user.open(location.origin+"?debug=true") }, + "首页": function(event, can) { can.user.open(location.origin+(can.misc.Search(can, log.DEBUG) == ice.TRUE? "?debug=true": "")) }, "官网": function(event, can) { can.user.open("https://shylinux.com/") }, "调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) }, "百度": function(event, can) { can.user.opens("https://baidu.com/") }, diff --git a/plugin/state.js b/plugin/state.js index 3c18a43f..30113eaf 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -201,7 +201,7 @@ Volcanos(chat.ONACTION, {list: [ }) }, }) Volcanos(chat.ONEXPORT, { - link: function(can) { var meta = can.Conf(), args = can.Option() + link: function(can) { var meta = can.Conf(), args = can.Option(); can.misc.Search(can, log.DEBUG) == ice.TRUE && (args[log.DEBUG] = ice.TRUE) args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.cmd == web.WIKI_WORD && (args.cmd = args.path) return can.misc.MergePodCmd(can, args, true) },