From e7933a68f3337e8052c176939640b5ce6bccdad3 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 2 Dec 2023 22:58:26 +0800 Subject: [PATCH] add some --- frame.js | 1 + panel/river.css | 2 +- panel/river.js | 13 +++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frame.js b/frame.js index 89f15b6e..6a458602 100644 --- a/frame.js +++ b/frame.js @@ -632,6 +632,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) { _hash: { spark: function(can, meta, target) { meta[mdb.NAME] == html.INNER? can.onmotion.copy(can, target): can.page.Select(can, target, "kbd", function(item) { can.onmotion.copy(can, item, function(event) { + if (can.base.beginWith(item.innerText, "open http")) { return can.user.open(can.core.Split(item.innerText)[1]) } if (event.metaKey) { if (item.innerText.indexOf(web.HTTP) == 0) { return can.user.open(item.innerText) } if (item.innerText.indexOf("vim ") == 0) { diff --git a/panel/river.css b/panel/river.css index 1e378aca..fa0e4639 100644 --- a/panel/river.css +++ b/panel/river.css @@ -1,5 +1,5 @@ fieldset.River { width:var(--river-width); float:left; position:relative; } -fieldset.River>div.action:not(.hide) { margin-top:var(--plugin-margin); width:100%; } +fieldset.River>div.action:not(.hide) { margin-top:var(--plugin-margin); width:100%; position:absolute; } fieldset.River>div.output { transition:all .3s; } fieldset.River>div.output div.item { font-family:var(--legend-font-family); padding:var(--legend-padding); border-left:#00ffae solid 3px; } fieldset.River>div.output div.item:hover { color:var(--panel-hover-fg-color); } diff --git a/panel/river.js b/panel/river.js index 08d7ead2..ff010660 100644 --- a/panel/river.js +++ b/panel/river.js @@ -54,10 +54,15 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func can.runAction(event, mdb.CREATE, args, function(msg) { can.misc.Search(can, {river: msg.Result()}) }) }) }, share: function(event, can) { can.core.CallFunc(can.ondetail.share, {event: event, can: can}) }, - onsize: function(can, height) { var margin = "0px", _margin = 0; can.page.style(can, can._output, html.MARGIN, "0px", html.HEIGHT, "") - if (can.page.isDisplay(can._action)) { _margin = can._action.offsetHeight + html.PLUGIN_MARGIN } - if (can._output.offsetHeight < height) { margin = can.base.Min((height-_margin-can._output.offsetHeight)/2, _margin)+"px 0px" } - height && can.page.style(can, can._output, html.MARGIN, margin, html.HEIGHT, can.base.Max(can._output.offsetHeight, height-_margin)) + onsize: function(can, height) { var margin = 0 + if (can.page.isDisplay(can._action)) { margin = can._action.offsetHeight + html.PLUGIN_MARGIN } + can.page.style(can, can._output, html.MARGIN, "0px", html.HEIGHT, "", html.MAX_HEIGHT, "") + if (can._output.offsetHeight < height-margin) { + margin += (height-margin-can._output.offsetHeight)/2 + } else { + can.page.style(can, can._output, html.MAX_HEIGHT, height-margin) + } + can.page.style(can, can._output, html.MARGIN, margin+"px 0px 0px") can.onexport.scroll(can) }, refresh: function(event, can) { can.misc.Search(can, {river: can.Conf(chat.RIVER), storm: can.Conf(chat.STORM)}) },