mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt git
This commit is contained in:
parent
d7a654b2f0
commit
503a8aab0b
12
frame.js
12
frame.js
@ -18,7 +18,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||
if (!sub || !mod || !fun) { can.misc.Warn(ice.ErrNotFound, cmds); return can.base.isFunc(cb) && cb(msg.Echo(ice.ErrWarn, ice.ErrNotFound, cmds)) }
|
||||
return can.core.CallFunc(fun, {event: event, can: sub, msg: msg, cmds: cmds.slice(2), cb: cb, target: sub._target, button: key, cmd: key, arg: cmds.slice(2), list: cmds.slice(2)}, mod)
|
||||
},
|
||||
_remote: function(event, can, msg, panel, cmds, cb) { var sub = msg._can;
|
||||
_remote: function(event, can, msg, panel, cmds, cb) { var sub = msg._can;
|
||||
if (panel.onengine._plugin(event, can, msg, panel, cmds, cb)) { return }
|
||||
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
|
||||
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
|
||||
@ -145,7 +145,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
},
|
||||
_option: function(can, meta, option, skip) { var index = -1, args = can.base.Obj(meta.args||meta.arg, []), opts = can.base.Obj(meta.opts, {})
|
||||
meta.inputs = can.base.Obj(meta.inputs, [{type: html.BUTTON, name: html.LIST, action: html.AUTO}])
|
||||
can.core.List([""].concat(meta.inputs), function(item) { if (item != "" && item.type != html.BUTTON) { return }
|
||||
can.core.List([""].concat(meta.inputs), function(item) { if (item != "" && item.type != html.BUTTON) { return }
|
||||
var icon = {
|
||||
"": {name: mdb.DELETE, cb: function(event) { can.onaction.close(event, can) }},
|
||||
run: {name: web.PLAY, cb: function(event) { can.Update(event) }},
|
||||
@ -351,7 +351,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.page.style(can, target, html.MIN_HEIGHT, can.ConfHeight(), html.MIN_WIDTH, can.ConfWidth())
|
||||
}) } else { can.page.Select(can, code, html.INPUT_BUTTON, function(target) {
|
||||
target.onclick = function(event) { can.misc.Event(event, can, function(msg) { can.run(can.request(event, can.Option()), [ctx.ACTION, target.name]) }) }
|
||||
}) } return code.scrollBy && code.scrollBy(0, 10000), code
|
||||
}) } return code.scrollBy && code.scrollBy(0, 10000), code
|
||||
},
|
||||
tools: function(can, msg, cb, target) {
|
||||
// can.onimport.tool(can, can.base.Obj(msg.Option(ice.MSG_TOOLKIT), can.misc.sessionStorage(can, [can.ConfIndex(), "tool"]))||[], cb, target)
|
||||
@ -408,8 +408,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
},
|
||||
_toggle: function(can, target, prev, next) {
|
||||
return can.page.Append(can, target, [
|
||||
{view: [[html.TOGGLE, mdb.PREV], "", can.page.unicode.prev], onclick: prev||function(event) {}},
|
||||
{view: [[html.TOGGLE, mdb.NEXT], "", can.page.unicode.next], onclick: next||function(event) {}},
|
||||
{view: [[html.TOGGLE, mdb.PREV], "", can.page.unicode.prev], onclick: prev||function(event) {}, ondblclick: function(event) { can.onkeymap.prevent(event) }},
|
||||
{view: [[html.TOGGLE, mdb.NEXT], "", can.page.unicode.next], onclick: next||function(event) {}, ondblclick: function(event) { can.onkeymap.prevent(event) }},
|
||||
])
|
||||
},
|
||||
layout: function(can, list, type, target) { const FLOW = html.FLOW, FLEX = html.FLEX
|
||||
@ -534,7 +534,7 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
||||
}
|
||||
}
|
||||
if (layout.left+target.offsetWidth > left+width) { layout.left = (right? rect.left: left+width)-target.offsetWidth-1 }
|
||||
});
|
||||
});
|
||||
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
||||
return layout
|
||||
},
|
||||
|
@ -502,15 +502,15 @@ fieldset.draw>div.output>div.layout>div.layout>div.profile table { width:100%; }
|
||||
fieldset.draw>form.option>div.item.pid>input { width:60px !important; }
|
||||
fieldset.draw.trend div.output svg { background-color:#1b5b738c; }
|
||||
fieldset.draw.trend div.output { overflow:hidden; }
|
||||
/* fieldset.draw.spide div.output { overflow-y:hidden; } */
|
||||
fieldset.draw.spide div.output svg text { cursor:pointer; }
|
||||
fieldset.draw.spide div.output svg path { stroke-width:1; }
|
||||
fieldset.draw.spide div.output svg path { stroke-width:1; }
|
||||
fieldset.draw>div.output>div.project { width:180px; flex:0 0 180px; }
|
||||
fieldset.draw>div.output>div.layout>div.layout>div.profile { width:180px; flex:0 0 180px; }
|
||||
fieldset.web.chat.location>div.action input[type=text] { width:80px !important; }
|
||||
fieldset.web.chat.location>div.output>div.layout>div.layout>div.profile { position:absolute; top:0; right:0; height:200px; width:200px; z-index:5; border-left:none; }
|
||||
fieldset.web.chat.location>div.output>div.layout>div.layout { position:relative; }
|
||||
body.web.wiki.portal { background-color:rgb(22 31 49); }
|
||||
fieldset.web.code.git.total.draw div.output { text-align:center; }
|
||||
fieldset.web.code.docker.studio>div.action>div.item { font-style:italic; height:32px; padding:5px 10px; }
|
||||
fieldset.web.code.docker.studio>div.output>fieldset { margin:0; }
|
||||
fieldset.web.code.docker.studio>div.output>fieldset>legend { display:none; }
|
||||
@ -523,6 +523,7 @@ fieldset.studio>div.output>fieldset>form.option div.icon:nth-child(2) { margin-l
|
||||
fieldset.studio>div.output>fieldset>div.output>table.content { width:100%; }
|
||||
fieldset.studio>div.output>fieldset:not(.select) { display:none; }
|
||||
body>div.input.vimer.plug td:first-child { display:none; }
|
||||
body.web.wiki.portal { background-color:rgb(22 31 49); }
|
||||
body.zh fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; border-top:var(--box-border); }
|
||||
body.white fieldset.inner.cmd>div.output>div.layout>div.tabs div:not(.select):not(:hover) { background-color:transparent; }
|
||||
body.webview fieldset.word>form.option>div.item>input[name=path] { width:160px; }
|
||||
|
@ -1,12 +1,15 @@
|
||||
fieldset.feel>div.output>div.layout>div.display { position:relative; overflow-y:hidden; }
|
||||
fieldset.feel>div.output>div.layout>div.display>img:hover { background-color:var(--hover-bg-color); cursor:pointer; }
|
||||
fieldset.feel>div.output>div.layout>div.display:not(.hide) { height:100px; display:flex; justify-content:center; gap:10px; }
|
||||
fieldset.feel>div.output>div.layout>div.display:not(:hover)>div.toggle { display:none; }
|
||||
fieldset.feel>div.output>div.layout>div.display>div.toggle { font-size:48px; position:absolute; top:20%; }
|
||||
fieldset.feel>div.output>div.layout>div.display>div.toggle { font-size:48px; padding:5px; position:absolute; top:20%; }
|
||||
fieldset.feel>div.output>div.layout>div.display>div.toggle.prev { left:0; }
|
||||
fieldset.feel>div.output>div.layout>div.display>div.toggle.next { right:0; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content { text-align:center; overflow-y:hidden; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content>img { cursor:pointer; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content>img:hover { background-color:var(--hover-bg-color); }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content:not(:hover)>div.toggle { display:none; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle { font-size:48px; padding-top:32px; top:40%; height:120px; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle { font-size:48px; padding:5px; padding-top:32px; top:40%; height:120px; }
|
||||
fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle.next { right:0; }
|
||||
fieldset.feel.float>div.output { display:flex; justify-content:center; }
|
||||
body.mobile fieldset.feel>div.output>div.project { overflow-x:hidden; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(can, function() { can.list = can.onimport._data(can, msg, can.Conf(mdb.FIELD))
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(can, function() { can.list = can.onimport._data(can, msg, can.Conf(mdb.FIELD)||mdb.VALUE)
|
||||
can.core.List(can.list, function(item) { msg.Push(cli.COLOR, '<span style="background-color:'+item.color+'"> </span>').Push("weight", parseInt(item.span*100/360)+"%") })
|
||||
can.onaction.list = [], can.ui.display = can.page.Append(can, can._output, [html.DISPLAY])._target
|
||||
can.onappend.table(can, msg, null, can.ui.display), can.page.Select(can, can.ui.display, html.TR, function(tr, index) {
|
||||
@ -13,7 +13,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(ca
|
||||
}); return list
|
||||
},
|
||||
_draw: function(can, x, y, r, margin, which) { if (which == can._last) { return } can._last = which
|
||||
if (can.list.length == 1) { return can.onimport.draw(can, {shape: svg.CIRCLE, points: [{x: x, y: y}, {x: x, y: y+r}], style: {fill: "blue"}}) }
|
||||
if (can.list.length == 1) { return can.onimport.draw(can, {shape: svg.CIRCLE, points: [{x: x, y: y}, {x: x, y: y+r}], style: {fill: cli.BLUE}}) }
|
||||
function pos(x, y, r, angle) { angle -= 90; return [x + r * Math.cos(angle * Math.PI / 180), y + r * Math.sin(angle * Math.PI / 180)] }
|
||||
function pie(x, y, r, begin, span, color, cb) { can.onimport.draw(can, {shape: svg.PATH, style: kit.Dict(
|
||||
svg.STROKE, color, svg.FILL, color, "d", can.base.joins([
|
||||
@ -24,17 +24,18 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(ca
|
||||
var begin = 0; can.core.List(can.list, function(item, index) { var p = index==which? pos(x, y, margin, begin+item.span/2): [x, y]
|
||||
pie(p[0], p[1], r, begin, item.span, item.color, function(event) { can.onimport._draw(can, x, y, r, margin, index) }), begin += item.span
|
||||
index == which && can.Status(item.value)
|
||||
})
|
||||
}), can.onimport.layout(can)
|
||||
},
|
||||
_parseInt: function(can, value) { value = value.toLowerCase()
|
||||
if (can.base.endWith(value, "mi")) { return parseInt(value)*1000000 }
|
||||
if (can.base.endWith(value, "gi")) { return parseInt(value)*1000000000 }
|
||||
if (can.base.endWith(value, "g")) { return parseInt(value)*1000000000 }
|
||||
if (can.base.endWith(value, "m")) { return parseInt(value)*1000000 }
|
||||
if (can.base.endWith(value, "g")) { return parseInt(value)*1000000000 }
|
||||
if (can.base.endWith(value, "gi")) { return parseInt(value)*1000000000 }
|
||||
if (can.base.endWith(value, "mi")) { return parseInt(value)*1000000 }
|
||||
return parseInt(value)
|
||||
},
|
||||
layout: function(can) {
|
||||
var height = can.base.Max(can.ConfHeight(), can.ConfWidth()/2), margin = 20, r = height/2-margin; can.ui.svg.Val(html.WIDTH, height), can.ui.svg.Val(html.HEIGHT, height)
|
||||
can.page.style(can, can.ui.display, html.HEIGHT, can.ConfHeight()-can.ui.svg.Val(html.HEIGHT))
|
||||
can._draw = function(which) { can.onimport._draw(can, r+margin, r+margin, r, margin, which) }, can._draw(0)
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user