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

Compare commits

...

7 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
shy
2da6711ce3 add some 2025-03-03 18:39:54 +08:00
9 changed files with 43 additions and 36 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", 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", MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows", LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows",
XTERM: "xterm",
SH: "sh", SH: "sh",
} }
var log = { var log = {

View File

@ -444,7 +444,7 @@ Volcanos(chat.ONAPPEND, {
) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT)) ) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT))
type == html.PLUG || (type == html.STORY && item.style != html.FLOAT) || type == html.PLUG || (type == html.STORY && item.style != html.FLOAT) ||
// can.base.isIn(can.ConfIndex(), web.DESKTOP, web.MESSAGE, web.VIMER) || // 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(), "")) 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]+")") 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 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 == "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 == "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 == 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 == "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)+"****" }
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)) can.onexport.session(can, "profile.show", can.page.isDisplay(can.ui.profile))
if (can.isCmdMode()) { var _width = can.ConfWidth() 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, "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.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) }) // 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)) { 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 }, 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 } scrollIntoView: function(can, target, margin, parent) { if (!target) { return }
margin = margin||0, parent = parent||target.parentNode margin = margin||0, parent = parent||target.parentNode; if (!parent) { return } if (parent._scroll) { return } parent._scroll = true
if (!parent) { return } if (target.offsetHeight == parent.offsetHeight) { margin = margin||10
if (parent._scroll) { return } parent._scroll = true var offset = (target.offsetLeft-margin) - parent.scrollLeft, step = offset < 0? -20: 20
var offset = (target.offsetTop-margin) - parent.scrollTop, step = offset < 0? -20: 20 if (Math.abs(offset) > 3000) { return parent.scrollLeft = (target.offsetLeft-margin), delete(parent._scroll) }
if (Math.abs(offset) > 3000) { return parent.scrollTop = (target.offsetTop-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) })
can.core.Timer({interval: 10, length: offset/step}, function() { parent.scrollTop += step }, function() { parent.scrollTop = (target.offsetTop-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) { 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++) { 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] { 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; } 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; } 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)>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 { 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: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; color:var(--hover-fg-color); }
fieldset.plugin.cmd:not(.output)>div.action div.tabs.select { padding-top:2px; }
fieldset.plugin.cmd:not(.output)>div.action div.tabs>span.name { overflow:hidden; } 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; } 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; } 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 { 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; } 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.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; } 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; } 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; } 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.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 { font-family:var(--code-font-family); }
fieldset.xterm>div.output>div.project div.item.offline { color:var(--disable-fg-color); } 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>div.status { display:none; }
fieldset.xterm.float>form.option>div.item.text { display:none; } fieldset.xterm.float>form.option>div.item.text { display:none; }
fieldset.full { position:fixed; bottom:unset; } 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>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>span { line-height:var(--action-height); }
fieldset.plug.dream.zone>div.output>div.item.origin.select { border-right:var(--box-danger3); } 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>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.total.draw div.output { text-align:center; }
fieldset.web.code.git.trend>div.output rect { cursor:pointer; } 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-toolbar { z-index:unset; }
fieldset.web.chat.location>div.output .amap-controls { 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.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.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.chat.color table.content { border-collapse:collapse; }
fieldset.web.mall.region>div.output>table.content td:nth-child(3) { text-align:right; } 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() }, close: function(url) { return window.close() },
theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || [] theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || []
name.push(html.WIDTH+parseInt((can.page.width()+32)/320)) name.push(html.WIDTH+parseInt((can.page.width()+32)/320))
can.misc.isDebug(can) && name.push(log.DEBUG) can.user.mod.isCmd && name.push(chat.CMD), can.user.mod.cmd && name.push(can.base.replaceAll(can.user.mod.cmd, ".", " "))
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")
// if (window.innerWidth <= 1080) { can.user.isIPad = true } // if (window.innerWidth <= 1080) { can.user.isIPad = true }
can.user.isIPad && name.push("pad") && can.user.isLandscape() && name.push(html.LANDSCAPE) 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.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)) can.page.styleClass(can, document.body, name.join(lex.SP))
}, },
title: function(text) { title: function(text) {

View File

@ -1,10 +1,10 @@
Volcanos(chat.ONFIGURE, {img: { Volcanos(chat.ONFIGURE, {img: {
_init: function(can, meta, target) { target.value == meta.value && (target.value = ""); var images = can.core.Split(target.value) _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 } } 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) } 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.onmotion.hidden(can, target), can.onappend.style(can, html.FLEX, target.parentNode)
can.onappend.style(can, html.FLEX, target.parentNode)
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
can.page.Append(can, target.parentNode, [{view: html.FLEX, style: { can.page.Append(can, target.parentNode, [{view: html.FLEX, style: {
"clear": i%n == 0? "both": "none", height: width, width: width, "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, "not": code.DATATYPE, "first-child": code.DATATYPE, "last-child": code.DATATYPE, "nth-child": code.DATATYPE,
"placeholder": code.DATATYPE, "hover": code.DATATYPE, "focus": 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, "$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, "output": code.KEYWORD,
"background-color": code.FUNCTION, "color": code.FUNCTION, "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]) } 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) { layout: function(can) {
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight())
can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function() { can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function() {
can.core.Item(can.db, function(hash, term) { term._fit && term._fit.fit() }) 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) can.db.value && can.db.value._term && can.onexport.term(can, can.db.value._term)

View File

@ -54,6 +54,7 @@ Volcanos(chat.ONIMPORT, {
), onmouseenter: function(event) { can.base.isFunc(cb) && cb(event) } }) } ), onmouseenter: function(event) { can.base.isFunc(cb) && cb(event) } }) }
can.onmotion.clear(can, can.ui.svg), can.ui.svg.Value(mdb.COUNT, 0) can.onmotion.clear(can, can.ui.svg), can.ui.svg.Value(mdb.COUNT, 0)
var begin = 0; can.core.Next(can.list, function(item, next, index) { var p = index==which? pos(x, y, 1*margin, begin+item.span/2): [x, y] var begin = 0; can.core.Next(can.list, function(item, next, index) { var p = index==which? pos(x, y, 1*margin, begin+item.span/2): [x, y]
if (item.value.name == "rest") { return can.onmotion.delay(can, next, can.db.delay) }
pie(p[0], p[1], r, begin, item.span, item.color, item.name||item.command, function(event) { can.onimport._draw(can, x, y, r, margin, can.db.which = index) }), begin += item.span pie(p[0], p[1], r, begin, item.span, item.color, item.name||item.command, function(event) { can.onimport._draw(can, x, y, r, margin, can.db.which = index) }), begin += item.span
index == which && (can.db.current = item.value) index == which && (can.db.current = item.value)
can.onmotion.select(can, can.ui.table, html.TR, index), can.Status(item.value), can.onmotion.delay(can, next, can.db.delay) can.onmotion.select(can, can.ui.table, html.TR, index), can.Status(item.value), can.onmotion.delay(can, next, can.db.delay)
@ -75,12 +76,6 @@ Volcanos(chat.ONIMPORT, {
var width = can.ConfWidth()-_width, height = can.ConfHeight()-4, margin = 40, r = can.base.Max(height, width)/2-1*margin-margin var width = can.ConfWidth()-_width, height = can.ConfHeight()-4, margin = 40, r = can.base.Max(height, width)/2-1*margin-margin
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight(), html.WIDTH, width) can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight(), html.WIDTH, width)
can.ui.svg.Val(html.WIDTH, width), can.ui.svg.Val(html.HEIGHT, height) can.ui.svg.Val(html.WIDTH, width), can.ui.svg.Val(html.HEIGHT, height)
can._draw = function(which) { can.onimport._draw(can, width/2-margin/2, height/2-margin/2, r, margin, which) }, can._draw(can.db.which||0) can._draw = function(which) { can.onimport._draw(can, width/2-margin/2, height/2-margin/2, r, margin, which) }, can._draw(can.db.which||-1)
return
var height = can.base.Max(can.ConfHeight(), can.ConfWidth()/2), margin = 10, r = height/2-1*margin-margin
can.page.style(can, can.ui.display, html.WIDTH, can.ConfWidth()-height-1), can.ui.svg.Val(html.HEIGHT, height), can.ui.svg.Val(html.WIDTH, height)
can._draw = function(which) { can.onimport._draw(can, height/2-margin/2, can.ConfHeight()/2-margin/2, r, margin, which) }, can._draw(can.db.which||0)
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
}, },
}) })

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: [ return {view: [[html.ITEM, item.type, item.role, item.status]], title: item.title||item.nick, list: [
can.onimport._icons(can, item), can.onimport._icons(can, item),
].concat(can.onimport._nick(can, item), item._label||[], [ ].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 ]), _init: function(target) { target._item = item, item._item = target, can.ui[item.path] = target
item._select && can.onmotion.delay(can, function() { target.click() }) item._select && can.onmotion.delay(can, function() { target.click() })
}, onclick: function(event) { }, onclick: function(event) {
if (cb(event)) { return }
can.db.value = item, can.onexport.hash(can, item._hash) can.db.value = item, can.onexport.hash(can, item._hash)
item.__title? can.user.title(item.__title): can.onexport.title(can, item._title) item.__title? can.user.title(item.__title): can.onexport.title(can, item._title)
cb(event)
}, oncontextmenu: function(event) { }, oncontextmenu: function(event) {
can.onimport._menu(event, can, item, cbs) 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 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.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})) 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 }, cbs)])._target
}, },
_itemselect: function(can, 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) } 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.page.Append(can, target._list, can.core.List(list, function(item) {
return can.onimport._item(can, item, function(event) { var target = event.currentTarget 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 } if (target._list && target._list.childElementCount > 0 && target._list && can.onmotion.toggle(can, target._list) == false) { return true }
can.onimport._itemselect(can, target), cb && cb(event, item, target._list && true, target) if (cb && cb(event, item, target._list && true, target)) { return }
can.onimport._itemselect(can, target)
}, cbs) }, cbs)
})), target._list })), target._list
}, },