mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
5dd245749b
commit
79b82f7c5a
12
frame.js
12
frame.js
@ -141,6 +141,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}); return sub
|
||||
},
|
||||
_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 }
|
||||
var icon = {
|
||||
"": {name: mdb.DELETE, cb: function(event) { can.onaction.close(event, can) }},
|
||||
@ -152,7 +153,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
next: {name: mdb.NEXT, cb: function(event) { var sub = can.sub; sub.onaction && sub.onaction.next? sub.onaction.next(event, sub): can.onaction.next(event, can) }},
|
||||
play: {name: web.PLAY},
|
||||
}[item.name||""]; if (!icon) { return } item.style = "icons"
|
||||
can.page.Append(can, option, [{view: [[html.ITEM, html.ICON, icon.name, item.name], html.DIV, can.page.unicode[icon.name]], title: item.name, onclick: icon.cb||function(event) {
|
||||
can.page.Append(can, option, [{view: [[html.ITEM, html.ICON, icon.name, item.name], html.DIV, can.page.unicode[icon.name]], title: can.user.trans(can, item.name), onclick: icon.cb||function(event) {
|
||||
var msg = can.request(event), cmds = [ctx.ACTION, item.name]; msg.RunAction(event, can.sub, cmds) || msg.RunAction(event, can, cmds) || can.Update(event, cmds)
|
||||
}}])
|
||||
})
|
||||
@ -191,7 +192,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}) }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) {
|
||||
run(event, item.name||item.value)
|
||||
}, item._init = item._init||function(target) { item.action && can.onappend.figure(sub, item, target, function(_sub, value) { can.Update() })
|
||||
if (item.type == html.BUTTON && can.base.isIn(item.name, mdb.CREATE, mdb.INSERT)) {
|
||||
if (item.type == html.BUTTON && can.base.isIn(item.name, mdb.CREATE, mdb.INSERT, mdb.PRUNES, cli.START)) {
|
||||
can.onappend.icons(can, target, item.name)
|
||||
} item.type == html.BUTTON && can.onappend.icons(can, target, can.Conf(["_icons", item.name]), item.name)
|
||||
}), item), "", action)
|
||||
@ -246,7 +247,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])), function(item) { item = can.base.isString(item)? {name: item}: item
|
||||
if (can.base.beginWith(item.value, nfs.PS, ice.HTTP)) { item.value = can.page.Format(html.A, item.value, item.value.split("?")[0]) }
|
||||
can.page.Append(can, status, [{view: html.ITEM, list: [
|
||||
{text: [item.name, html.LABEL]}, {text: [": ", html.LABEL]}, {text: [(item.value == undefined? "": item.value.trim())+"", html.SPAN, item.name]},
|
||||
{text: [can.page.Color(item.name), html.LABEL]}, {text: [": ", html.LABEL]}, {text: [(item.value == undefined? "": item.value.trim())+"", html.SPAN, item.name]},
|
||||
], onclick: function(event) { can.user.copy(event, can, item.value) }}])
|
||||
})
|
||||
},
|
||||
@ -278,7 +279,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}}])[item.name]; return _input
|
||||
},
|
||||
icons: function(can, target, icon, cb) { if (!icon) { return } can.onappend.style(can, "icons", target.parentNode)
|
||||
can.page.Append(can, target.parentNode, [{icon: icon, onclick: can.base.isFunc(cb)? cb: function(event) { can.Update(event, [ctx.ACTION, cb||icon]) }}])
|
||||
can.page.Append(can, target.parentNode, [{icon: icon, title: can.user.trans(can, icon), onclick: can.base.isFunc(cb)? cb: function(event) { can.Update(event, [ctx.ACTION, cb||icon]) }}])
|
||||
},
|
||||
mores: function(can, target, value, limit) {
|
||||
var list = can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||
@ -475,7 +476,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
(meta.run||can.run)(sub.request(event, can.Option()), cmds, cb, true)
|
||||
}, target._can = sub, can.base.Copy(sub, can.onfigure[input], true), sub._name = sub._path = path
|
||||
sub._target._close = sub.close = function() { can.page.Remove(can, sub._target), delete(target._can) }, sub.hidden = function() { return !can.page.isDisplay(sub._target) }
|
||||
meta.mode && can.onappend.style(sub, meta.mode), can.page.style(sub, sub._target, meta.style), can.base.isFunc(meta._init) && meta._init(sub, sub._target), show(sub, cb)
|
||||
meta.mode && can.onappend.style(sub, meta.mode), can.page.style(sub, sub._target, meta.style), can.base.isFunc(meta._init) && meta._init(sub, sub._target),
|
||||
can.onmotion.delay(can, function() { show(sub, cb) }, 300)
|
||||
}, can._root._target)
|
||||
}})
|
||||
}) } }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb)
|
||||
|
12
index.css
12
index.css
@ -76,7 +76,8 @@ iframe { height:420px; width:100%; }
|
||||
fieldset>legend { box-shadow:var(--box-shadow); }
|
||||
fieldset>legend>i { margin-right:5px; }
|
||||
fieldset>form.option>div.item:not(.icon) { margin-right:10px; box-shadow:var(--box-shadow); }
|
||||
fieldset>form.option>div.item.text.cmd { color:var(--code-fg-color); width:100%; }
|
||||
fieldset>form.option>div.item.text.cmd { width:100%; }
|
||||
fieldset>form.option>div.item.text.cmd>input { background-color:var(--code-bg-color); color:var(--code-fg-color); width:100%; }
|
||||
fieldset>form.option>div.item.textarea { width:100%; height:96px; }
|
||||
fieldset>form.option>div.item.select { border-radius:5px; }
|
||||
fieldset>form.option>div.item.select>input { min-width:80px; }
|
||||
@ -181,8 +182,11 @@ body:not(.windows) div.carte { font-family:monospace; }
|
||||
div.item>i:first-child { margin-right:10px; }
|
||||
div.project div.item>i:first-child { color:var(--panel-output-fg-color); }
|
||||
div.project div.item.text:hover>i:first-child { color:var(--plugin-fg-color); }
|
||||
div.action div.icon, div.action>div.item:not(.tabs)>span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; }
|
||||
div.action>div.item.icons>span.icon { font-size:30px; line-height:28px; }
|
||||
div.action div.icon, div.action>div.item:not(.tabs)>span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; display:inline-block; }
|
||||
div.action>div.item.icons.create>span.icon { font-size:30px; line-height:28px; }
|
||||
div.action>div.item.icons.insert>span.icon { font-size:30px; line-height:28px; }
|
||||
div.action>div.item.icons.start>span.icon { font-size:30px; line-height:28px; }
|
||||
div.action>div.item.icons.prunes>span.icon { display:inline-block; padding-top:2px; }
|
||||
div.action>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
||||
form.option>div.item.icons>i { font-size:21px; line-height:32px; padding:6px; }
|
||||
form.option div.icon, form.option span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; }
|
||||
@ -190,6 +194,7 @@ form.option div.icon.refresh { font-size:28px; line-height:28px; }
|
||||
form.option div.icon.goback { font-size:28px; line-height:28px; }
|
||||
form.option div.icon.next { font-size:18px; }
|
||||
form.option div.icon.prev { font-size:18px; }
|
||||
form.option div.icons.prunes>span.icon { display:inline-block; padding-top:1px; }
|
||||
div.item.select { position:relative; }
|
||||
div.item.select>span.icon { position:absolute; right:0; visibility:hidden; }
|
||||
div.item.select:hover>span.icon { visibility:visible; }
|
||||
@ -197,6 +202,7 @@ div.item.text { position:relative; }
|
||||
div.item.text>span.icon { position:absolute; right:0; visibility:hidden; }
|
||||
div.item.text:hover>span.icon { visibility:visible; }
|
||||
div.item.button>span.icon.create { font-size:32px; line-height:28px; display:block; }
|
||||
div.item.button>span.icon.insert { font-size:32px; line-height:28px; display:block; }
|
||||
div.tabs span.icon { font-style:normal; line-height:20px; padding:0 5px; visibility:hidden; }
|
||||
div.tabs>div.select span.icon { visibility:visible; }
|
||||
div.tabs>div:hover span.icon { visibility:visible; }
|
||||
|
@ -1,6 +1,9 @@
|
||||
Volcanos("base", {
|
||||
Int: function(val, def) { return parseInt(val)||def||0 },
|
||||
Min: function(val, min, max) { return val < min? min: val > max? max: val },
|
||||
Min: function(val, min, max) {
|
||||
if (val == "max") { return max }
|
||||
return val < min? min: val > max? max: val
|
||||
},
|
||||
Max: function(val, max) { return val > max? max: val },
|
||||
|
||||
Obj: function(val, def) {
|
||||
|
@ -268,8 +268,10 @@ Volcanos("page", {
|
||||
width: function() { return window.innerWidth },
|
||||
ismodkey: function(event) { return [code.META, code.ALT, code.CONTROL, code.SHIFT].indexOf(event.key) > -1 },
|
||||
unicode: {
|
||||
refresh: "↻", goback: "↺", start: "+",
|
||||
create: "+", remove: "✕", insert: "+", delete: "✕",
|
||||
refresh: "↻", goback: "↺", prunes: "♻︎", prune: "♻︎",
|
||||
prunes: "♻︎", prune: "♻︎",
|
||||
|
||||
menu: "☰", play: "▸", prev: "❮", next: "❯",
|
||||
push: "⇈", pull: "⇊", open: "▾", close: "▸",
|
||||
|
||||
|
@ -28,7 +28,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
||||
transform: function(can, target) { target.Value("transform", "translate(0, "+parseInt(can.ConfHeight())+") scale(1, -1)") },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: [[html.VIEW, "趋势图", "柱状图", "折线图", "数据源"],
|
||||
[html.HEIGHT, html.HEIGHT, 100, 200, 400, 600, 800], [html.MARGIN, html.MARGIN, 10, 20, 50, 100], [html.SPEED, html.SPEED, 10, 20, 50, 100],
|
||||
[html.HEIGHT, html.HEIGHT, 100, 200, 400, 600, 800, "max"], [html.MARGIN, html.MARGIN, 10, 20, 50, 100], [html.SPEED, html.SPEED, 10, 20, 50, 100],
|
||||
],
|
||||
"趋势图": function(event, can) { var args = can.onimport._layout(can)
|
||||
function scale(y) { return (y - can.min)/(can.max - can.min)*(args.height-2*args.margin) }
|
||||
@ -92,7 +92,10 @@ Volcanos(chat.ONDETAIL, {
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {list: ["from", "commit", "total", "max", "date", "text", "add", "del"],
|
||||
height: function(can) { return can.base.Min(parseInt(can.onexport.action_value(can, html.HEIGHT, can.ConfHeight())), 200) },
|
||||
height: function(can) {
|
||||
var height = can.onexport.action_value(can, html.HEIGHT, can.ConfHeight())
|
||||
return can.base.Min(height, 200, can.ConfHeight())
|
||||
},
|
||||
margin: function(can) { return parseInt(can.onexport.action_value(can, html.MARGIN, 10)) },
|
||||
speed: function(can) { return parseInt(can.onexport.action_value(can, html.SPEED, 10)) },
|
||||
})
|
||||
|
@ -237,7 +237,8 @@ Volcanos(chat.ONEXPORT, {
|
||||
},
|
||||
board: function(can) { var msg = can._msg; return msg.Result() },
|
||||
session: function(can, key, value) { return can.misc[can.user.isWebview? "localStorage": "sessionStorage"](can, [can.Conf(ctx.INDEX), key, location.pathname].join(":"), value == ""? "": JSON.stringify(value)) },
|
||||
action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key)? def: value },
|
||||
action_value: function(can, key, def) {
|
||||
var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key)? def: value },
|
||||
tool: function(can) { can.misc.sessionStorage(can, [can.ConfIndex(), "tool"], JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) },
|
||||
tabs: function(can) {},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user