1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-02-05 13:47:44 +08:00
parent 89df38d885
commit dd058c0fd4
6 changed files with 39 additions and 32 deletions

View File

@ -740,8 +740,8 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
var margin = 2*html.PLUGIN_PADDING; width = width||html.CARD_WIDTH, height = height||html.CARD_HEIGHT
var n = parseInt(target.offsetWidth/(width+margin))||1; width = target.offsetWidth/n - margin
if (width+margin >= target.offsetWidth) { n = 1, width = target.offsetWidth - margin }
var m = parseInt(target.offsetHeight/(height+margin))||1; height = target.offsetHeight/m - margin
if (height+margin >= target.offsetHeight) { n = 1, height = target.offsetHeight - margin }
var m = parseInt(target.offsetHeight/(height+margin))||1; m > 2 && (height = target.offsetHeight/m - margin)
if (height+margin >= target.offsetHeight) { m = 1, height = target.offsetHeight - margin }
height = can.base.Min(height, html.CARD_HEIGHT), width = can.base.Min(width, html.CARD_WIDTH)
can.page.SelectChild(can, target, item||html.DIV_ITEM, function(target) {
can.page.styleHeight(can, target, height), can.page.styleWidth(can, target, width)
@ -763,9 +763,9 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
}
if (layout.left+target.offsetWidth > left+width-20) {
if (right) {
layout.left = rect.left-target.offsetWidth
layout.left = rect.left-target.offsetWidth-1
} else {
layout.left = left+width-target.offsetWidth
layout.left = left+width-target.offsetWidth-1
}
}
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
@ -893,7 +893,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
var key = can.base.Time(null, "%H:%M:%S.%s"); list[key] = {}, list[key] = can.onmotion.delay(can, function() { list[key] && cb() }, interval)||{}
},
delay: function(can, cb, interval, key) {
if (!key) { if (interval === 0) { return cb() }
if (!key) { if (interval === 0 || interval < 0) { return cb() }
return can.core.Timer(interval||30, cb)
}
can._delay_list = can._delay_list||shy({}, [])
@ -975,11 +975,12 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
}
}
},
orderShow: function(can, target, key) { if (can.user.isMobile) { return }
orderShow: function(can, target, key, limit, delay) {
if (can.user.isMobile) { return } target = target||can._output, limit = limit||50, delay = delay||50
var list = can.page.SelectChild(can, target, key||html.DIV_ITEM, function(target) { can.page.style(can, target, html.VISIBILITY, html.HIDDEN); return target })
can.core.Next(list, function(target, next, index) {
if (index < 30) {
can.page.style(can, target, html.VISIBILITY, ""), can.onmotion.delay(can, next, list.length > 3? 80: 0)
if (index < limit) {
can.page.style(can, target, html.VISIBILITY, ""), can.onmotion.delay(can, next, list.length > 3? delay: 0)
} else {
can.core.List(list, function(target) { can.page.style(can, target, html.VISIBILITY, "") })
}

View File

@ -53,7 +53,7 @@ body {
--header-height:48px; --footer-height:var(--action-height); --action-height:32px; --status-height:var(--action-height);
--river-width:var(--project-width); --project-width:230px; --input-width:120px; --button-width:60px; --form-width:320px;
--textarea-height:96px; --qrcode-height:364px; --iframe-height:420px;
--card-height:145px; --card-width:320px;
--card-height:160px; --card-width:320px;
--story-height:var(--float-height); --float-height:480px; --float-width:1200px;
--plug-height:var(--float-height); --plug-width:var(--float-width);
--desktop-height:684px; --desktop-width:var(--float-width); --desktop-icon-size:80px;
@ -149,14 +149,14 @@ body.en span[lang^=zh] { display:none; } body.zh span[lang^=en] { display:none;
div.project div.action { width:100%; }
div.project div.list { margin-left:var(--button-margin); clear:both; }
div.project div.list fieldset { position:static; }
div.project div.item { white-space:pre; line-height:24px; padding:0 var(--button-margin); display:flex; align-items:center; }
div.project div.item:not(.hide) { white-space:pre; line-height:24px; padding:0 var(--button-margin); display:flex; align-items:center; }
div.project div.item img { margin:var(--input-margin) !important; height:var(--action-height); width:var(--action-height); }
div.project div.item.filter { padding:0; width:100%; }
div.project div.item.filter>input { padding:0 25px; width:100%; }
div.project div.item.search { padding:0; width:100%; }
div.project div.item.search>input { padding:0 25px; width:100%; }
div.project div.item.expand { margin-right:var(--input-margin); float:left; transition:all .5s; }
div.project div.item.expand.open { translate:1px 2px; rotate:90deg; transition:all .3s; }
div.project div.expand { margin-right:var(--input-margin); float:left; transition:all .5s; }
div.project div.expand.open { translate:1px 2px; rotate:90deg; transition:all .3s; }
div.project div.item>div.name { padding-left:var(--button-padding); }
div.project div.zone>div.item { text-align:center; padding:var(--input-padding); display:flex; align-items:center; }
div.project div.zone>div.item span:hover { background-color:var(--hover-bg-color); }
@ -288,9 +288,9 @@ div.action, div.output, div.status, div.project, div.content, div.profile, div.d
legend, form.option>div.item, div.action>div.item, div.action>div.tabs, fieldset>div.status>div.item { float:left; display:flex; align-items:center; }
fieldset.story, fieldset>div.output, fieldset>div.status, div.output>div.project div.item, div.content:not(.item), div.code, div.story[data-type=spark] { clear:both; }
fieldset.story { position:sticky; left:0; }
fieldset.plug { position:absolute; bottom:0; right:0; }
fieldset.full { position:fixed; left:0; top:0; }
fieldset.full, fieldset.float { position:fixed; z-index:10; }
fieldset.full { position:fixed; left:0; top:0; }
fieldset.plug { position:absolute; bottom:0; right:0; }
div.float { position:fixed; z-index:100; }
div.output { position:relative; } div.content { position:relative; }
div.output>div.code { position:sticky; left:0; }
@ -475,7 +475,7 @@ fieldset.plug>div.status { height:31px; }
i.bi.bi-toggle-on { color:var(--notice-bg-color); }
i.bi.bi-toggle-on:hover { color:var(--notice-bg-color); }
fieldset>legend>i { margin-right:var(--input-margin); }
form.option>div.item.icon { position:relative; height:var(--action-height); overflow:hidden; }
form.option>div.item.icon { position:relative; height:var(--action-height); overflow:hidden; user-select:none; }
form.option>div.item.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); }
form.option>div.item.icon.menu { font-size:28px; line-height:26px; display:flex; align-items:flex-start; display:none; }
form.option>div.item.icon.refresh { font-size:28px; line-height:26px; display:flex; align-items:flex-start; }

View File

@ -23,6 +23,7 @@ fieldset.Header>div.output div.search>input { padding-left:25px; }
fieldset.Header>div.output div.search>span.icon { padding:var(--input-padding) var(--button-padding); }
fieldset.Header>div.output div.Action>div.tabs { padding-left:40px; height:100%; overflow:auto; }
fieldset.Header>div.output div.Action>div.tabs div.item { font-style:italic; }
fieldset.Header>div.output div.Action>div.tabs div.item.select { border-bottom:var(--notice-bg-color) solid 3px; }
fieldset.Header>div.output div.Action>div.tabs div.item:only-child { display:none; }
body:not(.mobile) fieldset.Header>div.output div.title:first-child { width:var(--river-width); }
body:not(.mobile) fieldset.Header>div.output div.title img { margin-right:var(--button-margin); }

View File

@ -16,9 +16,10 @@ fieldset.inner>div.output>div.project div.zone.space>div.list div.output>div.ite
fieldset.inner>div.output>div.project div.zone.repos>div.list div.output>div.item { margin:0; width:100% !important; }
fieldset.inner>div.output>div.project div.zone.repos>div.list div.output>div.item:hover { background-color:var(--hover-bg-color); }
fieldset.inner>div.output>div.layout>div.tabs { font-size:var(--code-font-size); display:none; }
fieldset.inner>div.output>div.layout>div.tabs>div:hover { background-color:unset; color:unset; box-shadow:unset; }
fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs { padding-right:0; margin-left:5px; }
fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs:hover { background-color:var(--output-bg-color); border-top-left-radius:var(--plugin-radius); border-top-right-radius:var(--plugin-radius); box-shadow:var(--box-shadow); }
fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs.select { background-color:var(--output-bg-color); border-top-left-radius:var(--plugin-radius); border-top-right-radius:var(--plugin-radius); border-bottom:lightgray solid 2px; box-shadow:var(--box-shadow);}
fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs:hover { background-color:var(--output-bg-color); color:unset; border-top-left-radius:var(--plugin-radius); border-top-right-radius:var(--plugin-radius); box-shadow:var(--box-shadow); }
fieldset.inner>div.output>div.layout>div.tabs>div.tabs>div.tabs.select { background-color:var(--output-bg-color); color:unset; border-top-left-radius:var(--plugin-radius); border-top-right-radius:var(--plugin-radius); border-bottom:lightgray solid 2px; box-shadow:var(--box-shadow);}
fieldset.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:none; }
fieldset.inner.float>div.output>div.layout>div.path { font-size:var(--code-font-size); display:flex; }
fieldset.Action.tabview fieldset.plugin.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:flex; }
@ -60,7 +61,8 @@ body:not(.mobile) fieldset.inner>div.output>div.layout>fieldset.plug { bottom:va
fieldset.inner>div.output>div.layout>div.path span.space { flex-grow:1; }
fieldset.inner>div.output>div.layout>div.path span.view { font-size:22px; padding:0 var(--input-padding); margin-top:-5px; float:right; }
fieldset.inner>div.output>div.layout>fieldset.plug.output { white-space:pre; }
fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); position:fixed; right:0; bottom:0; overflow:auto; }
/* fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); position:fixed; right:0; bottom:0; overflow:auto; } */
fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); overflow:auto; }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { font-size:var(--legend-font-size); font-style:italic; float:right; }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { padding:0 var(--input-padding); }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove { padding:var(--input-padding); }

View File

@ -1,6 +1,5 @@
Volcanos(chat.ONIMPORT, {
_process: function(can, msg) {
if (msg.IsErr()) { can.user.toastFailure(can, msg.Result()); }
_process: function(can, msg) { if (msg.IsErr()) { can.user.toastFailure(can, msg.Result()); }
if (can.onimport[msg.OptionProcess()]) { return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, sub: can.sub, msg: msg, arg: msg.Option("_arg")}), true } },
_location: function(can, msg, arg) { can.user.jumps(arg) },
_replace: function(can, msg, arg) { location.replace(arg) },

View File

@ -65,11 +65,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
can.runAction(event, button), carte.close()
}): can.onmotion.clearCarte(can)
}},
{view: html.ACTION, _init: function(target) { zone._action = target
can.onappend._action(can, [{icon: icon.SEARCH, type: html.TEXT, name: mdb.SEARCH, _init: function(target) { zone._search = target }, onkeyup: function(event) {
if (event.target.value == "") { can.page.Select(can, zone._target, html.DIV_EXPAND, function(target) { can.page.ClassList.del(can, target, cli.OPEN) }) }
can.page.Select(can, zone._target, html.DIV_LIST, function(item) { can.onmotion.toggle(can, item, event.target.value != "") })
can.onmotion.delayOnce(can, function() { can.onkeymap.selectItems(event, can, zone._target) }, event.target.value.length<3? 500: 150)
{view: html.ACTION, _init: function(target) { var value; zone._action = target
can.onappend._action(can, [{icon: icon.SEARCH, type: html.TEXT, name: mdb.SEARCH, _init: function(target) { zone._search = target }, onkeyup: function(event) { value = event.target.value
can.page.Select(can, zone._target, html.DIV_EXPAND, function(target) { can.page.ClassList.set(can, target, cli.OPEN, value != "") })
can.page.Select(can, zone._target, html.DIV_LIST, function(item) { can.onmotion.toggle(can, item, value != "") })
can.onmotion.delayOnce(can, function() { value && can.onkeymap.selectItems(event, can, zone._target) }, value.length<3? 500: 150)
}}], target, {})
}},
{view: html.LIST, _init: function(target) { can.ui.zone = can.ui.zone||{}, can.ui.zone[zone.name] = zone, zone._target = target
@ -87,19 +87,23 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
_icon: function(can, name, button, target) { can.page.Append(can, target, [{text: [can.page.unicode[name]||name, html.SPAN, [html.ICON, name]], onclick: function(event) {
can.base.isFunc(button)? button(event, button): can.onaction[button](event, can, button), can.onkeymap.prevent(event)
}}]) },
icon: function(can, msg, target, cb) { return msg.Table(function(value) {
var icon = can.misc.Resource(can, value.icon||can.page.drawText(can, value.name, 80), value.space||can.ConfSpace())
return can.page.Append(can, target, [{view: [[html.ITEM, value.status]], list: [{view: html.ICON, list: [{img: icon}]}, {view: [mdb.NAME, "", value.name]}], _init: function(target) {
cb && cb(target, value)
}, onclick: function(event) { can.sup.onexport.record(can.sup, value.name, mdb.NAME, value) }}])._target
}) },
icon: function(can, msg, target, cb) {
msg.Table(function(value) {
var icon = can.misc.Resource(can, value.icon||can.page.drawText(can, value.name, 80), value.space||can.ConfSpace())
return can.page.Append(can, target, [{view: [[html.ITEM, value.status]], list: [{view: html.ICON, list: [{img: icon}]}, {view: [mdb.NAME, "", value.name]}], _init: function(target) {
cb && cb(target, value)
}, onclick: function(event) { can.sup.onexport.record(can.sup, value.name, mdb.NAME, value) }}])._target
})
can.onmotion.orderShow(can, target)
},
tree: function(can, list, field, split, cb, target, node) { node = node||{"": target}
can.core.List(list, function(item) { item[field] && can.core.List(item[field].split(split), function(value, index, array) { if (!value) { return }
var last = array.slice(0, index).join(split), name = array.slice(0, index+1).join(split); if (node[name]) { return }
var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [
{view: [[html.EXPAND, item.expand? cli.OPEN: ""], html.DIV, (index==array.length-1? "": can.page.unicode.closes)]},
{view: [mdb.NAME, html.DIV, value], _init: item._init},
], onclick: function(event) { if (node[name].childElementCount == 2) { node[name].firstChild.click() }
], onclick: function(event) {
if (node[name].childElementCount == 2) { node[name].firstChild.click() }
index < array.length - 1? can.page.ClassList.set(can, ui[html.EXPAND], cli.OPEN, !can.page.ClassList.neg(can, node[name], html.HIDE)): can.base.isFunc(cb) && cb(event, item)
}, oncontextmenu: function(event) { if (!item._menu) { return }
var menu = item._menu; can.user.carteRight(event, can, menu.meta, menu.list, menu)