1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00

Compare commits

...

6 Commits

Author SHA1 Message Date
shy
b24bdc33f2 add some 2025-03-22 12:54:03 +08:00
shy
4fba3f0a65 opt some 2025-03-15 10:32:07 +08:00
shy
58c1f57814 add some 2025-03-10 18:38:42 +08:00
shy
fb526f0c8e add some 2025-03-08 08:38:23 +08:00
shy
7426ac64cb add some 2025-03-05 23:33:52 +08:00
shy
27b6505a44 add some 2025-03-04 09:58:28 +08:00
8 changed files with 41 additions and 29 deletions

View File

@ -246,6 +246,7 @@ var cli = {
QRCODE: "qrcode", COLOR: "color", BLACK: "black", WHITE: "white", BLUE: "blue", RED: "red", GRAY: "gray", CYAN: "cyan", GREEN: "green", PURPLE: "purple", YELLOW: "yellow",
MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows",
XTERM: "xterm",
SH: "sh",
}
var log = {

View File

@ -444,7 +444,7 @@ Volcanos(chat.ONAPPEND, {
) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT))
type == html.PLUG || (type == html.STORY && item.style != html.FLOAT) ||
// can.base.isIn(can.ConfIndex(), web.DESKTOP, web.MESSAGE, web.VIMER) ||
(name = can.core.Keys(item.space||item._space, name))
(name = can.core.Keys(can.base.trimPrefix(item.space||item._space, can.ConfSpace()), name))
item.index && (item.help = item.help||can.user.trans(can, item.index.split(".").pop(), ""))
var title = item.title || can.user.isMobile && (can.user.isEnglish(can)? name: (item.help||name)) || (!item.help || name == item.help || can.user.isEnglish(can)? name: name+"("+can.core.Split(item.help)[0]+")")
target = can.base.isFunc(target)? target(): target
@ -676,7 +676,7 @@ Volcanos(chat.ONAPPEND, {
if (key == "user_avatar" && value) { _value = img(can.misc.Resource(can, data[key])) }
if (key == "auth_avatar" && value) { _value = img(can.misc.Resource(can, data[key])) }
if (key == nfs.IMAGE && value) { _value = can.core.List(can.core.Split(data[key]), function(item) { return img(can.misc.ShareCache(can, item, data.space)) }).join("") }
if (key == mdb.HASH && can.base.isIn(can.ConfIndex(), web.TOKEN, aaa.SESS)) { _value = value.slice(0, 4)+"****" }
if (key == mdb.HASH && can.base.isIn(can.ConfIndex(), "share", "web.share", web.TOKEN, aaa.SESS)) { _value = value.slice(0, 4)+"****" }
if (key == "secret" && value) { _value = value.slice(0, 4)+"****" }
if (key == "secretKey" && value) { _value = value.slice(0, 4)+"****" }
if (key == "SecretKey" && value) { _value = value.slice(0, 4)+"****" }
@ -899,8 +899,8 @@ Volcanos(chat.ONAPPEND, {
can.onexport.session(can, "profile.show", can.page.isDisplay(can.ui.profile))
if (can.isCmdMode()) { var _width = can.ConfWidth()
can.page.SelectChild(can, can._fields, "legend,form.option,div.header", function(target) { _width -= target.offsetWidth })
can.page.SelectChild(can, can._fields, "div.action", function(target) { can.page.style(can, target, html.MAX_WIDTH, _width-1)
can.page.Select(can, target, "span.name", function(target, index, list) { can.page.style(can, target, html.MAX_WIDTH, (_width-50)/list.length-40) })
can.page.SelectChild(can, can._fields, html.DIV_ACTION, function(target) { can.page.style(can, target, html.MAX_WIDTH, _width-21)
// can.page.Select(can, target, "span.name", function(target, index, list) { can.page.style(can, target, html.MAX_WIDTH, (_width-50)/list.length-40) })
})
}
if (can.page.isDisplay(can.ui.display)) {
@ -1120,12 +1120,16 @@ Volcanos(chat.ONMOTION, {
},
scrollHold: function(can, cb, target) { target = target || can._output; var left = target.scrollLeft; cb(), target.scrollLeft = left },
scrollIntoView: function(can, target, margin, parent) { if (!target) { return }
margin = margin||0, parent = parent||target.parentNode
if (!parent) { return }
if (parent._scroll) { return } parent._scroll = true
var offset = (target.offsetTop-margin) - parent.scrollTop, step = offset < 0? -20: 20
if (Math.abs(offset) > 3000) { return parent.scrollTop = (target.offsetTop-margin), delete(parent._scroll) }
can.core.Timer({interval: 10, length: offset/step}, function() { parent.scrollTop += step }, function() { parent.scrollTop = (target.offsetTop-margin), delete(parent._scroll) })
margin = margin||0, parent = parent||target.parentNode; if (!parent) { return } if (parent._scroll) { return } parent._scroll = true
if (target.offsetHeight == parent.offsetHeight) { margin = margin||10
var offset = (target.offsetLeft-margin) - parent.scrollLeft, step = offset < 0? -20: 20
if (Math.abs(offset) > 3000) { return parent.scrollLeft = (target.offsetLeft-margin), delete(parent._scroll) }
can.core.Timer({interval: 10, length: offset/step}, function() { parent.scrollLeft += step }, function() { parent.scrollLeft = (target.offsetLeft-margin), delete(parent._scroll) })
} else {
var offset = (target.offsetTop-margin) - parent.scrollTop, step = offset < 0? -20: 20
if (Math.abs(offset) > 3000) { return parent.scrollTop = (target.offsetTop-margin), delete(parent._scroll) }
can.core.Timer({interval: 10, length: offset/step}, function() { parent.scrollTop += step }, function() { parent.scrollTop = (target.offsetTop-margin), delete(parent._scroll) })
}
},
clearFloat: function(can) {
var list = ["fieldset.input.float", "div.input.float", "div.carte.float", "div.toast.float"]; for (var i = 0; i < list.length; i++) {

View File

@ -227,11 +227,12 @@ div.output>div.code>div.form { text-align:center; font-size:15px; padding:60px 1
div.output>div.code>div.form>input[type=button] { min-width:200px; }
div.output>div.code>div.form>input[type=button][name=confirm] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); margin:var(--button-margin) 0; }
body.en span[lang^=zh] { display:none; } body.zh span[lang^=en] { display:none; }
fieldset>div.action { position:relative; }
fieldset.plugin.cmd:not(.output)>form.option { float:left; display:flex !important; }
fieldset.plugin.cmd:not(.output)>div.action { float:left; display:flex !important; flex-grow:1; height:var(--action-height); overflow:auto; }
fieldset.plugin.cmd:not(.output)>div.action div.tabs { margin-left:var(--button-margin); }
fieldset.plugin.cmd:not(.output)>div.action div.tabs:last-child { margin-right:var(--button-margin); }
fieldset.plugin.cmd:not(.output)>div.action div.tabs:first-child { margin-left:var(--button-margin); }
fieldset.plugin.cmd:not(.output)>div.action div.tabs.select { padding-top:2px; }
fieldset.plugin.cmd:not(.output)>div.action div.tabs.select { padding-top:2px; color:var(--hover-fg-color); }
fieldset.plugin.cmd:not(.output)>div.action div.tabs>span.name { overflow:hidden; }
fieldset.plugin.cmd:not(.output)>div.header { float:right; display:flex; flex-direction:row-reverse; }
body.width2 fieldset.plugin.cmd:not(.output)>div.header { display:none; }
@ -753,7 +754,7 @@ body:not(.width2):not(.mobile) fieldset.plugin.feel>form.option>div.item.text.fi
body:not(.width2) fieldset>div.action>div.item.text.filter>input { width:var(--input-width); height:30px; transition:all 1.2s; }
body:not(.width2) fieldset>div.action>div.item.text.filter>input:focus { width:var(--project-width); transition:all 0.5s; }
div.item.text.will>input { border:var(--box-notice); }
div.item.text>i:first-child { color:var(--disable-fg-color); position:absolute; left:0; padding:var(--input-padding); }
div.item.text>i:first-child { color:var(--disable-fg-color); line-height:22px; padding:var(--input-padding); position:absolute; left:0; }
body:mobile(.mobile) div.item.text:hover>i:first-child { color:unset; }
div.item.text>span.icon { font-size:var(--icon-font-size); padding:var(--input-padding); position:absolute; right:0; visibility:hidden; }
body:not(.mobile) div.item.text:hover>span.icon { visibility:visible; }
@ -928,6 +929,7 @@ 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.xterm>div.output>div.project div.item.offline { color:var(--disable-fg-color); }
fieldset.xterm.output { background-color:var(--output-bg-color); }
fieldset.xterm.float>div.status { display:none; }
fieldset.xterm.float>form.option>div.item.text { display:none; }
fieldset.full { position:fixed; bottom:unset; }
@ -947,7 +949,7 @@ fieldset.plug.dream.zone>div.output>div.item { display:flex; padding:var(--input
fieldset.plug.dream.zone>div.output>div.item>img { margin-right:var(--input-margin); }
fieldset.plug.dream.zone>div.output>div.item>span { line-height:var(--action-height); }
fieldset.plug.dream.zone>div.output>div.item.origin.select { border-right:var(--box-danger3); }
fieldset.web.stats>div.output { align-items: normal; }
fieldset.web.stats>div.output { align-items:normal; }
fieldset.web.code.git>div.output>fieldset.web.code.inner>div.output { overflow:auto; }
fieldset.web.code.git.total.draw div.output { text-align:center; }
fieldset.web.code.git.trend>div.output rect { cursor:pointer; }
@ -966,6 +968,7 @@ fieldset.web.chat.location>div.output>div.layout>div.layout { position:relative;
fieldset.web.chat.location>div.output .amap-toolbar { z-index:unset; }
fieldset.web.chat.location>div.output .amap-controls { z-index:unset; }
fieldset.web.chat.location>div.output .amap-maptypecontrol { z-index:unset; }
fieldset.web.code.compose.insight>div.output { max-height:unset !important; height:unset !important; overflow:hidden; }
fieldset.web.chat.location>div.output>div.layout>div.layout>div.profile { background-color:var(--plugin-bg-color); position:absolute; right:0; width:360px; z-index:2; border-left:none; }
fieldset.web.chat.color table.content { border-collapse:collapse; }
fieldset.web.mall.region>div.output>table.content td:nth-child(3) { text-align:right; }

View File

@ -61,15 +61,15 @@ Volcanos("user", {
close: function(url) { return window.close() },
theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || []
name.push(html.WIDTH+parseInt((can.page.width()+32)/320))
can.misc.isDebug(can) && name.push(log.DEBUG)
can.user.info.userrole && name.push(can.user.info.userrole)
can.user.language(can) && name.push(can.core.Split(can.user.language(can), "-_.")[0])
can.user.mod.isCmd && name.push(chat.CMD), can.user.mod.cmd && name.push(can.user.mod.cmd.replaceAll(".", " "))
can.user.isWeiXin && name.push("weixin")
can.user.mod.isCmd && name.push(chat.CMD), can.user.mod.cmd && name.push(can.base.replaceAll(can.user.mod.cmd, ".", " "))
// if (window.innerWidth <= 1080) { can.user.isIPad = true }
can.user.isIPad && name.push("pad") && can.user.isLandscape() && name.push(html.LANDSCAPE)
can.user.isMobile && name.push(html.MOBILE) && can.user.isLandscape() && name.push(html.LANDSCAPE)
can.user.isWindows && name.push(html.WINDOWS), can.user.isWebview && name.push(html.WEBVIEW)
can.user.isMobile && name.push(html.MOBILE) && can.user.isLandscape() && name.push(html.LANDSCAPE)
can.user.isWeiXin && name.push("weixin")
can.user.language(can) && name.push(can.core.Split(can.user.language(can), "-_.")[0])
can.user.info.userrole && name.push(can.user.info.userrole)
can.misc.isDebug(can) && name.push(log.DEBUG)
can.page.styleClass(can, document.body, name.join(lex.SP))
},
title: function(text) {

View File

@ -1,10 +1,10 @@
Volcanos(chat.ONFIGURE, {img: {
_init: function(can, meta, target) { target.value == meta.value && (target.value = ""); var images = can.core.Split(target.value)
var count = parseInt(meta.value||"1"), width = target.parentNode.offsetWidth; for (var n = 1; n < 10; n++) { if (n*n >= count) { width = (width/n-10); break } }
function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: can.base.MergeURL(can.misc.MergeURL(can, {_path: web.SHARE_CACHE+hash}, true), {pod: meta.space||undefined}), height: width, width: width}]) }
// function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: can.base.MergeURL(can.misc.MergeURL(can, {_path: web.SHARE_CACHE+hash}, true), {pod: meta.space||undefined}), height: width, width: width}]) }
function add(target, hash) { target._hash = hash, can.page.Appends(can, target, [{img: hash, height: width, width: width}]) }
function set() { target.value = can.page.SelectChild(can, target.parentNode, html.DIV, function(target) { return target._hash }).join(mdb.FS) }
can.onmotion.hidden(can, target)
can.onappend.style(can, html.FLEX, target.parentNode)
can.onmotion.hidden(can, target), can.onappend.style(can, html.FLEX, target.parentNode)
for (var i = 0; i < count; i++) {
can.page.Append(can, target.parentNode, [{view: html.FLEX, style: {
"clear": i%n == 0? "both": "none", height: width, width: width,

View File

@ -280,8 +280,9 @@ Volcanos(chat.ONSYNTAX, {
"not": code.DATATYPE, "first-child": code.DATATYPE, "last-child": code.DATATYPE, "nth-child": code.DATATYPE,
"placeholder": code.DATATYPE, "hover": code.DATATYPE, "focus": code.DATATYPE,
"$content": code.KEYWORD, "$profile": code.KEYWORD, "$display": code.KEYWORD, "$project": code.KEYWORD,
"$body": code.KEYWORD, "$fieldset": code.KEYWORD,
"$option": code.KEYWORD, "$action": code.KEYWORD, "$output": code.KEYWORD, "$status": code.KEYWORD,
"$content": code.KEYWORD, "$profile": code.KEYWORD, "$display": code.KEYWORD, "$project": code.KEYWORD,
"output": code.KEYWORD,
"background-color": code.FUNCTION, "color": code.FUNCTION,

View File

@ -46,6 +46,7 @@ Volcanos(chat.ONIMPORT, {
if (arg[1] == "~~~end~~~") { arg[0] == "current"? can.sup.onmotion._close({}, can.sup): can.sup.onimport._back(can.sup) } else { term.write(arg[1]) }
},
layout: function(can) {
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function() {
can.core.Item(can.db, function(hash, term) { term._fit && term._fit.fit() })
can.db.value && can.db.value._term && can.onexport.term(can, can.db.value._term)

View File

@ -138,13 +138,13 @@ Volcanos(chat.ONIMPORT, {
return {view: [[html.ITEM, item.type, item.role, item.status]], title: item.title||item.nick, list: [
can.onimport._icons(can, item),
].concat(can.onimport._nick(can, item), item._label||[], [
item.action && {icon: "bi bi-three-dots", onclick: function(event) { can.onimport._menu(event, can, item, cbs) }},
(item.action||cbs) && {icon: "bi bi-three-dots", onclick: function(event) { can.onimport._menu(event, can, item, cbs) }},
]), _init: function(target) { target._item = item, item._item = target, can.ui[item.path] = target
item._select && can.onmotion.delay(can, function() { target.click() })
}, onclick: function(event) {
if (cb(event)) { return }
can.db.value = item, can.onexport.hash(can, item._hash)
item.__title? can.user.title(item.__title): can.onexport.title(can, item._title)
cb(event)
}, oncontextmenu: function(event) {
can.onimport._menu(event, can, item, cbs)
}}
@ -153,7 +153,8 @@ Volcanos(chat.ONIMPORT, {
return can.page.Append(can, _target||can.ui.project||can._output, [can.onimport._item(can, item, function(event) { var target = event.currentTarget
can.onmotion.select(can, target.parentNode, html.DIV_ITEM, target)
can.onengine.signal(can, "onproject", can.request(event, {type: "item", query: can.page.getquery(can, can._fields)+","+item.path}))
var show = target._list && can.onmotion.toggle(can, target._list); if (show === false) { return } cb(event, item, show, target)
var show = target._list && can.onmotion.toggle(can, target._list); if (show === false) { return true }
return cb(event, item, show, target)
}, cbs)])._target
},
_itemselect: function(can, target) {
@ -165,8 +166,9 @@ Volcanos(chat.ONIMPORT, {
if (!target._list) { target._list = can.page.insertBefore(can, [html.LIST], target.nextSibling, target.parentNode) }
return can.page.Append(can, target._list, can.core.List(list, function(item) {
return can.onimport._item(can, item, function(event) { var target = event.currentTarget
if (target._list && target._list.childElementCount > 0 && target._list && can.onmotion.toggle(can, target._list) == false) { return }
can.onimport._itemselect(can, target), cb && cb(event, item, target._list && true, target)
if (target._list && target._list.childElementCount > 0 && target._list && can.onmotion.toggle(can, target._list) == false) { return true }
if (cb && cb(event, item, target._list && true, target)) { return }
can.onimport._itemselect(can, target)
}, cbs)
})), target._list
},