mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt div.js
This commit is contained in:
parent
4cedaed642
commit
81ca364f5e
19
frame.js
19
frame.js
@ -10,7 +10,7 @@ Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list,
|
||||
can.user.title(can.misc.Search(can, chat.TITLE)||can.misc.Search(can, ice.POD)||location.host)
|
||||
|
||||
can.core.Next(list, function(item, next) { item.type = chat.PANEL
|
||||
can.onappend._init(can, can.base.Copy(item, can.core.Value(can._root, [chat.RIVER, item.name])), item.list, function(panel) {
|
||||
can.onappend._init(can, can.base.Copy(item, can.core.Value(can, [chat.RIVER, item.name])), item.list, function(panel) {
|
||||
panel.run = function(event, cmds, cb) { var msg = panel.request(event); cmds = cmds||[]
|
||||
return (can.onengine[cmds[0]]||can.onengine._remote)(event, can, msg, panel, cmds, cb)
|
||||
}, can[item.name] = panel, panel._root = can, panel._trans = panel.onaction && panel.onaction._trans||{}
|
||||
@ -84,7 +84,7 @@ Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list,
|
||||
}
|
||||
var p = can.onengine.plugin.meta[cmds[0]], n = 1; if (p) {
|
||||
if (p.meta && p.meta[cmds[1]] && cmds[0] == ctx.ACTION) { n = 3 } else if (p.meta && p.meta[cmds[0]]) { n = 2 }
|
||||
return can.core.CallFunc(p, {can: p.can||panel, msg: msg, cmds: cmds.slice(n), cb: cb}), true
|
||||
return can.core.CallFunc(p, {can: p.can||panel, msg: msg, arg: cmds.slice(n), cmds: cmds.slice(n), cb: cb}), true
|
||||
}
|
||||
return false
|
||||
},
|
||||
@ -140,6 +140,7 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
Status: function(key, value) {
|
||||
if (can.base.isObject(key)) { return can.core.Item(key, sub.Status), key }
|
||||
can.page.Select(can, status, [[[html.DIV, key], html.SPAN]], function(item) {
|
||||
if (value && value.indexOf && value.indexOf("http") == 0) { value = can.page.Format(html.A, value) }
|
||||
return value == undefined? (value = item.innerHTML): (item.innerHTML = value)
|
||||
}); return value
|
||||
},
|
||||
@ -285,6 +286,8 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
},
|
||||
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status)
|
||||
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])), function(item) { item = can.base.isObject(item)? item: {name: item}
|
||||
|
||||
if (item.value && item.value.indexOf && item.value.indexOf("http") == 0) { item.value = can.page.Format(html.A, item.value) }
|
||||
can.page.Append(can, status, [{view: can.base.join([html.ITEM, item.name]), title: item.name, list: [
|
||||
{text: [item.name, html.LABEL]}, {text: [": ", html.LABEL]}, {text: [(item.value||"")+"", html.SPAN, item.name]},
|
||||
], onclick: function(event) { can.user.copy(event, can, item.value) }}])
|
||||
@ -373,7 +376,7 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
return (code.scrollBy && code.scrollBy(0, 10000)), code
|
||||
},
|
||||
|
||||
_plugin: function(can, value, meta, cb, target) {
|
||||
_plugin: function(can, value, meta, cb, target, field) {
|
||||
meta.feature = can.base.getValid(meta.feature, can.base.Obj(value.meta))||{}
|
||||
meta.inputs = can.base.getValid(meta.inputs, can.base.Obj(value.list))||[]
|
||||
meta.args = can.base.getValid(can.base.Obj(meta.args), can.base.Obj(meta.arg), can.base.Obj(value.args), can.base.Obj(value.arg))||[]
|
||||
@ -389,19 +392,19 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
can.onappend._init(can, meta, [chat.PLUGIN_STATE_JS], function(sub, skip) { sub._index = value.index||meta.index
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(event, sub._index, cmds, cb) }
|
||||
can.base.isFunc(cb) && cb(sub, meta, skip)
|
||||
}, target||can._output)
|
||||
}, target||can._output, field)
|
||||
},
|
||||
plugin: function(can, meta, cb, target) { meta = meta||{}, meta.index = meta.index||can.core.Keys(meta.ctx, meta.cmd)
|
||||
plugin: function(can, meta, cb, target, field) { meta = meta||{}, meta.index = meta.index||can.core.Keys(meta.ctx, meta.cmd)
|
||||
var p = can.onengine.plugin.meta[meta.index], res = {}; function cbs(sub, meta, skip) { res.__proto__ = sub, cb(sub, meta, skip) }
|
||||
(meta.meta || meta.inputs && meta.inputs.length > 0)? /* 局部命令 */ can.onappend._plugin(can, {meta: meta.meta, list: meta.list}, meta, cbs, target):
|
||||
(meta.meta || meta.inputs && meta.inputs.length > 0)? /* 局部命令 */ can.onappend._plugin(can, {meta: meta.meta, list: meta.list}, meta, cbs, target, field):
|
||||
p? /* 前端命令 */ can.onappend._plugin(can, {name: meta.index, help: p.help, meta: p.meta, list: p.list}, meta, function(sub, meta, skip) {
|
||||
sub.run = function(event, cmds, cb) { var _cb = p, n = 0
|
||||
if (p.meta && p.meta[cmds[1]] && cmds[0] == ctx.ACTION) { _cb = p.meta[cmds[1]], n = 2 } else if (p.meta && p.meta[cmds[0]]) { _cb = p.meta[cmds[0]], n = 1 }
|
||||
can.core.CallFunc(_cb, {can: sub, msg: can.request(event), cmds: cmds.slice(n), cb: cb})
|
||||
}
|
||||
can.base.isFunc(cbs) && cbs(sub, meta, skip)
|
||||
}, target): /* 后端命令 */ can.runAction(can.request({}, meta), ctx.COMMAND, [meta.index], function(msg) { msg.Table(function(value) {
|
||||
can.onappend._plugin(can, value, meta, cbs, target)
|
||||
}, target, field): /* 后端命令 */ can.runAction(can.request({}, meta), ctx.COMMAND, [meta.index], function(msg) { msg.Table(function(value) {
|
||||
can.onappend._plugin(can, value, meta, cbs, target, field)
|
||||
}) })
|
||||
return res
|
||||
},
|
||||
|
@ -35,7 +35,7 @@ table.content thead { position:sticky; top:2px; }
|
||||
table.content th { background-color:steelblue; padding:2px 6px; }
|
||||
table.content td { padding:2px 6px; }
|
||||
table.content.action th:last-child { position:sticky; right:0; }
|
||||
table.content.action td:last-child { background-color:skyblue; position:sticky; right:0; }
|
||||
table.content.action td:last-child { background-color:steelblue; position:sticky; right:0; }
|
||||
div.code { background-color:#343a3445; color:white; padding:10px; border:solid 2px green; }
|
||||
div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:5px 10px; border-left:solid 5px blue; margin:10px; }
|
||||
|
||||
@ -47,14 +47,17 @@ div.output div.project div.list { margin-left:10px; }
|
||||
div.output div.project div.switch { width:12px; float:left; transform: rotate(90deg) translate(1px, 0px); }
|
||||
div.output div.project div.switch.open { transform: rotate(180deg) translate(-4px, 4px); }
|
||||
div.output div.project div.zone>div.name { background-color:steelblue; color:white; text-align:center; padding:5px; clear:both; }
|
||||
div.output div.project div.item>div.name { padding-left:16px; }
|
||||
div.output div.project div.item>div.name { padding-left:20px; }
|
||||
div.output div.project div.zone>div.action>div.item { float:right; clear:none; padding:0; margin:0; }
|
||||
div.output div.project div.zone>div.action>div.item input[type=text] { background-color:#ff000000; padding-left:10px; color:white; }
|
||||
|
||||
fieldset.plugin { background-color:#061c3c9e; padding:10px; margin:10px; }
|
||||
fieldset.float { background-color:#0e3369b3; position:absolute; }
|
||||
fieldset.full { background-color:#073947f2; padding:0; margin:0; left:0; top:0; overflow:auto; }
|
||||
fieldset.story>legend { margin:10px 0; }
|
||||
fieldset.plug>legend { float:left; margin-right:5px; }
|
||||
fieldset.float>legend { float:left; margin-right:5px; }
|
||||
fieldset.full>legend { float:left; margin-right:5px; }
|
||||
fieldset.float input[type=button][name=close]{ display:block; }
|
||||
fieldset.plug>form.option input[type=button][name=close]{ display:block; }
|
||||
fieldset.full input[type=button][name=close]{ display:block; }
|
||||
@ -117,13 +120,13 @@ svg { font-family:monospace; }
|
||||
form.option, div.action { display:contents; }
|
||||
.hide, .hidden, form.option>div.item>label, div.action>div.item>label, fieldset.panel>legend, fieldset.output>legend, fieldset.input>legend { display:none; }
|
||||
div.output, div.status, div.content, div.project div.item, div.item.textarea, div.code, div.story[data-type=spark], p.story, h1, h2, h3 { clear:both; }
|
||||
form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, div.project, div.status>div.item, fieldset.float>legend { float:left; }
|
||||
form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, div.project, div.status>div.item { float:left; }
|
||||
div.code, div.story, div.action, div.output, div.status, div.project, div.content, div.profile, div.display, table.content, table.content td, body>div.toast { overflow:auto; }
|
||||
div.code, div.story, div.item, div.content, table.content, textarea { white-space:pre; }
|
||||
div.code, div.story, div.item { text-align:left; }
|
||||
|
||||
/* position cursor */
|
||||
fieldset.full fieldset.float, fieldset.input, body>div.toast, body>div.carte, body>div.input, body>div.upload { position:fixed; z-index:10; }
|
||||
fieldset.full, fieldset.float, fieldset.input, body>div.toast, body>div.carte, body>div.input, body>div.upload { position:fixed; z-index:10; }
|
||||
legend, select, input[type=button], div.item, div.tabs, th, td, h1, h2, h3 { cursor:pointer; }
|
||||
div.title, div.story[data-type=spark] { cursor:copy; }
|
||||
|
||||
@ -154,11 +157,13 @@ div.project::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
||||
div.content::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
||||
|
||||
/* table card */
|
||||
div.output.card div.item { padding:10px; border:solid 1px #e7e7e7; margin:10px; height:120px; width:240px; float:left; }
|
||||
div.output.card div.item { padding:10px; border:solid 1px #e7e7e7; margin:10px; width:240px; float:left; }
|
||||
div.output.card div.item>div.title { font-size:1.2rem; font-weight:bold; padding:10px; border-bottom: solid 1px #e7e7e7; }
|
||||
div.output.card div.item>div.content { padding:10px; height:24px; }
|
||||
div.output.card div.item>div.content { padding:10px; height:45px; }
|
||||
body.white div.output.card div.item input[type=button] { background-color:#ff000000; }
|
||||
div.output.card div.item.stop { color:gray; }
|
||||
|
||||
/* white */
|
||||
body.white { background-color:rgba(5,34,56,0.75); color:white; }
|
||||
body.white select { background-color:yellowgreen; color:white; }
|
||||
body.white textarea { background-color:white; }
|
||||
@ -178,13 +183,14 @@ body.white fieldset.panel.Action div.action { color:white; }
|
||||
body.white fieldset.plugin { background-color:#ffffffa1; }
|
||||
body.white fieldset.full { background-color:#cce0f4eb; color:white; }
|
||||
|
||||
/* hover */
|
||||
/* white hover */
|
||||
body.white legend:hover { background-color:skyblue; }
|
||||
body.white select:hover { background-color:#99cc667d; }
|
||||
body.white input[type=text]:hover { background-color:cyan; }
|
||||
body.white input[name=cmd]:hover { background-color:white; color:black; }
|
||||
body.white input[type=button]:hover { background-color:#1b7acc8c; }
|
||||
body.white table.content tr:hover { background-color:#4682b46b; }
|
||||
body.white table.content.action td:last-child { background-color:skyblue; }
|
||||
body.white h1:hover { background-color:#4682b46b; }
|
||||
body.white h2:hover { background-color:#4682b46b; }
|
||||
body.white h3:hover { background-color:#4682b46b; }
|
||||
@ -193,7 +199,8 @@ body.white table.content td:hover { background-color:#6495ed63; }
|
||||
body.white table.content td.select { background-color:#6495ed63; }
|
||||
body.white div.item:hover { background-color:#4682b46b; }
|
||||
body.white div.item.select { background-color:#4682b46b; }
|
||||
|
||||
|
||||
/* print */
|
||||
body.print { background-color:white; color:black; }
|
||||
body.print legend, body.print select, body.print input, body.print input[type=button] { background-color:lightgray; color:black; box-shadow:0px 0px 0px 0px #626bd0; }
|
||||
body.print table.content th { background-color:lightgray; }
|
||||
@ -208,20 +215,19 @@ body.print fieldset.panel { background:white; color:black; }
|
||||
body.print fieldset.draw div.output div.content svg { background-color:lightgray; }
|
||||
body.print fieldset.draw div.output { background-color:lightgray; }
|
||||
|
||||
body.mobile textarea { font-size:1.2rem; }
|
||||
body.mobile legend { font-size:1.6rem; height:38px; }
|
||||
body.mobile select { font-size:1.4rem; height:38px; }
|
||||
body.mobile select { font-size:1.4rem; height:38px; border-radius:0; margin-right:10; }
|
||||
body.mobile textarea { font-size:1.2rem; border-radius:0; }
|
||||
body.mobile input[type=text] { font-size:1.2rem; height:38px; border-radius:0; margin-right:5px; }
|
||||
body.mobile input[type=button] { font-size:1.2rem; height:38px; border-radius:0; }
|
||||
body.mobile fieldset.float input[type=button] { font-size:1.4rem; height:38px; }
|
||||
body.mobile input[type=button] { height:31px; margin-top:-2px; }
|
||||
body.mobile input[type=text] { padding-top:3px; height:31px; }
|
||||
body.mobile table.layout div.toggle { font-size:48px; }
|
||||
body.mobile table.content th { padding:6px 6px; }
|
||||
|
||||
body.mobile form.option>div.item { margin:0; height:38px; }
|
||||
body.mobile div.action>div.item { margin:0; height:38px; }
|
||||
body.mobile div.output div.code { font-size:12px; }
|
||||
body.mobile fieldset.word.float>div.output>div.project { top:38px; }
|
||||
|
||||
body.mobile>div.carte div.item { font-size:2rem; }
|
||||
body.mobile>div.carte div.item { font-size:1.6rem; }
|
||||
body.mobile>div.input.login input { font-size:1.4rem; }
|
||||
body.mobile>div.input.login input[name=username] { width:264px; }
|
||||
body.mobile>div.input.login input[name=password] { width:264px; }
|
||||
@ -233,9 +239,9 @@ body.mobile fieldset.Header.head div.output { height:3rem; }
|
||||
body.mobile fieldset.Header.head div.state.time { display:none; }
|
||||
body.mobile fieldset.Header.head div.search>input { height:38px; }
|
||||
body.mobile fieldset.Header.head div.output div { height:38px; }
|
||||
body.mobile fieldset.River.left { background-color:#243950bf; font-size:2rem; min-width:240px; position:fixed; top:3rem; z-index:10; }
|
||||
body.mobile fieldset.River.left { background-color:#243950bf; font-size:1.6rem; min-width:240px; position:fixed; top:3rem; z-index:10; }
|
||||
body.mobile fieldset.River>div.output { width:320px; }
|
||||
body.mobile fieldset.River>div.output div.item { font-size:2rem; }
|
||||
body.mobile fieldset.River>div.output div.item { font-size:1.6rem; }
|
||||
body.mobile fieldset.Action.main { margin-top:3rem; margin-bottom:3rem; }
|
||||
body.mobile fieldset.Action.main.cmd { margin-top:0; margin-bottom:0; }
|
||||
body.mobile fieldset.Footer.foot { width:-webkit-fill-available; }
|
||||
@ -251,20 +257,23 @@ body.mobile.landscape fieldset.Action.main { margin-top:0; margin-bottom:0; }
|
||||
body.mobile.landscape fieldset.Footer.foot { position:unset; }
|
||||
body.mobile.landscape fieldset.Footer.foot input[name=cmd] { width:240px; }
|
||||
|
||||
body.mobile div.output.card div.item { height:160px; float:none; }
|
||||
body.mobile.landscape div.output.card div.item { width:auto; float:left; }
|
||||
body.mobile.landscape.simple div.output.card div.item { width:auto; float:left; }
|
||||
|
||||
body.mobile fieldset.draw.spide div.action { display:none; }
|
||||
body.mobile fieldset.draw.trend div.action { display:none; }
|
||||
body.mobile.landscape fieldset.draw.spide div.action { display:block; }
|
||||
body.mobile.landscape fieldset.draw.trend div.action { display:block; }
|
||||
body.mobile div.output.card div.item { height:160px; float:none; }
|
||||
body.mobile.landscape div.output.card div.item { width:auto; float:left; }
|
||||
body.mobile.landscape.simple div.output.card div.item { width:auto; float:left; }
|
||||
|
||||
/* misc */
|
||||
body.mobile.simple div.output.card div.item { width:-webkit-fill-available; }
|
||||
fieldset.panel.Search div.story[data-type=spark] { padding:0px; margin:0px; }
|
||||
fieldset.panel.Action.cmd>div.toggle.project { display:none; }
|
||||
fieldset.plugin.config form.option input[name=key] { width:240px; }
|
||||
fieldset.plugin.parse.cmd>legend { display:none; }
|
||||
fieldset.plugin.parse.cmd>form.option { display:none; }
|
||||
fieldset.plugin.parse.cmd>div.action { display:none; }
|
||||
fieldset.plugin.parse.cmd>div.status { display:none; }
|
||||
body.mobile fieldset.plan>div.action { display:none; }
|
||||
body.white fieldset.panel.Search a { color:yellow; }
|
||||
body.black a { color:yellow; }
|
||||
@ -301,6 +310,7 @@ body.white.simple>div.carte div.item { background-color:white; color:black; }
|
||||
body.white.simple div.carte div.item:hover { background-color:#e3e6f1; }
|
||||
body.white.simple fieldset.plugin div.output.json div.item span { color:black; }
|
||||
body.white.simple fieldset.plugin div.output.json div.item span.key { color:blue; }
|
||||
body.white.simple fieldset.plugin div.output.json div.item span.nonce { color:lightgray; }
|
||||
body.white.simple div.output.card input[type=button] { background-color:#0152d9; font-size:0.8rem; padding:5px 10px; box-shadow:2px 2px 6px 1px gray; }
|
||||
body.white.simple div.output.card input[type=button]:hover { box-shadow:2px 2px 8px 2px gray; }
|
||||
body.white.simple div.output div.project div.zone>div.action>div.item input[type=text] { color:black; }
|
||||
|
@ -12,9 +12,6 @@ fieldset.Action.free>div.output fieldset.plugin { position:absolute; }
|
||||
fieldset.Action.free>div.output fieldset.plugin.select { display:block; }
|
||||
fieldset.Action.flow>div.output fieldset.plugin { float:left; }
|
||||
|
||||
fieldset.Action>div.output fieldset.full { background-color:#073947f2; padding:0; margin:0; position:fixed; left:0; top:0; overflow:auto; z-index:10; }
|
||||
fieldset.Action>div.output fieldset.full>legend { margin:0px; float:left; }
|
||||
|
||||
fieldset.panel.cmd>div.output>fieldset.plugin { padding:0; margin:0; }
|
||||
fieldset.panel.cmd>div.output>fieldset.plugin>legend { padding:0 10px; margin-right:3px; float:left; }
|
||||
|
||||
@ -23,3 +20,97 @@ fieldset.Action>div.project.toggle {
|
||||
border-top-right-radius:20px; border-bottom-right-radius:20px;
|
||||
}
|
||||
|
||||
div.head { background-color:#404040; color:white; padding:5px; height:42px; clear:both; }
|
||||
div.head div.username { float:right; margin-right:10px; }
|
||||
div.head div.username div.name { padding:10px; float:left; }
|
||||
div.head div.username div.icon { float:left; }
|
||||
div.head div.username img { height:42px; }
|
||||
div.head div.menu { cursor:pointer; padding:10px; float:left; }
|
||||
div.head>div.menu:hover { background-color:#323232; }
|
||||
div.left { background-color:#323232; width:160px; padding:20px; overflow:auto; float:left; }
|
||||
div.left div.item { background-color:#323232; color:white; padding:5px 10px; }
|
||||
div.left div.item:hover { background-color:#404040; }
|
||||
div.left div.username div { color:white; text-align:center; padding:10px; }
|
||||
div.left div.username img { width:120px; }
|
||||
div.main iframe { border:0; }
|
||||
div.main input[type=button] { padding:0 20px; }
|
||||
div.main { background-color:#cccccc; color:black; overflow:auto; float:left; }
|
||||
div.main fieldset.plugin { background-color:#f8f8f8; padding:10px; margin:10px; }
|
||||
div.main fieldset.plugin legend { margin-bottom:10px; display:block; float:left; }
|
||||
div.main fieldset.plugin select { outline:none; box-shadow:none; }
|
||||
div.main fieldset.plugin form.option { display:block; clear:both; }
|
||||
div.main fieldset.plugin form.option div.item { margin:5px; }
|
||||
div.main fieldset.plugin div.action div.item { margin:5px; }
|
||||
div.main fieldset.plugin table.content tr { border:solid 1px lightgray; }
|
||||
div.main fieldset.plugin table.content tr:hover { background-color:whitesmoke; }
|
||||
div.main fieldset.plugin table.content th { background-color:whitesmoke; padding:10px; }
|
||||
div.main fieldset.plugin table.content td { background-color:white; padding:10px; }
|
||||
div.foot { background-color:#404040; color:white; padding:5px; height:42px; clear:both; }
|
||||
div.foot div.username { float:right; margin-right:10px; }
|
||||
div.foot div.username div.name { padding:10px; float:left; }
|
||||
div.foot div.username div.icon { float:left; }
|
||||
div.foot div.username img { height:42px; }
|
||||
div.foot div.menu { cursor:pointer; padding:10px; float:left; }
|
||||
div.foot>div.menu:hover { background-color:#323232; }
|
||||
|
||||
div.tabs:hover {
|
||||
background-color:#272727;
|
||||
}
|
||||
div.tabs div.name {
|
||||
height:46px; width:-webkit-fill-available;
|
||||
position:sticky; top:5px;
|
||||
z-index:1;
|
||||
}
|
||||
div.tabs div.name div.item {
|
||||
color:gray; padding:10px; float:left;
|
||||
}
|
||||
div.tabs div.name div.item.select {
|
||||
background-color:#404040; color:white;
|
||||
border-bottom:solid red 2px;
|
||||
}
|
||||
div.tabs div.page {
|
||||
overflow:auto; clear:both;
|
||||
}
|
||||
div.tabs div.page>div.input {
|
||||
padding:5px; position:sticky; top:0px;
|
||||
}
|
||||
div.tabs div.page>div.input input {
|
||||
background-color:#212121; color:white; border:0; outline:none; width:230px;
|
||||
}
|
||||
div.tabs div.page>div.item {
|
||||
background-color:#404040; clear:both; display:none;
|
||||
}
|
||||
div.tabs div.page>div.list {
|
||||
padding-left:20px; display:none; clear:both;
|
||||
}
|
||||
div.tabs div.page>div.list.select {
|
||||
background-color:#323232; display:block;
|
||||
}
|
||||
div.left div.list {
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
div.tabs.left div.name {
|
||||
float:left;
|
||||
}
|
||||
div.tabs.left div.name div.item {
|
||||
border-bottom:none; float:none;
|
||||
}
|
||||
div.tabs.left div.name div.item.select {
|
||||
border-right:solid red 2px;
|
||||
}
|
||||
div.tabs.left div.page {
|
||||
width:-webkit-fill-available;
|
||||
clear:none; float:left;
|
||||
}
|
||||
div.tabs.left div.page>div.item {
|
||||
display:block;
|
||||
}
|
||||
|
||||
div.tabs.void div.name {
|
||||
display:none;
|
||||
}
|
||||
div.tabs.void div.page>div.item {
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
@ -75,22 +75,19 @@ Volcanos(chat.ONENGINE, {help: "解析引擎", _engine: function(event, page, ms
|
||||
}})
|
||||
Volcanos(chat.ONPLUGIN, {help: "注册插件",
|
||||
"parse": shy("解析", {
|
||||
"show": function(can, msg, cmds) {
|
||||
can.require(["/plugin/story/parse.js"], function() {
|
||||
can.onmotion.hidden(can, can._legend)
|
||||
can.onmotion.hidden(can, can._option)
|
||||
can.onmotion.hidden(can, can._status)
|
||||
|
||||
can.ConfHeight(can.ConfHeight()+can.Conf(html.MARGIN_Y)-(can.user.isWindows? 17: 0))
|
||||
|
||||
can.onengine.listen(can, "menu", function(msg) { can.user.toast(can, msg.Option(html.ITEM)) })
|
||||
can.onengine.listen(can, "高级配置", function(msg) { can.user.toast(can, msg.Option(html.ITEM)) })
|
||||
can.onengine.listen(can, "h1", function(msg) { can.user.toast(can, "h1") })
|
||||
|
||||
can.onappend.parse(can, can.onappend._parse(can, cmds[0]))
|
||||
"show": function(can, msg, cmds) { var name = cmds[1]||"can"
|
||||
cmds && cmds[0] && Volcanos(name, {_follow: can.core.Keys(can._follow, name)}, ["/plugin/story/parse.js"], function(sub) {
|
||||
sub.run = can.run, sub.Option = function() {}, can.isCmdMode() && sub.ConfHeight(window.innerHeight)
|
||||
sub.onappend.parse(sub, sub.onappend._parse(sub, cmds[0], name, sub.ConfHeight()), can._output)
|
||||
can.onengine.listen(can, "menu", function(msg) {
|
||||
delete(msg._event), delete(msg._can)
|
||||
can.user.toast(can, JSON.stringify(msg))
|
||||
})
|
||||
})
|
||||
},
|
||||
}, ["text", "show:button@auto"], function(can, msg, cmds, cb) { can._root.Action.run({}, cmds, cb, true) }),
|
||||
}, ["text", "show:button@auto", "clear:button"], function(can, msg, cmds, cb) {
|
||||
cmds && cmds[0] && can._root.Action.run({}, cmds, cb, true)
|
||||
}),
|
||||
|
||||
"plugin": shy("插件", {}, ["text", "list", "back"], function(can, msg, cmds) {
|
||||
msg.Echo("hello world")
|
||||
|
164
panel/header.css
164
panel/header.css
@ -9,167 +9,3 @@ fieldset.Header>div.output div.state.avatar>img { height:31px; }
|
||||
fieldset.Header>div.output div.search { margin-left:20px; float:left; }
|
||||
fieldset.Header>div.output div.search>input { margin-top:-5px; border-radius:0; }
|
||||
|
||||
div.head {
|
||||
background-color:#404040; padding:5px; height:42px; clear:both;
|
||||
}
|
||||
div.left div.username div {
|
||||
color:white; text-align:center; padding:10px;
|
||||
}
|
||||
div.left div.username img {
|
||||
padding:0 10px; width:100px;
|
||||
}
|
||||
div.head div.username img {
|
||||
height:40px; float:left;
|
||||
}
|
||||
div.head div.username div {
|
||||
padding:12px; float:left;
|
||||
}
|
||||
div.head div.username {
|
||||
color:white; float:right;
|
||||
padding-right:10px;
|
||||
}
|
||||
div.head div.menu {
|
||||
color:white; cursor:pointer; padding:10px; float:left;
|
||||
}
|
||||
div.head div.menu:hover {
|
||||
background-color:#323232;
|
||||
}
|
||||
div.left {
|
||||
width:120px;
|
||||
background-color:#323232; overflow:auto; float:left;
|
||||
}
|
||||
div.left:hover {
|
||||
background-color:#323232;
|
||||
}
|
||||
div.left div.item {
|
||||
background-color:#323232;
|
||||
color:white; padding:5px 10px;
|
||||
}
|
||||
div.left div.item:hover {
|
||||
background-color:#404040;
|
||||
}
|
||||
div.main {
|
||||
background-color:#cccccc; height:180px; width:180px; overflow:auto; float:left;
|
||||
}
|
||||
div.main iframe {
|
||||
border:0;
|
||||
}
|
||||
div.main fieldset.plugin {
|
||||
background-color:#f8f8f8; padding:10px; margin:10px;
|
||||
}
|
||||
div.main fieldset.plugin form.option div.item {
|
||||
margin:10px;
|
||||
}
|
||||
div.main fieldset.plugin div.action div.item {
|
||||
margin:10px;
|
||||
}
|
||||
div.main fieldset.plugin legend {
|
||||
box-shadow:none;
|
||||
background-color:#e4e4e4;
|
||||
color:black;
|
||||
display:block;
|
||||
float:left;
|
||||
}
|
||||
div.main fieldset.plugin form.option {
|
||||
display:block;
|
||||
clear:both;
|
||||
}
|
||||
div.main fieldset.plugin select {
|
||||
background-color:white; color:black;
|
||||
border:solid 1px gray; outline:none;
|
||||
box-shadow:none;
|
||||
}
|
||||
div.main fieldset.plugin input[type=text] {
|
||||
background-color:white; color:black; padding:2px 10px;
|
||||
border:solid 1px gray; outline:none;
|
||||
border-radius:3px 3px;
|
||||
box-shadow:none;
|
||||
}
|
||||
div.main fieldset.plugin input[type=button] {
|
||||
background-color:blue; color:white; padding:4px 10px;
|
||||
border:none; border-radius:3px 3px;
|
||||
}
|
||||
div.main fieldset.plugin table.content {
|
||||
border-collapse:collapse;
|
||||
display:block;
|
||||
}
|
||||
div.main fieldset.plugin table.content thead {
|
||||
z-index:1;
|
||||
}
|
||||
div.main fieldset.plugin table.content tr {
|
||||
border:solid 1px lightgray;
|
||||
}
|
||||
div.main fieldset.plugin table.content th {
|
||||
background-color:#fbfbfb; color:rgba(0,0,0,.45); font-weight:100; padding:10px;
|
||||
}
|
||||
div.main fieldset.plugin table.content td {
|
||||
background-color:white; color: #5c5c5c; padding:10px;
|
||||
}
|
||||
div.main fieldset.plugin div.status {
|
||||
color:black;
|
||||
}
|
||||
div.foot {
|
||||
background-color:#404040; height:31px; clear:both;
|
||||
}
|
||||
|
||||
div.tabs:hover {
|
||||
background-color:#272727;
|
||||
}
|
||||
div.tabs div.name {
|
||||
height:46px; width:-webkit-fill-available;
|
||||
position:sticky; top:5px;
|
||||
z-index:1;
|
||||
}
|
||||
div.tabs div.name div.item {
|
||||
color:gray; padding:10px; float:left;
|
||||
}
|
||||
div.tabs div.name div.item.select {
|
||||
background-color:#404040; color:white;
|
||||
border-bottom:solid red 2px;
|
||||
}
|
||||
div.tabs div.page {
|
||||
overflow:auto; clear:both;
|
||||
}
|
||||
div.tabs div.page>div.input {
|
||||
padding:5px; position:sticky; top:0px;
|
||||
}
|
||||
div.tabs div.page>div.input input {
|
||||
background-color:#212121; color:white; border:0; outline:none; width:230px;
|
||||
}
|
||||
div.tabs div.page>div.item {
|
||||
background-color:#404040; clear:both; display:none;
|
||||
}
|
||||
div.tabs div.page>div.list {
|
||||
padding-left:20px; display:none; clear:both;
|
||||
}
|
||||
div.tabs div.page>div.list.select {
|
||||
background-color:#323232; display:block;
|
||||
}
|
||||
div.left div.list {
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
div.tabs.left div.name {
|
||||
float:left;
|
||||
}
|
||||
div.tabs.left div.name div.item {
|
||||
border-bottom:none; float:none;
|
||||
}
|
||||
div.tabs.left div.name div.item.select {
|
||||
border-right:solid red 2px;
|
||||
}
|
||||
div.tabs.left div.page {
|
||||
width:-webkit-fill-available;
|
||||
clear:none; float:left;
|
||||
}
|
||||
div.tabs.left div.page>div.item {
|
||||
display:block;
|
||||
}
|
||||
|
||||
div.tabs.void div.name {
|
||||
display:none;
|
||||
}
|
||||
div.tabs.void div.page>div.item {
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
fieldset.River { overflow:auto; float:left; }
|
||||
fieldset.River>div.action { display:block; padding:0 12px; }
|
||||
fieldset.River>div.output { width:180px; }
|
||||
fieldset.River>div.output div.item { padding:3px 16px; border-left:solid 3px #00ffae; }
|
||||
fieldset.River>div.output div.list div.item { border-left:solid 3px #ccdc4c; }
|
||||
|
@ -195,7 +195,7 @@ Volcanos(chat.ONDETAIL, {help: "菜单交互",
|
||||
})
|
||||
},
|
||||
"删除群组": function(event, can, button, river) {
|
||||
can.runAction(can.request(event, {hash: river}), mdb.REMOVE, [], function(msg) { can.misc.Search(can, {}) })
|
||||
can.runAction(can.request(event, {hash: river}), mdb.REMOVE, [], function(msg) { can.misc.Search(can, {river: "", storm: ""}) })
|
||||
},
|
||||
|
||||
"保存参数": function(event, can, button, river, storm) {
|
||||
@ -217,7 +217,7 @@ Volcanos(chat.ONDETAIL, {help: "菜单交互",
|
||||
},
|
||||
"删除应用": function(event, can, button, river, storm) {
|
||||
can.run(can.request(event, {hash: storm}), [river, chat.STORM, ctx.ACTION, mdb.REMOVE], function(msg) {
|
||||
can.misc.Search(can, {river: river})
|
||||
can.misc.Search(can, {river: river, storm: ""})
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -115,7 +115,8 @@ Volcanos(chat.ONACTION, {help: "交互操作", list: [cli.CLOSE, cli.CLEAR, cli.
|
||||
var cmd = line.cmd == ctx.COMMAND? can.core.Keys(line.type, line.name.split(ice.SP)[0]): can.core.Keys(line.ctx, line.cmd)
|
||||
can.onappend.plugin(can, {type: "plug", index: cmd||msg.Option(mdb.INDEX)}, function(sub, meta) {
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(event, meta.index, cmds, cb) }
|
||||
sub.ConfHeight(can.ConfHeight()-2*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth())
|
||||
can.page.style(can, sub._output, html.MAX_WIDTH, sub.ConfWidth(can.ConfWidth()))
|
||||
sub.ConfHeight(can.ConfHeight()-2*html.ACTION_HEIGHT)
|
||||
sub.Focus()
|
||||
}, can.ui.profile)
|
||||
},
|
||||
|
@ -1,8 +1,13 @@
|
||||
fieldset.layout legend { display:none; }
|
||||
fieldset.layout fieldset.plugin { padding:0; margin:0; }
|
||||
|
||||
fieldset.div div.output td { vertical-align:top; }
|
||||
fieldset.div div.output fieldset.span>fieldset { overflow:auto; float:left; }
|
||||
fieldset.div div.output fieldset.span>div.output>fieldset { overflow:auto; float:left; }
|
||||
|
||||
fieldset.panel.cmd.main fieldset.div>legend { display:none; }
|
||||
fieldset.panel.cmd.main fieldset.div>form.option { display:none; }
|
||||
fieldset.panel.cmd.main fieldset.div>div.action { display:none; }
|
||||
fieldset.panel.cmd.main fieldset.div div.project { display:none; }
|
||||
fieldset.panel.cmd.main fieldset.div div.profile { display:none; }
|
||||
fieldset.word>div.output fieldset.span>fieldset { overflow:auto; float:left; }
|
||||
fieldset.panel.cmd.main fieldset.div>div.status { display:none; }
|
||||
|
||||
|
@ -1,81 +1,59 @@
|
||||
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) {
|
||||
var meta = {}; msg.Table(function(value) { meta[value.key] = value.value })
|
||||
can._meta = can.base.Obj(meta.text, {meta: {name: meta.name||"hi"}, list: []})
|
||||
can._list = can.base.Obj(meta.text, {meta: {name: meta.name||html.DIV}, list: []})
|
||||
can.sup._keys = can.sup._keys||can._list.meta.name
|
||||
can.onimport.layout(can, can._output)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
|
||||
can.ui = can.page.Appends(can, target, [{view: [chat.LAYOUT, html.TABLE], list: [{type: html.TR, list: [
|
||||
{type: html.TD, list: [{view: chat.PROJECT}]},
|
||||
{type: html.TD, list: [{view: chat.DISPLAY}]},
|
||||
{type: html.TD, list: [{view: chat.PROFILE}]},
|
||||
]}] }]), can.ui.project._fieldset = can.ui.display
|
||||
|
||||
can.onimport._item(can, can._meta, can.ui.project, can.onimport._size(can)).click()
|
||||
},
|
||||
_size: function(can) {
|
||||
var width = can.ConfWidth()-260, height = can.ConfHeight()-100
|
||||
if (can.Conf("auto.cmd")) {
|
||||
_item: function(can, keys, item, target, width, height) { width = width||item.meta.width, height = height||item.meta.height
|
||||
var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.meta.name||html.DIV], onclick: function(event) {
|
||||
can.onmotion.select(can, can.ui.project, html.DIV_ITEM, event.target), can.current = event.target, can.onimport._profile(can, keys, item.meta)
|
||||
}, _add: function(data) { item.list.push(data), can.onimport._list(can, keys, item, ui.list, width, height) }}, {view: html.LIST}])
|
||||
|
||||
var field = can.onappend.field(can, item.meta.index? chat.PLUGIN: chat.LAYOUT, item.meta, target._target)
|
||||
can.page.style(can, ui.list._target = field.output, {width: width, height: height})
|
||||
item.meta.style && can.page.ClassList.add(can, ui.list._target, item.meta.style)
|
||||
|
||||
item.meta.index && can.onappend.plugin(can, can.base.Copy({}, item.meta), function(sub) {
|
||||
can.page.style(can, sub._output, {width: width, height: height-2*html.ACTION_HEIGHT})
|
||||
}, target._target, field.fieldset)
|
||||
|
||||
can.onimport._list(can, keys, item, ui.list, width, height)
|
||||
can.sup._keys == keys && ui.item.click()
|
||||
},
|
||||
_list: function(can, keys, item, target, width, height) {
|
||||
if (item.meta.style == html.SPAN) { width = width / item.list.length }
|
||||
if (item.meta.style == html.DIV) { height = height / item.list.length }
|
||||
can.onmotion.clear(can, target), can.onmotion.clear(can, target._target)
|
||||
can.core.List(item.list, function(item) { can.onimport._item(can, can.core.Keys(keys, item.meta.name), item, target, width, height) })
|
||||
},
|
||||
_profile: function(can, keys, meta) { can.onmotion.clear(can, can.ui.profile)
|
||||
var msg = can.request({}); msg.Push(mdb.KEY, "keys"), msg.Push(mdb.VALUE, keys)
|
||||
can.core.List(can.core.Split("name,index,args,style,display,height,width"), function(k) {
|
||||
msg.Push(mdb.KEY, k), msg.Push(mdb.VALUE, meta[k])
|
||||
}), can.sup._keys = keys
|
||||
can.onappend.table(can, msg, function(value, key, index, line, array) {
|
||||
return {text: [value, html.TD], ondblclick: function(event) { var target = event.target
|
||||
key == mdb.VALUE && can.onmotion.modify(can, event.target, function(event, value, old) {
|
||||
target.innerText = meta[line.key] = value, can.onimport.layout(can)
|
||||
}, {name: line.key})
|
||||
}}
|
||||
}, can.ui.profile)
|
||||
},
|
||||
layout: function(can, target) { target = target||can._output
|
||||
can.onmotion.clear(can, target), can.onlayout.profile(can, target), can.ui.project._target = can.ui.content
|
||||
var width = can.ConfWidth()-320, height = can.ConfHeight()
|
||||
if (can.isCmdMode()) {
|
||||
width = can._root._width, height = can._root._height, can.user.title(can._list.meta.name)
|
||||
} else if (can.isFullMode()) {
|
||||
width = can.ConfWidth(), height = can.ConfHeight()
|
||||
can.onmotion.hidden(can, can.ui.project)
|
||||
can.onmotion.hidden(can, can.ui.profile)
|
||||
can.onmotion.hidden(can, can._option)
|
||||
can.onmotion.hidden(can, can._action)
|
||||
can.onmotion.toggle(can, can.ui.project, false)
|
||||
} else {
|
||||
can.onmotion.toggle(can, can.ui.profile, true)
|
||||
}
|
||||
if (can.isCmdMode() || can.user.mod.isDiv) {
|
||||
width = can._root._width, height = can._root._height
|
||||
can.page.style(can, can._output, {width: width, height: height})
|
||||
}
|
||||
return width
|
||||
can.onimport._item(can, can._list.meta.name, can._list, can.ui.project, width, height)
|
||||
},
|
||||
_item: function(can, node, target, width) { width = width||node.meta.width
|
||||
var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, node.meta.name||"hi"]}, {view: [html.LIST]}])
|
||||
ui.list._fieldset = can.onimport._plugin(can, node.meta, target._fieldset, width)
|
||||
|
||||
var msg = can.request({}); msg.Push(node.meta, "", true)
|
||||
ui.item.onclick = function(event) {
|
||||
can.onmotion.select(can, can.ui.project, "div.item", ui.item)
|
||||
can.current = ui.item, can.onmotion.clear(can, can.ui.profile)
|
||||
can.onappend.table(can, msg, function(value, key, index, line, array) {
|
||||
return {text: [value, html.TD], ondblclick: function(event) {
|
||||
key == "value" && can.onmotion.modifys(can, event.target, function(event, value, old) {
|
||||
node.meta[line.key] = value
|
||||
})
|
||||
}}
|
||||
}, can.ui.profile)
|
||||
}
|
||||
|
||||
ui.item._add = function(data) {
|
||||
if (node.meta.style == html.SPAN) { width = width * node.list.length }
|
||||
node.list.push(data)
|
||||
if (node.meta.style == html.SPAN) { width = width / node.list.length }
|
||||
can.onmotion.clear(can, ui.list), can.onmotion.clear(can, ui.list._fieldset)
|
||||
can.core.List(node.list, function(node) { can.onimport._item(can, node, ui.list, width) })
|
||||
}
|
||||
if (node.meta.style == html.SPAN) { width = width / node.list.length }
|
||||
can.core.List(node.list, function(node) { can.onimport._item(can, node, ui.list, width) })
|
||||
return ui.item
|
||||
},
|
||||
_plugin: function(can, meta, target, width) {
|
||||
var size = {width: width, height: meta.height}
|
||||
var field = can.onappend.field(can, chat.LAYOUT, {}, target).fieldset
|
||||
can.page.ClassList.add(can, field, meta.style)
|
||||
can.page.style(can, field, size)
|
||||
|
||||
meta.index && can.runAction(event, ctx.COMMAND, [meta.index], function(msg) {
|
||||
can.onappend._init(can, can.base.Copy({
|
||||
feature: can.base.Obj(msg.Append("meta")),
|
||||
inputs: can.base.Obj(msg.Append("list")),
|
||||
args: meta.args,
|
||||
name: meta.name,
|
||||
}, size), ["/plugin/state.js"], function(sub) {
|
||||
can.page.style(can, sub._output, size)
|
||||
sub.run = function(event, cmds, cb) {
|
||||
can.runActionCommand(event, meta.index, cmds, cb)
|
||||
}
|
||||
}, target, field)
|
||||
})
|
||||
return field
|
||||
},
|
||||
}, ["/plugin/local/chat/div.css"])
|
||||
}, [""])
|
||||
Volcanos(chat.ONACTION, {help: "操作数据",
|
||||
"添加": function(event, can) {
|
||||
can.user.input(event, can, [mdb.NAME, ctx.INDEX, ctx.ARGS, ctx.STYLE, html.HEIGHT, html.WIDTH], function(data) {
|
||||
@ -83,9 +61,6 @@ Volcanos(chat.ONACTION, {help: "操作数据",
|
||||
})
|
||||
},
|
||||
"保存": function(event, can) { var msg = can.request(event, can.Option())
|
||||
can.runAction(event, mdb.MODIFY, [mdb.TEXT, JSON.stringify(can._meta)])
|
||||
},
|
||||
"预览": function(event, can) {
|
||||
can.onmotion.share(event, can, [], [mdb.LINK, can.misc.MergeURL(can, {_path: "/chat/div/"+can.Option("hash")})])
|
||||
can.runAction(event, mdb.MODIFY, [mdb.TEXT, JSON.stringify(can._list)])
|
||||
},
|
||||
})
|
||||
|
@ -6,10 +6,10 @@ fieldset.inner>div.action>div.tabs.select { background-color:steelblue; }
|
||||
|
||||
fieldset.inner>div.output td.content { position:relative; }
|
||||
fieldset.inner>div.output div.content { color:white; font-size:16px; font-family:monospace; position:relative; }
|
||||
fieldset.inner>div.output div.content tr.select { background-color:#0000ff6b; }
|
||||
fieldset.inner>div.output div.content tr.select td.line { background-color:blue; border:solid 1px red; border-right:solid 2px red; }
|
||||
fieldset.inner>div.output div.content td.line { position:sticky; left:0; text-align:right; padding:0 6px; border-right:solid 2px red; }
|
||||
fieldset.inner>div.output div.content td.line:hover { background-color:blue; }
|
||||
fieldset.inner>div.output div.content tr:hover { background-color:#4682b46b; }
|
||||
fieldset.inner>div.output div.content tr.select { background-color:#4682b46b; }
|
||||
fieldset.inner>div.output div.content tr.select td.line { background-color:#6495ed63; border:solid 1px red; border-right:solid 2px red; }
|
||||
fieldset.inner>div.output div.content td.text { white-space:pre; padding-left:10px; cursor:text; }
|
||||
fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; }
|
||||
fieldset.inner>div.output div.content td.text span.keyword { color:yellow; font-weight:bold; }
|
||||
@ -18,6 +18,7 @@ fieldset.inner>div.output div.content td.text span.function { color:cyan; font-w
|
||||
fieldset.inner>div.output div.content td.text span.constant { color:magenta; }
|
||||
fieldset.inner>div.output div.content td.text span.string { color:magenta; }
|
||||
fieldset.inner>div.output td.content iframe { border:0; }
|
||||
fieldset.inner>div.output td.profile iframe { border:0; }
|
||||
|
||||
fieldset.inner>div.output td.content>div.tabs { display:none; }
|
||||
fieldset.inner>div.output td.content>div.path { display:none; }
|
||||
@ -30,6 +31,8 @@ fieldset.inner>div.status legend:hover { background-color:green; }
|
||||
fieldset.inner>div.status { height:31px; overflow:auto; }
|
||||
|
||||
body.white fieldset.inner>div.output div.content { color:black; }
|
||||
body.white fieldset.inner.float>div.output div.content { color:white; }
|
||||
body.black fieldset.inner.float>div.output div.content { color:white; }
|
||||
|
||||
body.simple fieldset.inner>div.output td.content>div.tabs { background-color:gray; padding:0px; height:31px; overflow:auto; display:block; }
|
||||
body.simple fieldset.inner>div.output td.content>div.tabs div.tabs { background-color:gray; font-family:monospace; padding:7px 20px; height:17px; float:left; }
|
||||
@ -47,7 +50,7 @@ body.white.simple fieldset.inner>div.output td.content>div.tabs div.tabs.select
|
||||
body.white.simple fieldset.inner>div.output td.content>div.path { background-color:white; color:black; }
|
||||
body.white.simple fieldset.inner>div.output div.content { background-color:white; color:black; }
|
||||
body.white.simple fieldset.inner>div.output div.content tr.select { background-color:white; }
|
||||
body.white.simple fieldset.inner>div.output div.content tr.select td.line { background-color:white; color:black; border:none; }
|
||||
body.white.simple fieldset.inner>div.output div.content tr.select td.line { background-color:steelblue; color:white; border:none; }
|
||||
body.white.simple fieldset.inner>div.output div.content tr.select td.text { border:solid 1px lightgray; }
|
||||
body.white.simple fieldset.inner>div.output div.content td.text span.string { color:royalblue; }
|
||||
body.white.simple fieldset.inner>div.output div.content td.text span.function { color:darkred; }
|
||||
@ -71,3 +74,4 @@ body.mobile.simple fieldset.inner>div.output div.toggle.display { background-col
|
||||
-o-user-select:none;
|
||||
user-select:none;
|
||||
}
|
||||
body.white.simple fieldset.plugin div.output.json div.item span.nonce { color:lightgray; }
|
||||
|
@ -3,17 +3,20 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0])
|
||||
can.tabview = can.tabview||{}, can.history = can.history||[], can.toolkit = {}, can.extentions = {}
|
||||
can.profile_size = {}, can.display_size = {}
|
||||
can.onengine.plugin(can, can.onplugin)
|
||||
|
||||
can.isCmdMode() && can.onmotion.hidden(can, can._status)
|
||||
can.onmotion.clear(can), can.onlayout.profile(can)
|
||||
can.page.styleWidth(can, can.ui.project, 240)
|
||||
can.onimport._project(can, can.ui.project)
|
||||
can.onimport._profile(can, can.ui.profile)
|
||||
can.onimport._display(can, can.ui.display)
|
||||
can.ui._content = can.ui.content
|
||||
can.onimport._input(can)
|
||||
|
||||
can.ui._content = can.ui.content
|
||||
can.ui._profile_output = can.ui.profile_output
|
||||
can.isCmdMode() && can.onmotion.hidden(can, can._status)
|
||||
can.onengine.plugin(can, can.onplugin)
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
|
||||
switch (can.Mode()) {
|
||||
case "simple": can.onimport._simple(can); break
|
||||
case "float": break
|
||||
@ -28,14 +31,12 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
}), can.onimport._keydown(can)
|
||||
}
|
||||
|
||||
var hash = location.hash
|
||||
can.isCmdMode() || (can.tabview[can.onexport.keys(can)] = msg)
|
||||
var hash = location.hash; can.isCmdMode() || (can.tabview[can.onexport.keys(can)] = msg)
|
||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() {
|
||||
if (can.isCmdMode() && hash) { var args = can.core.Split(decodeURIComponent(hash).slice(1))
|
||||
can.onimport.tabview(can, can.Option(nfs.PATH), args[0], args[1])
|
||||
can.onmotion.delay(can, function() { can.onimport.tabview(can, can.Option(nfs.PATH), args[0], args[1]) })
|
||||
}
|
||||
})
|
||||
can.base.isFunc(cb) && cb(msg)
|
||||
},
|
||||
_input: function(can) {
|
||||
},
|
||||
@ -112,6 +113,11 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
if (can.user.isMobile && can.isFloatMode()) { height = can._root._height-2*html.ACTION_HEIGHT }
|
||||
|
||||
if (can.isCmdMode()) {
|
||||
if (can.ui.display.display != html.NONE) {
|
||||
if (can.ui.display.offsetHeight > can.base.Min(can.ConfHeight() / 2, 200)) {
|
||||
can.page.style(can, can.ui.display_output, html.MAX_HEIGHT, can.base.Min(can.ConfHeight() / 2, 200))
|
||||
}
|
||||
}
|
||||
if (can._status.style.display == html.NONE) { height += html.ACTION_HEIGHT }
|
||||
var rest = can.ui.display.offsetHeight+can.ui._tabs.offsetHeight+can.ui._path.offsetHeight+4
|
||||
can.page.styleHeight(can, can.ui.content, height+html.ACTION_HEIGHT-rest)
|
||||
@ -126,14 +132,8 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.page.styleHeight(can, can.ui.profile_output, can.ui.content.offsetHeight-html.ACTION_HEIGHT)
|
||||
can.page.styleHeight(can, can.ui.project, can.ui.content.offsetHeight+rest)
|
||||
}
|
||||
|
||||
can.page.Select(can, can.ui.profile_output, html.IFRAME, function(item) {
|
||||
can.page.style(can, item,
|
||||
html.HEIGHT, can.ui.profile_output.offsetHeight-4,
|
||||
html.WIDTH, can.ui.profile_output.offsetWidth-5,
|
||||
"margin-left", "-10px", "margin-top", "-10px",
|
||||
"position", "absolute", "border", "0"
|
||||
)
|
||||
can.page.Select(can, can.ui.profile, html.IFRAME, function(iframe) {
|
||||
can.page.Modify(can, iframe, {height: can.ui.profile.offsetHeight-html.ACTION_HEIGHT-4, width: can.ui.profile.offsetWidth})
|
||||
})
|
||||
},
|
||||
project: function(can, path) {
|
||||
@ -175,7 +175,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
delete(can.tabview[key])
|
||||
delete(can._cache_data[can.base.Path(path, file)])
|
||||
delete(can.ui._content._cache[can.base.Path(path, file)])
|
||||
delete(can.ui.profile_output._cache[can.base.Path(path, file)])
|
||||
delete(can.ui._profile_output._cache[can.base.Path(path, file)])
|
||||
delete(can.ui.display_output._cache[can.base.Path(path, file)])
|
||||
msg._content != can.ui._content && can.page.Remove(can, msg._content)
|
||||
}, can.ui._tabs, function(item) {})
|
||||
@ -188,18 +188,27 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
},
|
||||
profile: function(can, msg) {
|
||||
var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2
|
||||
msg && can.onmotion.delay(can, function() {
|
||||
can.onimport.process(can, msg, can.ui.profile_output, width, can.ui.profile.offsetHeight)
|
||||
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
||||
}), can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
||||
if (msg) {
|
||||
var sup = can.tabview[can.onexport.keys(can)]
|
||||
can.onmotion.toggle(can, can.ui.profile_output, false)
|
||||
if (msg.Result().indexOf("<iframe") > -1) {
|
||||
if (sup._profile_output != can.ui._profile_output) { can.page.Remove(can, sup._profile_output) }
|
||||
can.ui.profile_output = sup._profile_output = can.page.Append(can, can.ui.profile_output.parentNode, [{view: "output", inner: msg.Result()}]).output
|
||||
} else {
|
||||
can.ui.profile_output = sup._profile_output = can.ui._profile_output
|
||||
can.onimport.process(can, msg, can.ui._profile_output, width, can.ui.profile.offsetHeight)
|
||||
}
|
||||
}
|
||||
can.onmotion.toggle(can, can.ui.profile_output, true)
|
||||
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
||||
},
|
||||
display: function(can, msg) {
|
||||
var height = can.display_size[can.onexport.keys(can)]||{sh: can.ConfHeight()/2}[can.parse]||can.ConfHeight()/4
|
||||
msg && can.onmotion.delay(can, function() {
|
||||
if (msg) {
|
||||
can.onimport.process(can, msg, can.ui.display_output, can.ui.display.offsetWidth, height)
|
||||
can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.ui.display_status)
|
||||
can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
|
||||
}), can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
|
||||
}
|
||||
can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
|
||||
},
|
||||
process: function(can, msg, target, width, height) { can.onmotion.clear(can, target), can.user.toastSuccess(can)
|
||||
if (msg.Option(ice.MSG_PROCESS) == "_field") {
|
||||
@ -207,7 +216,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.onimport.plug(can, meta, target, function(sub) { width && sub.ConfWidth(width), height && sub.ConfHeight(height), sub.Focus() })
|
||||
})
|
||||
} else if (msg.Option(ice.MSG_DISPLAY) != "") {
|
||||
can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY), target, false, function(msg) { can.onimport.layout(can) })
|
||||
can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY), target, false, function(msg) { can.onmotion.delay(can, function() { can.onimport.layout(can) }) })
|
||||
} else {
|
||||
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target)
|
||||
}
|
||||
@ -292,23 +301,21 @@ Volcanos(chat.ONSYNTAX, {help: "语法高亮", list: ["keyword", "prefix", "line
|
||||
msg.Option(ctx.INDEX) && can.onmotion.focus(can, can.page.Select(can, can.ui.content, html.OPTION_ARGS)[0])
|
||||
})
|
||||
|
||||
can.page.Select(can, can._output, can.page.Keys("div.content", html.IFRAME), function(item) {
|
||||
can.page.Select(can, can.ui._content.parentNode, can.page.Keys("div.content", html.IFRAME), function(item) {
|
||||
if (can.onmotion.toggle(can, item, item == msg._content)) { can.ui.content = msg._content }
|
||||
})
|
||||
can.page.Select(can, can.ui._profile_output.parentNode, can.page.Keys("div.output"), function(item) {
|
||||
if (can.onmotion.toggle(can, item, item == msg._profile_output)) { msg._profile_output }
|
||||
})
|
||||
return can.file
|
||||
}, can.ui._content, can.ui.profile_output, can.ui.display_output) && !skip) {
|
||||
}, can.ui._content, can.ui._profile_output, can.ui.display_output) && !skip) {
|
||||
return can.onaction.selectLine(null, can, msg.Option(nfs.LINE)), can.base.isFunc(cb) && cb()
|
||||
}
|
||||
|
||||
can.onmotion.clear(can, can.ui.content), can.onimport.layout(can)
|
||||
if (msg.Option(ctx.INDEX)) {
|
||||
if (msg.Option(nfs.LINE) == web.DREAM) {
|
||||
if (msg._content) {
|
||||
can.page.Select(can, can._output, can.page.Keys("div.content", html.IFRAME), function(item) {
|
||||
if (can.onmotion.toggle(can, item, item == msg._content)) { can.ui.content = msg._content }
|
||||
})
|
||||
return
|
||||
}
|
||||
if (msg._content) { return }
|
||||
can.ui.content = msg._content = can.page.insertBefore(can, [{type: html.IFRAME, src: can.misc.MergeURL(can, {pod: msg.Option(nfs.FILE), topic: can.misc.Search(can, "topic")}, true), width: can.ui.content.offsetWidth, height: can.ui.content.offsetHeight}], can.ui.content)
|
||||
return can.onimport.layout(can)
|
||||
}
|
||||
@ -411,6 +418,30 @@ Volcanos(chat.ONSYNTAX, {help: "语法高亮", list: ["keyword", "prefix", "line
|
||||
"complex": "function", "real": "function", "imag": "function",
|
||||
},
|
||||
},
|
||||
zml: {
|
||||
prefix: {
|
||||
"# ": "comment",
|
||||
},
|
||||
keyword: {
|
||||
"return": "keyword",
|
||||
|
||||
"head": "keyword",
|
||||
"left": "keyword",
|
||||
"main": "keyword",
|
||||
"foot": "keyword",
|
||||
"tabs": "keyword",
|
||||
|
||||
"index": "function",
|
||||
"action": "function",
|
||||
"args": "function",
|
||||
"type": "function",
|
||||
"style": "function",
|
||||
"width": "function",
|
||||
|
||||
"auto": "constant",
|
||||
"username": "constant",
|
||||
},
|
||||
},
|
||||
css: {
|
||||
keyword: {
|
||||
"body": "keyword",
|
||||
|
@ -1,6 +1,6 @@
|
||||
fieldset.vimer>div.output input.current {
|
||||
background-color:#00000000; color:#00000000; font-size:1em; font-family:monospace;
|
||||
padding:0; padding-left:12px; border:none; outline:none; margin:0; margin-top:1px;
|
||||
padding:0; padding-left:12px; border:none; outline:none; margin:0; margin-top:-3px;
|
||||
height:22px; position:absolute;
|
||||
}
|
||||
fieldset.vimer>div.output input.current.normal { caret-color:gray; }
|
||||
@ -33,6 +33,9 @@ body.simple fieldset.vimer>div.output div.complete table.content td {
|
||||
font-size:1rem;
|
||||
}
|
||||
|
||||
body.simple fieldset.vimer>div.output input.current {
|
||||
margin-top:1px;
|
||||
}
|
||||
body.white fieldset.vimer>div.output input.current.insert { caret-color:black; }
|
||||
body.white fieldset.vimer>div.output input.current.normal { caret-color:lightgray; }
|
||||
|
||||
|
@ -28,7 +28,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
project: function(can, path) {
|
||||
can.onimport.zone(can, [
|
||||
can.isCmdMode() && {name: "create", _init: function(target) { can.onappend._action(can, can.onaction.list, target) }},
|
||||
{name: "source", _init: function(target) { var total = 0
|
||||
{name: "source", _init: function(target, zone) { var total = 0
|
||||
function show(path, target) { can.run(can.request({}, {dir_root: path, dir_deep: true}), [ice.PWD], function(msg) { var list = msg.Table()
|
||||
can.core.List(list, function(item) { if (can.Option(nfs.FILE).indexOf(item.path) == 0) { item.expand = true }
|
||||
item._init = function(target) { target.onmouseenter = function(event) { can.user.carteRight(event, can, {
|
||||
@ -39,25 +39,29 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
can.onimport.tree(can, list, nfs.PATH, ice.PS, function(event, item) {
|
||||
can.onimport.tabview(can, path, item.path) // 显示文件
|
||||
}, target), can.Status("文件数", total += msg.Length())
|
||||
can.page.Modify(can, zone._search, {placeholder: "search in "+total+" item"})
|
||||
}, true) } if (path.length == 1) { return show(path[0], target) }
|
||||
|
||||
can.onimport.zone(can, can.core.List(path, function(path) { return {name: path, _init: function(target) { show(path, target) }} }), target)
|
||||
can.onmotion.delay(can, function() { target.previousSibling.innerHTML = "" })
|
||||
}},
|
||||
{name: "plugin", _init: function(target) {
|
||||
can.onimport.tree(can, can.core.Item(can.onengine.plugin.meta, function(key) { return {index: can.base.trimPrefix(key, "can.")} }), ctx.INDEX, ice.PT, function(event, item) {
|
||||
{name: "plugin", _init: function(target, zone) { var total = 0
|
||||
can.onimport.tree(can, can.core.Item(can.onengine.plugin.meta, function(key) { return total++, {index: can.base.trimPrefix(key, "can.")} }), ctx.INDEX, ice.PT, function(event, item) {
|
||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.core.Keys("can", item.index), ctx.INDEX) // 显示插件
|
||||
}, target)
|
||||
can.page.Modify(can, zone._search, {placeholder: "search in "+total+" item"})
|
||||
}},
|
||||
{name: "module", _init: function(target) {
|
||||
{name: "module", _init: function(target, zone) {
|
||||
can.runAction(can.request({}, {fields: ctx.INDEX}), ctx.COMMAND, [mdb.SEARCH, ctx.COMMAND], function(msg) {
|
||||
can.page.Modify(can, zone._search, {placeholder: "search in "+msg.Length()+" item"})
|
||||
can.onimport.tree(can, msg.Table(), ctx.INDEX, ice.PT, function(event, item) {
|
||||
can.onimport.tabview(can, can.Option(nfs.PATH), item.index, ctx.INDEX) // 显示模块
|
||||
}, target)
|
||||
})
|
||||
}},
|
||||
{name: "dreams", _init: function(target) { var call = arguments.callee
|
||||
{name: "dreams", _init: function(target, zone) { var call = arguments.callee
|
||||
can.runAction({}, ice.RUN, [web.DREAM], function(msg) {
|
||||
can.page.Modify(can, zone._search, {placeholder: "search in "+msg.Length()+" item"})
|
||||
msg.Table(function(item) {
|
||||
function carte(event) {
|
||||
var list = []; switch (item.status) {
|
||||
|
@ -21,7 +21,7 @@ fieldset.word.float { padding:0; margin:0; width:-webkit-fill-available; positio
|
||||
fieldset.word.float>div.action { display:contents; }
|
||||
fieldset.word.float>div.status { clear:none; }
|
||||
fieldset.word.float>div.output { background-color:#f0f8ff80; padding:20px; overflow:auto; }
|
||||
fieldset.word.float>div.output>div.project { background:darkcyan; padding:10px; position:fixed; right:0; top:31px; z-index:10; }
|
||||
fieldset.word.float>div.output>div.project { background:#4682b46b; padding:10px; position:fixed; right:0; top:31px; z-index:10; }
|
||||
fieldset.word.float div.content div.page { margin-top:31px; display:none; }
|
||||
fieldset.word.float div.content div.page.show { display:block; }
|
||||
fieldset.word.float div.content.grid div.page { background-color:#a4cbecb5; margin:10px; height:200px; width:200px; overflow:auto; display:block; float:left; }
|
||||
|
@ -94,14 +94,13 @@ Volcanos(chat.ONACTION, {help: "交互操作", list: [
|
||||
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
||||
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
|
||||
if (can.page.ClassList.neg(can, can._target, "full")) {
|
||||
var height = can._root._height-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT; can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
||||
can._mode = can.Mode(), can._height_bak = sub.ConfHeight(), can._width_bak = sub.ConfWidth()
|
||||
can.Mode("full"), can.ConfHeight(height), can.ConfWidth(can._root._width)
|
||||
sub.Mode("full")
|
||||
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(can._root._width))
|
||||
var height = window.innerHeight-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT; can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
||||
can._mode_bak = can.Mode(), can._height_bak = sub.ConfHeight(), can._width_bak = sub.ConfWidth()
|
||||
sub.Mode("full"), can.Mode("full"), can.ConfHeight(height), can.ConfWidth(window.innerWidth)
|
||||
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(window.innerWidth))
|
||||
} else {
|
||||
can.Mode(can._mode), can.ConfHeight(can._height_bak), can.ConfWidth(can._width_bak)
|
||||
sub.Mode(can._mode), sub.ConfHeight(can._height_bak), sub.ConfWidth(can._width_bak)
|
||||
can.Mode(can._mode_bak||""), can.ConfHeight(can._height_bak), can.ConfWidth(can._width_bak)
|
||||
sub.Mode(can._mode_bak||""), sub.ConfHeight(can._height_bak), sub.ConfWidth(can._width_bak)
|
||||
can.page.style(can, can._output, html.HEIGHT, "", html.MIN_WIDTH, "")
|
||||
}
|
||||
can.core.CallFunc([sub, chat.ONIMPORT, html.LAYOUT], {can: sub})
|
||||
|
@ -1,181 +1,157 @@
|
||||
Volcanos(chat.ONAPPEND, {help: "渲染引擎",
|
||||
Volcanos(chat.ONAPPEND, {help: "渲染引擎", list: ["{", "}", html.HEAD, html.LEFT, html.MAIN, html.FOOT],
|
||||
_parse: function(can, text, name, height) { var stack = [{_deep: -1, list: []}], finish = false
|
||||
can.core.List(can.core.Split(text, ice.NL, ice.NL, ice.NL), function(line) { if (line == "" || finish) { return }
|
||||
var deep = 0; for (var i = 0; i < line.length; i++) { if (line[i] == ice.SP) { deep++ } else if (line[i] == ice.TB) { deep += 4 } else { break } }
|
||||
for (var i = stack.length-1; i > 0; i--) { if (deep <= stack[i]._deep) { stack.pop() } }
|
||||
|
||||
var ls = can.core.Split(line); if (ls[0] == "return ") { return finish = true }
|
||||
var item = {_deep: deep, list: []}; var list = stack[stack.length-1]; list.list.push(item); if (deep > list._deep) { stack.push(item) }
|
||||
can.onappend.list.indexOf(ls[0]) > -1 || can.onappend[ls[0]]? item.type = ls[0]: item.name = ls[0]
|
||||
for (var i = 1; i < ls.length; i += 2) { can.core.Value(item, ls[i], ls[i+1]) }
|
||||
})
|
||||
return {type: name, style: {height: height||can.ConfHeight()||window.innerHeight}, list: stack[0].list}
|
||||
},
|
||||
parse: function(can, list, target, keys, data, type) { target = target||can._output, data = data||{}
|
||||
if (!list) { return } else if (can.base.isArray(list)) {
|
||||
return can.core.List(list, function(meta, index) {
|
||||
return can.onappend.parse(can, meta, target, keys, data, type)
|
||||
})
|
||||
return can.core.List(list, function(meta, index) { return can.onappend.parse(can, meta, target, keys, data, type) })
|
||||
|
||||
} else if (can.base.isString(list)) {
|
||||
var ls = can.core.Split(list, "", ":=@"); if (ls.length == 1) {
|
||||
var meta = type? {type: type, name: ls[0]}: {type: ls[0]}
|
||||
} else {
|
||||
var meta = {name: ls[0]}; for (var i = 1; i < ls.length; i += 2) { switch (ls[i]) {
|
||||
case ":": meta.type = ls[i+1]; break
|
||||
case "=": meta.value = ls[i+1]; break
|
||||
case "@": meta.action = ls[i+1]; break
|
||||
case "=": meta.value = ls[i+1]; break
|
||||
case ":": meta.type = ls[i+1]; break
|
||||
} }
|
||||
}
|
||||
|
||||
} else if (can.base.isObject(list)) { var meta = list }
|
||||
|
||||
keys = can.core.Keys(keys, meta.name||meta.type)
|
||||
var item = {view: meta.type}, init, subtype; switch (meta.type) {
|
||||
case html.HEAD: subtype = "menu", data = {}
|
||||
init = function(target) { data.head = target
|
||||
can.page.ClassList.add(can, target, html.LAYOUT)
|
||||
}
|
||||
var item = {view: meta.type}; switch (meta.type) {
|
||||
case html.HEAD: meta.subtype = html.MENU
|
||||
meta.init = function(target) { can.page.ClassList.add(can, target, html.LAYOUT), data.head = target }
|
||||
break
|
||||
case html.LEFT: subtype = "item"
|
||||
init = function(target) {
|
||||
can.page.ClassList.add(can, target, html.LAYOUT)
|
||||
can.core.Timer(10, function() { var height = target.parentNode.offsetHeight
|
||||
case "{": if (meta._deep > 0) { return }
|
||||
item.view = meta.type = html.LEFT // no break
|
||||
case html.LEFT: meta.subtype = html.ITEM
|
||||
meta.init = function(target) { can.page.ClassList.add(can, target, html.LAYOUT), data.left = target
|
||||
can.onmotion.delay(can, function() { var height = target.parentNode.offsetHeight
|
||||
can.page.Select(can, target.parentNode, can.page.Keys(html.DIV_LAYOUT_HEAD, html.DIV_LAYOUT_FOOT), function(item) {
|
||||
height -= item.offsetHeight
|
||||
}), can.page.style(can, target, html.HEIGHT, height)
|
||||
})
|
||||
}
|
||||
break
|
||||
case html.MAIN:
|
||||
init = function(target) { data.main = target
|
||||
can.page.ClassList.add(can, target, html.LAYOUT)
|
||||
can.core.Timer(10, function() { var height = target.parentNode.offsetHeight
|
||||
can.page.Select(can, target.parentNode, can.page.Keys(html.DIV_LAYOUT_HEAD, html.DIV_LAYOUT_FOOT), function(item) {
|
||||
height -= item.offsetHeight
|
||||
}), can.page.style(can, target, html.HEIGHT, height)
|
||||
})
|
||||
|
||||
can.core.Timer(100, function() {
|
||||
var width = target.parentNode.offsetWidth
|
||||
can.page.Select(can, target.parentNode, html.DIV_LAYOUT_LEFT, function(item) {
|
||||
width -= item.offsetWidth+1
|
||||
}), can.page.style(can, target, html.WIDTH, width)
|
||||
})
|
||||
|
||||
}
|
||||
break
|
||||
case html.FOOT:
|
||||
init = function(target) { data.foot = target
|
||||
can.page.ClassList.add(can, target, html.LAYOUT)
|
||||
}
|
||||
break
|
||||
case html.TABS:
|
||||
item.list = [{view: "name"}, {view: html.PAGE}], item._init = function(_target, ui) {
|
||||
can.page.Append(can, ui.page, [{view: html.INPUT, list: [{type: html.INPUT, onkeyup: function(event) {
|
||||
can.page.Select(can, _target, [html.DIV_PAGE, html.DIV_ITEM], function(item) {
|
||||
can.page.ClassList.set(can, item, html.HIDE, item.innerText.indexOf(event.target.value) == -1)
|
||||
})
|
||||
}}]}])
|
||||
can.core.List(meta.list, function(item, index) {
|
||||
can.page.Append(can, ui.name, [{view: [html.ITEM, html.DIV, item.name||item], onclick: function(event) {
|
||||
can.onmotion.select(can, _target, [[html.DIV_PAGE, html.DIV_LIST]], index)
|
||||
can.onmotion.select(can, ui.name, html.DIV_ITEM, index)
|
||||
ui.page.scrollTo(0, 0)
|
||||
}}])
|
||||
can.page.Append(can, ui.page, [{view: [html.ITEM, html.DIV, item.name], onclick: function(event) {
|
||||
can.page.ClassList.neg(can, event.target.nextSibling, html.SELECT)
|
||||
can.onmotion.select(can, ui.name, html.DIV_ITEM, index)
|
||||
}}, {view: [html.LIST], _init: function(target) {
|
||||
can.onappend.parse(can, item.list, target, can.core.Keys(keys, item.name), data, html.ITEM)
|
||||
}}])
|
||||
})
|
||||
can.core.Timer(100, function() { var height = target.offsetHeight
|
||||
can.page.style(can, ui.page, html.HEIGHT, height-10-(meta.style? 0: ui.name.offsetHeight))
|
||||
can.page.style(can, _target, html.HEIGHT, height-10)
|
||||
}), can.page.Select(can, ui.name, html.DIV_ITEM)[0].click()
|
||||
}
|
||||
break
|
||||
case aaa.USERNAME:
|
||||
can.page.Append(can, target, [
|
||||
can.base.Copy({view: [aaa.USERNAME, html.DIV], onclick: function(event) {
|
||||
}, list: [{view: ["some", html.DIV, can.user.info.usernick]}, {img: can.user.info.avatar}]})])
|
||||
return
|
||||
}
|
||||
|
||||
item._init = item._init||function(target) {
|
||||
meta.list && can.onappend.parse(can, meta.list, target, keys, data, type||subtype)
|
||||
can.base.isFunc(init) && init(target), can.base.isFunc(meta.init) && meta.init(target)
|
||||
}
|
||||
if (can.base.isString(meta.style)) { item.className = meta.style }
|
||||
if (can.base.isObject(meta.style)) { item.style = meta.style }
|
||||
|
||||
if ((meta.type||type) == html.MENU) {
|
||||
can.page.Append(can, target, [can.base.Copy({view: [html.MENU, html.DIV, meta.name||meta], onclick: function(event) {
|
||||
if (meta.list && meta.list.length > 0) { return }
|
||||
can.onengine.signal(can, meta.name) || can.onengine.signal(can, html.MENU, can.request(event, {item: meta.name}))
|
||||
}, onmouseenter: function(event) {
|
||||
meta.list && meta.list.length > 0 && can.user.carte(event, can, {}, meta.list, function(event, item) {
|
||||
can.onengine.signal(can, item) || can.onengine.signal(can, meta.name, can.request(event, {item: item}))
|
||||
})
|
||||
}})]).first
|
||||
return
|
||||
}
|
||||
if ((type||subtype) == html.ITEM) { item.view = item.view||html.LIST
|
||||
if (meta.action == "auto") {
|
||||
meta.init = meta.init||function(item) { can.core.Timer(100, function() { item.click() }) }
|
||||
}
|
||||
if (decodeURIComponent(location.hash) == "#"+can.core.Keys(keys, item.name)) {
|
||||
meta.init = meta.init||function(item) { can.core.Timer(300, function() { item.click() }) }
|
||||
}
|
||||
|
||||
var _item = can.page.Append(can, target, [can.base.Copy({view: [html.ITEM, html.DIV, meta.name||meta], onclick: function(event) {
|
||||
var url = can.misc.MergeURL(can, {pod: can.misc.Search(can, "pod"), cmd: meta.index})
|
||||
if (meta.action == "push") { return can.user.jumps(url) }
|
||||
if (meta.action == "open") { return can.user.open(url) }
|
||||
location.hash = can.core.Keys(keys, item.name)
|
||||
|
||||
switch (meta.type) {
|
||||
case html.PLUGIN:
|
||||
if (can.onmotion.cache(can, function() { return keys }, data.main)) { break }
|
||||
if (can.base.Ext(meta.index) == nfs.ZML || can.base.Ext(meta.index) == nfs.IML) {
|
||||
can.page.Append(can, data.main, [{type: html.IFRAME, src: "/chat/cmd/"+meta.index,
|
||||
height: data.main.offsetHeight, width: data.main.offsetWidth,
|
||||
}])
|
||||
break
|
||||
}
|
||||
|
||||
can.onappend.plugin(can, {index: meta.index, args: can.base.Obj(meta.args)}, function(sub) {
|
||||
sub.ConfHeight(data.main.offsetHeight-160)
|
||||
sub.run = function(event, cmds, cb, silent) {
|
||||
can.page.style(can, sub._output, html.MAX_WIDTH, sub.ConfWidth(data.main.offsetWidth-40))
|
||||
can.runActionCommand(event, sub._index||meta.index, cmds, function(msg) {
|
||||
cb(msg), can.core.Timer(10, function() {
|
||||
can.page.style(can, sub._table, html.MAX_HEIGHT, data.main.offsetHeight-150)
|
||||
})
|
||||
})
|
||||
if (item.parentNode == target.parentNode) {
|
||||
height -= item.offsetHeight // 高度
|
||||
}
|
||||
}, data.main)
|
||||
default:
|
||||
meta.list && can.onmotion.toggle(can, event.target.nextSibling)
|
||||
}), can.page.style(can, target, html.HEIGHT, height)
|
||||
})
|
||||
}
|
||||
}})]).first; can.core.ItemCB(meta, function(key, cb) { _item[key] = can.base.isFunc(cb)? cb: function(event) {
|
||||
can.onengine.signal(can, cb, can.request(event))
|
||||
} })
|
||||
can.core.Timer(10, function() { meta.init && meta.init(_item) })
|
||||
if (!meta.list) { return }
|
||||
}
|
||||
return can.page.Append(can, target, [item]).first
|
||||
},
|
||||
_parse: function(can, text) { var stack = [{_deep: -1, list: []}]
|
||||
can.core.List(can.core.Split(text, ice.NL, ice.NL, ice.NL), function(line) { if (line == "") { return }
|
||||
var deep = 0; for (var i = 0; i < line.length; i++) { if (line[i] == ice.SP) { deep++ } else if (line[i] == ice.TB) { deep += 4 } else { break } }
|
||||
for (var i = stack.length-1; i > 0; i--) { if (deep <= stack[i]._deep) { stack.pop() } }
|
||||
break
|
||||
case "}": if (meta._deep > 0) { return }
|
||||
item.view = meta.type = html.MAIN // no break
|
||||
case html.MAIN:
|
||||
meta.init = function(target) { can.page.ClassList.add(can, target, html.LAYOUT)
|
||||
can.onmotion.delay(can, function() { var height = target.parentNode.offsetHeight
|
||||
can.page.Select(can, target.parentNode, can.page.Keys(html.DIV_LAYOUT_HEAD, html.DIV_LAYOUT_FOOT), function(item) {
|
||||
if (item.parentNode == target.parentNode) {
|
||||
height -= item.offsetHeight // 高度
|
||||
}
|
||||
}), can.page.style(can, target, html.HEIGHT, height)
|
||||
}, data.main? 10: 100)
|
||||
can.onmotion.delay(can, function() { var width = target.parentNode.offsetWidth
|
||||
can.page.Select(can, target.parentNode, html.DIV_LAYOUT_LEFT, function(item) {
|
||||
if (item.parentNode == target.parentNode) {
|
||||
width -= item.offsetWidth // 宽度
|
||||
}
|
||||
}), can.page.style(can, target, html.WIDTH, width)
|
||||
}, data.main? 10: 100)
|
||||
|
||||
var item = {_deep: deep, list: []}; var list = stack[stack.length-1]; list.list.push(item); if (deep > list._deep) { stack.push(item) }
|
||||
var ls = can.core.Split(line); switch (ls[0]) {
|
||||
case html.HEAD:
|
||||
case html.LEFT:
|
||||
case html.MAIN:
|
||||
case html.FOOT:
|
||||
case html.TABS:
|
||||
case aaa.USERNAME:
|
||||
case html.MENU: item.type = ls[0]; break
|
||||
default: item.name = ls[0]; break
|
||||
}
|
||||
for (var i = 1; i < ls.length; i += 2) { can.core.Value(item, ls[i], ls[i+1])
|
||||
if (ls[i] == ctx.INDEX) { item.type = item.type||html.PLUGIN }
|
||||
}
|
||||
})
|
||||
return {type: "demo", style: {height: can.ConfHeight()||can._root._height}, list: stack[0].list}
|
||||
if (!data.main) { data.main = target
|
||||
can.onmotion.delay(can, function() { data.main_init && data.main_init() }, 300)
|
||||
}
|
||||
}
|
||||
break
|
||||
case html.FOOT: meta.subtype = html.MENU
|
||||
meta.init = function(target) { can.page.ClassList.add(can, target, html.LAYOUT), data.foot = target }
|
||||
break
|
||||
default: var cb = can.onappend[meta.type]; cb && cb(can, item, meta, target, data)
|
||||
}
|
||||
if (can.base.isObject(meta.style)) { item.style = meta.style }
|
||||
if (can.base.isString(meta.style)) { item.className = meta.style }
|
||||
|
||||
meta.keys = meta.keys||can.core.Keys(keys, meta.name||meta.type)
|
||||
var cb = can.onappend[type]; !can.onappend[meta.type] && cb && cb(can, item, meta, target, data)
|
||||
item._init = item._init||function(target) { meta.list && can.onappend.parse(can, meta.list, target, meta.keys, data, meta.subtype||type) }
|
||||
item.target = can.page.Append(can, target, [item]).first; meta.init && meta.init(item.target)
|
||||
can.core.ItemCB(meta, function(key, cb) { item.target[key] = can.base.isFunc(cb)? cb: function(event) { can.onengine.signal(can, cb, can.request(event, meta)) } })
|
||||
},
|
||||
username: function(can, item, meta, target) {
|
||||
can.base.Copy(item, {view: [aaa.USERNAME, html.DIV], list: [{view: [html.NAME, html.DIV, can.user.info.usernick]}, {view: [html.ICON, html.DIV], list: [{img: can.user.info.avatar}]}]})
|
||||
},
|
||||
menu: function(can, item, meta, target) {
|
||||
can.base.Copy(item, meta.list && meta.list.length > 0? {view: [html.MENU, html.DIV, meta.name], onmouseenter: function(event) {
|
||||
can.user.carte(event, can, {}, can.core.List(meta.list, function(item) { return item.name }), function(event, button, meta) {
|
||||
can.onengine.signal(can, button) || can.onengine.signal(can, html.MENU, can.request(event, {item: button}))
|
||||
})
|
||||
}, _init: function() {}}: {view: [html.MENU, html.DIV, meta.name], onclick: function(event) {
|
||||
can.onengine.signal(can, meta.name) || can.onengine.signal(can, html.MENU, can.request(event, {item: meta.name}))
|
||||
}, _init: function() {}})
|
||||
},
|
||||
item: function(can, item, meta, target, data) { item.view = item.view||html.LIST
|
||||
if (decodeURIComponent(location.hash) == "#"+meta.keys) {
|
||||
data.main_init = function() { can.onappend._show(can, meta, data) }
|
||||
}
|
||||
if (meta.action == ice.AUTO && !location.hash) {
|
||||
data.main_init = function() { can.onappend._show(can, meta, data) }
|
||||
}
|
||||
|
||||
can.base.Copy(item, {view: "some", list: [{view: [html.ITEM, html.DIV, meta.name||meta], onclick: function(event) {
|
||||
can.onappend._show(can, meta, data), can.onkeymap.prevent(event), event.target.nextSibling && can.onmotion.toggle(can, event.target.nextSibling)
|
||||
}}, {view: html.LIST, _init: function(target) { meta.list && can.onappend.parse(can, meta.list, target, meta.keys, data, html.ITEM) }}], _init: function() {}})
|
||||
},
|
||||
tabs: function(can, item, meta, target) {
|
||||
item.list = [{view: "name"}, {view: html.PAGE}], item._init = function(_target, ui) {
|
||||
can.page.Append(can, ui.page, [{view: html.INPUT, list: [{type: html.INPUT, onkeyup: function(event) {
|
||||
can.page.Select(can, _target, [html.DIV_PAGE, html.DIV_ITEM], function(item) {
|
||||
can.page.ClassList.set(can, item, html.HIDE, item.innerText.indexOf(event.target.value) == -1)
|
||||
})
|
||||
}}]}])
|
||||
can.core.List(meta.list, function(item, index) {
|
||||
can.page.Append(can, ui.name, [{view: [html.ITEM, html.DIV, item.name||item], onclick: function(event) {
|
||||
can.onmotion.select(can, _target, [[html.DIV_PAGE, html.DIV_LIST]], index)
|
||||
can.onmotion.select(can, ui.name, html.DIV_ITEM, index)
|
||||
ui.page.scrollTo(0, 0)
|
||||
}}])
|
||||
can.page.Append(can, ui.page, [{view: [html.ITEM, html.DIV, item.name], onclick: function(event) {
|
||||
can.page.ClassList.neg(can, event.target.nextSibling, html.SELECT)
|
||||
can.onmotion.select(can, ui.name, html.DIV_ITEM, index)
|
||||
}}, {view: [html.LIST], _init: function(target) {
|
||||
can.onappend.parse(can, item.list, target, can.core.Keys(meta.keys, item.name), data, html.ITEM)
|
||||
}}])
|
||||
})
|
||||
can.core.Timer(100, function() { var height = target.offsetHeight
|
||||
can.page.style(can, ui.page, html.HEIGHT, height-10-(meta.style? 0: ui.name.offsetHeight))
|
||||
can.page.style(can, _target, html.HEIGHT, height-10)
|
||||
}), can.page.Select(can, ui.name, html.DIV_ITEM)[0].click()
|
||||
}
|
||||
},
|
||||
_show: function(can, meta, data) { var target = data.main
|
||||
if (!meta.index) { return }
|
||||
var url = can.misc.MergeURL(can, {pod: can.misc.Search(can, "pod"), cmd: meta.index})
|
||||
if (meta.action == "push") { return can.user.jumps(url) }
|
||||
if (meta.action == "open") { return can.user.open(url) }
|
||||
|
||||
location.hash = meta.keys
|
||||
if (can.onmotion.cache(can, function() { return meta.keys }, target)) { return }
|
||||
|
||||
if (can.base.Ext(meta.index) == nfs.ZML || can.base.Ext(meta.index) == nfs.IML) {
|
||||
return can.page.Append(can, target, [{type: html.IFRAME, src: "/chat/cmd/"+meta.index, height: target.offsetHeight, width: target.offsetWidth}])
|
||||
}
|
||||
|
||||
can.onappend.plugin(can, {index: meta.index, args: can.base.Obj(meta.args)}, function(sub) {
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(event, sub._index||meta.index, cmds, cb) }
|
||||
sub.ConfHeight(target.offsetHeight-3*html.ACTION_HEIGHT-6*html.PLUGIN_MARGIN), sub.ConfWidth(target.offsetWidth-4*html.PLUGIN_MARGIN)
|
||||
can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight())
|
||||
can.page.style(can, sub._output, html.MAX_WIDTH, sub.ConfWidth())
|
||||
}, target)
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -116,7 +116,7 @@ Volcanos(chat.ONDETAIL, {help: "用户交互",
|
||||
Volcanos(chat.ONEXPORT, {help: "导出数据", list: ["from", "commit", "total", "max", "date", "text", "add", "del"],
|
||||
height: function(can) { var height = can.Action(html.HEIGHT)
|
||||
if (height == ice.AUTO) { height = can.ConfHeight()
|
||||
can.isFullMode() || (height = can.base.Max(can.ConfHeight(), 600))
|
||||
// can.isFullMode() || (height = can.base.Max(can.ConfHeight(), 600))
|
||||
}
|
||||
if (height < 200) { height = 200 }
|
||||
return parseInt(height||can._root._height/2)
|
||||
|
@ -37,13 +37,13 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
})
|
||||
}, onclick: function(event) {
|
||||
can.onmotion.focus(can, event.target)
|
||||
}, _init: function(target) {
|
||||
}, _init: function(target) { zone._search = target
|
||||
can.onmotion.delay(can, function() { can.page.styleWidth(can, target, target.parentNode.parentNode.parentNode.offsetWidth-32) })
|
||||
}}], target, {})
|
||||
}},
|
||||
{view: html.LIST, _init: function(target) { can.ui[zone.name] = zone
|
||||
zone._target = target, zone.refresh = function() { can.onmotion.clear(can, target), zone._init(target) }
|
||||
can.base.isFunc(zone._init) && zone._init(target)
|
||||
can.base.isFunc(zone._init) && zone._init(target, zone)
|
||||
}}
|
||||
]} }))
|
||||
},
|
||||
@ -109,7 +109,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
{view: [wiki.TITLE, html.DIV, value.name]},
|
||||
{view: [wiki.CONTENT, html.DIV, value.text]},
|
||||
{view: html.ACTION, inner: value.action, onclick: function(event) {
|
||||
can.runAction(can.request(event, value), event.target.name, [])
|
||||
can.runAction(can.request(event, value, {_handle: ice.FALSE}), event.target.name, [])
|
||||
}},
|
||||
]}
|
||||
}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user