From 6313d57ff6c6a9c71b4c9dd30d48f4810cf8effe Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 31 Dec 2024 12:10:20 +0800 Subject: [PATCH] opt some --- index.css | 1 + lib/user.js | 4 ++-- panel/footer.css | 2 ++ plugin/local/code/inner.css | 3 ++- plugin/local/code/inner.js | 2 +- plugin/local/wiki/word.js | 5 +++-- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/index.css b/index.css index 81f8665c..89f7c2e8 100644 --- a/index.css +++ b/index.css @@ -464,6 +464,7 @@ body>div.input.login>div.display>label { color:var(--disable-fg-color); font-sty body>div.input.login>div.display>span.item { font-style:italic; word-break:break-all; border-left:var(--box-notice3); padding-left:var(--button-padding); margin:var(--button-margin) 0; } body>div.input.login>div.display div.sso { cursor:pointer; } body>div.input.login>div.display div.sso div.item { padding:var(--input-padding); } +body.mobile>div.input.login>div.display div.sso div.item.relay { display:none; } body>div.input.login>div.display div.sso div.item:hover { background-color:var(--hover-bg-color); } 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); } diff --git a/lib/user.js b/lib/user.js index 925cb219..5cbc7879 100644 --- a/lib/user.js +++ b/lib/user.js @@ -405,7 +405,7 @@ Volcanos("user", { {text: ["$ "+_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}, hassso && {text: [can.user.trans(can, "or oauth login", "或第三方授权: "), html.LABEL]}, hassso && {view: [["sso", html.FLEX]], list: _msg.Table(function(value) { - return value.type == "oauth" && {view: [[html.ITEM, html.FLEX]], title: value.link, list: [ + return value.type == "oauth" && {view: [[html.ITEM, value.name, html.FLEX]], title: value.link, list: [ {img: can.misc.Resource(can, value.icons)}, {text: can.user.trans(can, value.name, value.help)}, ], onclick: function() { can.user.jumps(can.base.MergeURL(value.link, ice.BACK, location.href)) @@ -419,7 +419,7 @@ Volcanos("user", { ]}]), window.parent != window && window.innerHeight < 480 && can.onmotion.hidden(can, ui.output) can.page.style(can, ui._target, { left: (can.page.width()-ui._target.offsetWidth)/2, - top: can.page.height() < 480? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-can.base.Min(ui._target.offsetHeight, 420)-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT, + top: can.user.isMobile? 20: can.page.height() < 480? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-can.base.Min(ui._target.offsetHeight, 420)-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT, }) } }) diff --git a/panel/footer.css b/panel/footer.css index 1111da92..8baa1c12 100644 --- a/panel/footer.css +++ b/panel/footer.css @@ -32,6 +32,8 @@ div.item:not(.string):not(.number):not(.boolean)>span.value { color:var(--disabl span.item:not(.string):not(.number):not(.boolean)>span.value { color:var(--disable-fg-color); font-style:italic; } fieldset.debug div.output table.content * { font-size:14px; } fieldset.debug span.path { color:silver; font-style:italic; } +html.login body.width1 fieldset.Footer { display:none; } +html.login body.width1 fieldset.Header { display:none; } body.dark fieldset.debug span.path { color:gray; } body.dark fieldset.debug span.target { color:gray; } body.dark div.item:not(.string):not(.number):not(.boolean)>span.value { color:gray; } diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 3271a42a..f741b0b7 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -1,3 +1,4 @@ +fieldset.inner>div.output div.content { position:relative; } fieldset.inner>div.output div.content td.text { height:var(--code-line-height); } fieldset.inner>div.output div.content td.text span.keyword { color:var(--code-keyword); box-shadow:var(--keyword-box-shadow); } fieldset.inner>div.output div.content td.text span.comment { color:var(--code-comment); } @@ -103,4 +104,4 @@ body:not(.windows) fieldset.inner>div.output>div.layout>div.tabs { font-family:v body:not(.windows) fieldset.inner>div.output>div.layout>div.path { font-family:var(--code-font-family); font-size:var(--code-font-size); } body.windows fieldset.inner.cmd>div.output>div.layout>div.tabs>div.icon>div.icon { font-size:20px !important; padding-top:6px; } body.windows fieldset.inner>div.output>div.layout>div.path span.view { margin-top:0; } -body.windows fieldset.inner>div.output>div.layout>div.path span.view { font-style:normal; } \ No newline at end of file +body.windows fieldset.inner>div.output>div.layout>div.path span.view { font-style:normal; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 6df9ffe4..297c483b 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -258,7 +258,7 @@ Volcanos(chat.ONIMPORT, { }) }) }, layout: function(can) { - if (can.Conf(ctx.STYLE) == html.OUTPUT) { return can.page.style(can, can.ui.content, html.WIDTH, (can.Conf("_width")||can.ConfWidth())-5) } + if (can.Conf(ctx.STYLE) == html.OUTPUT) { return can.page.style(can, can.ui.content, html.WIDTH, (can.Conf("_width")||can.ConfWidth())-(can.user.isMobile? 3: 5)) } if (can.isSimpleMode() && !can.page.tagis(can._fields, html.FIELDSET_FLOAT)) { can.page.style(can, can._output, html.MAX_HEIGHT, "") } if (can.isSimpleMode()) { can.ui.layout(can.ConfHeight(), can.ConfWidth()); return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } if (can.isCmdMode()) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(can.page.height())) } diff --git a/plugin/local/wiki/word.js b/plugin/local/wiki/word.js index f7463427..8ad7702c 100644 --- a/plugin/local/wiki/word.js +++ b/plugin/local/wiki/word.js @@ -21,7 +21,7 @@ Volcanos(chat.ONIMPORT, { list: function(can, root, cb, cbs, target) { target = target||can._output can.core.List(root.list, function(item) { var ui = can.page.Append(can, target, [{view: [[html.ITEM, "open"]], list: [{text: item.meta.name}, item.list && {icon: icon.CHEVRON_DOWN}], onclick: function(event) { can.page.ClassList.set(can, ui.item, "open", can.base.isFunc(cb) && cb(event, item) || can.onmotion.toggle(can, ui.list)) - can.onmotion.select(can, target, html.DIV_ITEM, event.target) + can.onmotion.select(can, target, html.DIV_ITEM, event.currentTarget) }, _init: function(target) { if (item.meta.name == "_") { target.innerHTML = "", can.onappend.style(can, html.SPACE, target) } cbs && cbs(target, item) }}, {view: html.LIST}]); can.onimport.list(can, item, cb, cbs, ui.list) }) @@ -77,7 +77,7 @@ Volcanos(chat.ONIMPORT, { }) } }, field: function(can, meta, target) { var item = can.base.Obj(meta.meta), padding = can.Conf(html.PADDING) - var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-4*html.ACTION_HEIGHT-2*padding), width = item.width||can.ConfWidth()-2*padding-2 + var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-4*html.ACTION_HEIGHT-2*padding), width = item.width||can.ConfWidth()-2*padding can.core.Item(item, function(key, value) { if (can.base.beginWith(key, "meta.")) { can.core.Value(item, key, value), delete(item[key]) } }) can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) }) @@ -85,6 +85,7 @@ Volcanos(chat.ONIMPORT, { can.page.style(can, sub._output, html.MAX_HEIGHT, "", "overflow-y", "hidden") sub.sub && sub.sub.ui.content && can.page.style(can, sub.sub.ui.content, html.HEIGHT, "", "overflow-y", "hidden") }, sub.onimport.size(sub, height, width, true) + can.onimport.layout(can) }, can._output, target) }, layout: function(can) { padding = can.Conf(html.PADDING)