From 72a558797eb45fea2845f14047c01b7fb04d86c5 Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 21 May 2024 23:46:00 +0800 Subject: [PATCH] add some --- frame.js | 10 ++++++++-- index.css | 14 ++++++-------- plugin/local/code/inner.js | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/frame.js b/frame.js index d44a5dc2..2301e454 100644 --- a/frame.js +++ b/frame.js @@ -695,14 +695,14 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { var height = can.base.Min(target.offsetHeight*target.offsetHeight/target.scrollHeight, target.offsetHeight/4) vbar.innerHTML = `${(target.scrollTop*100/(target.scrollHeight-target.offsetHeight)).toFixed(2)}%` target.scrollHeight > target.offsetHeight && can.page.style(can, vbar, html.VISIBILITY, html.VISIBLE, - html.HEIGHT, height, html.RIGHT, target == can.ui.content? 0: -target.scrollLeft, + html.HEIGHT, height, html.RIGHT, target == can.ui.content? undefined: -target.scrollLeft, html.TOP, target == can.ui.content? target.scrollTop/(target.scrollHeight-target.offsetHeight)*(target.offsetHeight-height): can.base.Max(target.scrollTop+target.scrollTop/(target.scrollHeight-target.offsetHeight)*(target.offsetHeight-height)-10, target.scrollHeight-height), ) var width = can.base.Min(target.offsetWidth*target.offsetWidth/target.scrollWidth, target.offsetWidth/4) hbar.innerHTML = `${(target.scrollLeft*100/(target.scrollWidth-target.offsetWidth)).toFixed(2)}%` target.scrollWidth > target.offsetWidth+10 && can.page.style(can, hbar, html.VISIBILITY, html.VISIBLE, - html.WIDTH, width, html.BOTTOM, target == can.ui.content? 0: -target.scrollTop, + html.WIDTH, width, html.BOTTOM, target == can.ui.content? undefined: -target.scrollTop, html.LEFT, target == can.ui.content? target.scrollLeft/(target.scrollWidth-target.offsetWidth)*(target.offsetWidth-width): target.scrollLeft+target.scrollLeft/(target.scrollWidth-target.offsetWidth)*(target.offsetWidth-width), ) @@ -795,6 +795,12 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { } can.db.value._content_plugin && can.db.value._content_plugin.onimport.size(can.db.value._content_plugin, height, width, false) if (can.ui.toggle) { can.ui.toggle.layout(), can.page.style(can, can.ui.toggle.profile, "right", can.ui.profile.offsetWidth+"px") } + can.ui.content && can.page.SelectChild(can, can.ui.content.parentNode, "div.scrollbar.vertical", function(target) { + can.page.style(can, target, "right", can.ui.profile.offsetWidth) + }) + can.ui.content && can.page.SelectChild(can, can.ui.content.parentNode, "div.scrollbar.horizon", function(target) { + can.page.style(can, target, "bottom", can.ui.display.offsetHeight) + }) } cb && cb(content_height, content_width) }, delay||0) } can.onimport.layout = can.onimport.layout||function(can) { diff --git a/index.css b/index.css index e6fbfa5e..c204b025 100644 --- a/index.css +++ b/index.css @@ -633,7 +633,7 @@ fieldset>div.action div.item.filter input { padding-left:24px; } fieldset>div.action div.item.state.filter input { width:120px; transition:all 0.8s; } fieldset>div.action div.item.state.filter input:focus { width:240px; transition:all 0.5s; } fieldset>div.action div.item { height:var(--action-height); } -fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height); } +fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); padding-right:0; height:var(--action-height); } fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height); min-width:60px; text-align:center; justify-content:center; align-items:center; } fieldset>div.output>div.code { font-size:var(--code-font-size); } fieldset>div.output { width:100%; } fieldset>div.status { width:100%; } @@ -833,15 +833,13 @@ body.print fieldset.draw div.output div.content svg { background-color:lightgray /* misc */ fieldset.iframe>form.option>div.item.hash input { width:var(--form-width); } fieldset.iframe.float>form.option>div.item.hash input { width:var(--form-width); } +fieldset.iframe>div.status { display:none; } fieldset.desktop { border:0; } fieldset.desktop>legend { background-color:transparent; color:silver; } -fieldset.desktop>form.option input { background-color:transparent; } -fieldset.desktop>div.action input { background-color:transparent; } -fieldset.desktop>form.option { color:silver; } +fieldset.desktop>form.option>div.item:not(.delete) { display:none; } +fieldset.desktop>div.action>div.item.text input { display:none; } fieldset.desktop>div.action { color:silver; } -fieldset.desktop>div.status { color:silver; } -fieldset.desktop.float>form.option>div.item:not(.delete) { display:none; } -fieldset.desktop.float>div.status { display:none; } +fieldset.desktop>div.status { display:none; } fieldset.qrcode>div.output div.code { padding:0; } fieldset.xterm>div.output>div.project { font-family:var(--code-font-family); } fieldset.vimer>div.output>div.project div.item.modify { background-color:#00800036; } @@ -951,7 +949,7 @@ fieldset.Action>div.output>fieldset.ssh.cloud.profile:hover { box-shadow:none; } fieldset.Action>div.output>fieldset.ssh.cloud.profile>div.output { background-color:transparent; } fieldset.Action:not(.horizon):not(.grid)>fieldset.plugin>form.option>div.item.text.path>input { width:var(--project-width); } body:not(.debug) fieldset.plugin.can._notfound { display:none; } -body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend { border-top:var(--box-notice3); border-top-left-radius:0; } +body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend { border-top:var(--box-notice3); border-top-left-radius:0; margin-right:var(--legend-margin); } body:not(.cmd) fieldset.Action>div.output>fieldset.plugin>legend:not(:hover) { background-color:var(--output-bg-color); } body:not(.dark) fieldset.draw.trends div.output svg { background-color:#1b5b738c; } body.width6 fieldset.plugin.word>form.option>div.item.text>input { width:var(--project-width); } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 797e3acf..929ab6f1 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -14,6 +14,7 @@ Volcanos(chat.ONIMPORT, { can.ui = can.onappend.layout(can, [html.PROJECT, [html.TABS, nfs.PATH, [html.CONTENT, html.PROFILE], html.DISPLAY, html.PLUG]]) can.ui._content = can.ui.content, can.ui._profile = can.ui.profile, can.ui._display = can.ui.display can.onmotion.clear(can, can.ui.project), can.onmotion.hidden(can, can.ui.project), can.onmotion.hidden(can, can.ui.tabs), can.onmotion.hidden(can, can.ui.plug) + can.db.value = {} var show = !can.user.isMobile switch (can.Mode()) { case chat.SIMPLE: // no break