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

opt service

This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-04-26 23:37:04 +08:00
parent 92ce8ced89
commit 2372a78e57
10 changed files with 54 additions and 31 deletions

View File

@ -202,12 +202,15 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
can.base.isUndefined(item) || can.onappend.input(can, item == ""? /* 1.空白 */ {type: html.BR}: can.base.isUndefined(item) || can.onappend.input(can, item == ""? /* 1.空白 */ {type: html.BR}:
can.base.isString(item)? /* 2.按键 */ {type: html.BUTTON, name: item, value: can.user.trans(can, item, meta._trans), onclick: function(event) { can.base.isString(item)? /* 2.按键 */ {type: html.BUTTON, name: item, value: can.user.trans(can, item, meta._trans), onclick: function(event) {
run(event, item) run(event, item)
}, ondlbclick: function(event) {
can.onkeymap.prevent(event)
}}: item.length > 0? /* 3.列表 */ {type: html.SELECT, name: item[0], values: item.slice(1), onchange: function(event) { can.misc.Event(event, can, function(msg) { }}: item.length > 0? /* 3.列表 */ {type: html.SELECT, name: item[0], values: item.slice(1), onchange: function(event) { can.misc.Event(event, can, function(msg) {
var button = event.target.value; meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button] && can.core.CallFunc(meta[button], [event, can, button]) var button = event.target.value; meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button] && can.core.CallFunc(meta[button], [event, can, button])
}) }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) { }) }}: /* 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) run(event, item.name)
}, item._init = item._init||function(target) {
if (can.page.ClassList.has(can, can._target, chat.PANEL)) { return }
if (can.base.isIn(item.name, mdb.CREATE, mdb.INSERT)) { can.onappend.style(can, "icons", target.parentNode)
can.page.Append(can, target.parentNode, [{icon: item.name, onclick: function(event) { can.Update(event, [ctx.ACTION, item.name]) }}])
}
}), item), "", action) }), item), "", action)
}), meta }), meta
}, },
@ -357,8 +360,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", item.name == html.FILTER && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) }) }}) icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", item.name == html.FILTER && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) }) }})
} if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } } } if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } }
var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name])], list: [input].concat(icon), _init: function(target, _input) { var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name])], list: [input].concat(icon), _init: function(target, _input) {
item.style && can.onappend.style(can, item.style, target)
if (item.type == html.SELECT) { _input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item) } if (item.type == html.SELECT) { _input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item) }
item.style && can.onappend.style(can, item.style, target)
}}])[item.name]; return _input }}])[item.name]; return _input
}, },
select: function(can, select, item) { var carte select: function(can, select, item) { var carte
@ -369,6 +372,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
}, _init: function(target) { can.page.style(can, target, html.WIDTH, select.offsetWidth+10), can.onappend.style(can, html.HIDE, select) }}, {icon: mdb.SELECT}]) }, _init: function(target) { can.page.style(can, target, html.WIDTH, select.offsetWidth+10), can.onappend.style(can, html.HIDE, select) }}, {icon: mdb.SELECT}])
}, },
table: function(can, msg, cb, target, keys) { if (!msg || msg.Length() == 0) { return } var meta = can.base.Obj(msg.Option(mdb.META)) table: function(can, msg, cb, target, keys) { if (!msg || msg.Length() == 0) { return } var meta = can.base.Obj(msg.Option(mdb.META))
for (var i = 0; i < msg.append.length-1; i++) { if (msg.append[i] == ctx.ACTION) { msg.append[i] = msg.append[msg.append.length-1], msg.append[msg.append.length-1] = ctx.ACTION } }
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) { var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) {
function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(can.request(event, line, can.Option()), [ctx.ACTION, cmd].concat(arg)) }) } function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(can.request(event, line, can.Option()), [ctx.ACTION, cmd].concat(arg)) }) }
if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (key == mdb.VALUE) { key = line.key } line = {}, can.core.List(array, function(item) { line[item.key] = item.value }) } if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (key == mdb.VALUE) { key = line.key } line = {}, can.core.List(array, function(item) { line[item.key] = item.value }) }

View File

@ -1,9 +1,9 @@
// * { transition:background-color ease-in 5s; } // * { transition:background-color ease-in 5s; }
* { tab-size:4; box-sizing:border-box; padding:0; border:0; margin:0; } * { tab-size:4; box-sizing:border-box; padding:0; border:0; margin:0; }
body { background-color:black; color:cyan; font-size:16px; } body { background-color:black; color:cyan; font-size:16px; }
legend { background-color:cadetblue; color:white; padding:0 20px; margin-right:5px; } legend { background-color:cadetblue; color:white; padding:0 20px; margin-right:10px; }
select { background-color:black; color:cyan; padding:0 10px; margin-right:5px; } select { background-color:black; color:cyan; padding:0 10px; margin-right:10px; }
input:not([type=file]) { background-color:cyan; padding:0 5px; margin-right:5px; } input:not([type=file]) { background-color:cyan; padding:0 10px; margin-right:10px; }
input:not([type=button]) { width:120px; } input:not([type=button]) { width:120px; }
input[name=path] { width:160px; } input[name=path] { width:160px; }
input[name=line] { width:60px; } input[name=line] { width:60px; }
@ -102,12 +102,12 @@ body>div.carte { padding:0; }
body>div.carte input[name=filter] { margin:5px; width:calc(100% - 10px); position:sticky; top:5px; } body>div.carte input[name=filter] { margin:5px; width:calc(100% - 10px); position:sticky; top:5px; }
body>div.carte div.item { white-space:pre; padding:5px 10px; } body>div.carte div.item { white-space:pre; padding:5px 10px; }
body>div.carte div.item span.icon.next { float:right; } body>div.carte div.item span.icon.next { float:right; }
body>div.input td { padding:5px; } body>div.input td { padding:10px; }
body>div.input td span.icon { font-size:14px; margin-left:-25px; margin-right:10px; visibility:hidden; } body>div.input td span.icon { font-size:14px; margin-left:-25px; margin-right:10px; visibility:hidden; }
body>div.input td:hover span.icon { visibility:visible; } body>div.input td:hover span.icon { visibility:visible; }
body>div.input select { width:190px; } body>div.input select { width:230px; }
body>div.input textarea { height:120px; width:200px; } body>div.input textarea { height:120px; width:240px; }
body>div.input input:not([type=button]) { width:200px; } body>div.input input:not([type=button]) { width:240px; }
body>div.input div.action input[type=button] { width:90px; } body>div.input div.action input[type=button] { width:90px; }
body>div.input div.action div { margin:5px; float:right; } body>div.input div.action div { margin:5px; float:right; }
body>div.input div.action { width:100%; } body>div.input div.action { width:100%; }
@ -133,7 +133,7 @@ body.dark span.function { color:lightgreen; }
body.dark span.keyword { color:royalblue; } body.dark span.keyword { color:royalblue; }
/* icon */ /* icon */
div.item.text { position:relative; } div.item.text { position:relative; }
div.item.text>span.icon.delete { font-size:20px; line-height:28px; position:absolute; top:2px; right:10px; visibility:hidden; } div.item.text>span.icon.delete { font-size:20px; line-height:28px; position:absolute; top:2px; right:15px; visibility:hidden; }
div.item.text:hover>span.icon.delete { visibility:visible; } div.item.text:hover>span.icon.delete { visibility:visible; }
fieldset.float div.text:hover>span.icon.delete { visibility:hidden; } fieldset.float div.text:hover>span.icon.delete { visibility:hidden; }
fieldset.float>form.option>div.text>input { display:none; } fieldset.float>form.option>div.text>input { display:none; }
@ -150,6 +150,7 @@ form.option>div.icon.prev { font-size:18px; }
form.option>div.icon.lt { font-size:20px; line-height:30px; } form.option>div.icon.lt { font-size:20px; line-height:30px; }
form.option>div.icon:hover { background-color:white; } form.option>div.icon:hover { background-color:white; }
form.option>div.button>span.icon { line-height:30px; font-size:26px; padding:0 5px; height:32px; } form.option>div.button>span.icon { line-height:30px; font-size:26px; padding:0 5px; height:32px; }
div.action>div.button>span.icon { line-height:30px; font-size:26px; padding:0 5px; height:32px; }
body:not(.mobile) fieldset:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.button>span.icon { display:none; } body:not(.mobile) fieldset:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.button>span.icon { display:none; }
body:not(.mobile) fieldset:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; } body:not(.mobile) fieldset:not(.story):not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; }
fieldset.plug>form.option>div.icon { margin-left:5px; } fieldset.plug>form.option>div.icon { margin-left:5px; }
@ -157,6 +158,10 @@ fieldset.story>form.option>div.button.icons>input { display:none; }
fieldset.float>form.option>div.button.icons>input { display:none; } fieldset.float>form.option>div.button.icons>input { display:none; }
fieldset.full>form.option>div.button.icons>input { display:none; } fieldset.full>form.option>div.button.icons>input { display:none; }
fieldset.cmd>form.option>div.button.icons>input { display:none; } fieldset.cmd>form.option>div.button.icons>input { display:none; }
fieldset.story>div.action>div.button.icons>input { display:none; }
fieldset.float>div.action>div.button.icons>input { display:none; }
fieldset.full>div.action>div.button.icons>input { display:none; }
fieldset.cmd>div.action>div.button.icons>input { display:none; }
body.windows form.option>div.icon { font-size:21px; } body.windows form.option>div.icon { font-size:21px; }
body.windows fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.website.icon { line-height:36px; } body.windows fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.website.icon { line-height:36px; }
/* svg */ /* svg */
@ -220,17 +225,18 @@ fieldset.plug { position:absolute; bottom:0; right:0; } fieldset.cmd fieldset.pl
fieldset.plug div.output table.content { width:100%; } fieldset.plug div.output table.content { width:100%; }
div.layout.flex>* { float:left; clear:none; } div.layout.flex>* { float:left; clear:none; }
div.output { position:relative; } div.output { position:relative; }
fieldset.story { clear:both; }
div.tabs { position:relative; } div.tabs { position:relative; }
div.tabs span.icon { margin-left:10px; visibility:hidden; } div.tabs span.icon { visibility:hidden; }
div.tabs span.icon:hover { background-color:aliceblue; color:black; } div.tabs span.icon:hover { background-color:aliceblue; color:black; }
div.tabs>div:hover span.icon { visibility:visible; } div.tabs>div:hover span.icon { visibility:visible; }
div.action>div.tabs:hover span.icon { visibility:visible; } div.action>div.tabs:hover span.icon { visibility:visible; }
div.tabs>div.select span.icon { visibility:visible; } div.tabs>div.select span.icon { visibility:visible; }
fieldset>div.output>div.code { position:sticky; left:0; } fieldset>div.output>div.code { position:sticky; left:0; bottom:0; }
div.plug { font-style:italic; } div.plug { font-style:italic; }
div.carte.select.float { border-radius:0; } div.carte.select.float { border-radius:0; }
div.carte.select.float>div.item { text-align:center; } div.carte.select.float>div.item { text-align:center; }
div.item.select span { margin-left:-20px; margin-right:10px; } div.item.select span { margin-left:-25px; margin-right:10px; }
div.item.select input { border-radius:0; min-width:60px; } div.item.select input { border-radius:0; min-width:60px; }
div.project div.zone div.list { clear:both; } div.project div.zone div.list { clear:both; }
div.layout.flex>div.output { float:left; clear:none; } div.layout.flex>div.output { float:left; clear:none; }
@ -389,13 +395,15 @@ fieldset.qrcode>div.output div.code { padding:0; }
fieldset.can.view { font-size:14px; } fieldset.can.view { font-size:14px; }
fieldset.can.data { font-size:14px; } fieldset.can.data { font-size:14px; }
body.en fieldset.input.date.float>div.action>div.item.select { margin:0 5px; } body.en fieldset.input.date.float>div.action>div.item.select { margin:0 5px; }
body.en fieldset.input.date.float>div.action>div.item.select select { width:64px; } body.en fieldset.input.date.float>div.action>div.item.select select { width:61px; }
body.en fieldset.input.date.float>div.action>div.item.select.year select { width:114px; } body.en fieldset.input.date.float>div.action>div.item.select.year select { width:106px; }
body.en fieldset.input.date.float>div.action>div.item.select.month select { width:112px; } body.en fieldset.input.date.float>div.action>div.item.select.month select { width:106px; }
body.zh fieldset.input.date.float>div.action>div.item.select { margin:0 5px; } body.zh fieldset.input.date.float>div.action>div.item.select { margin:0 5px; }
body.zh fieldset.input.date.float>div.action>div.item.select select { width:68px; } body.zh fieldset.input.date.float>div.action>div.item.select select { width:65px; }
body.zh fieldset.input.date.float>div.action>div.item.select.year select { width:95px; } body.zh fieldset.input.date.float>div.action>div.item.select.year select { width:89px; }
body.zh fieldset.input.date.float>div.action>div.item.select.month select { width:95px; } body.zh fieldset.input.date.float>div.action>div.item.select.month select { width:89px; }
fieldset.input.date.float>div.action>div.item.button.today { margin-left:5px; }
fieldset.input.date.float>div.action>div.item.button.next { margin-left:5px; }
/* layout */ /* layout */
table.layout { border-spacing:0; } table.layout { border-spacing:0; }
table.layout td { vertical-align:top; } table.layout td { vertical-align:top; }

View File

@ -37,8 +37,8 @@ Volcanos("user", {
jumps: function(url) { location.href = url }, jumps: function(url) { location.href = url },
opens: function(url) { window.openurl? window.openurl(url): (window.open(url) || (location.href = url)) }, opens: function(url) { window.openurl? window.openurl(url): (window.open(url) || (location.href = url)) },
// open: function(url) { window.open(url) }, // open: function(url) { window.open(url) },
open: function(url) { window.open(url) || (location.href = url) }, open: function(url) { return window.open(url) || (location.href = url) },
close: function(url) { window.close() }, close: function(url) { return window.close() || history.back() },
theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || [], can.user.isWindows && name.push("windows") theme: function(can, name) { can.base.isString(name) && (name = [name]) || name || [], can.user.isWindows && name.push("windows")
can.user.isWebview && name.push(html.WEBVIEW), can.user.isMobile && name.push(html.MOBILE) && can.user.isLandscape() && name.push(html.LANDSCAPE) can.user.isWebview && name.push(html.WEBVIEW), can.user.isMobile && name.push(html.MOBILE) && can.user.isLandscape() && name.push(html.LANDSCAPE)
can.user.language(can) && name.push(can.user.language(can)), can.page.styleClass(can, document.body, name.join(lex.SP)) can.user.language(can) && name.push(can.user.language(can)), can.page.styleClass(can, document.body, name.join(lex.SP))
@ -59,6 +59,7 @@ Volcanos("user", {
html.PLUGIN, "插件", html.LABEL, "标签", html.HEIGHT, "高度", html.WIDTH, "宽度", ice.SHOW, "显示", ice.HIDE, "隐藏", chat.PROJECT, "项目", chat.PROFILE, "详情", chat.ACTIONS, "参数", html.PLUGIN, "插件", html.LABEL, "标签", html.HEIGHT, "高度", html.WIDTH, "宽度", ice.SHOW, "显示", ice.HIDE, "隐藏", chat.PROJECT, "项目", chat.PROFILE, "详情", chat.ACTIONS, "参数",
"full", "全屏", "Close", "关闭", "Close Other", "关闭其它", "full", "全屏", "Close", "关闭", "Close Other", "关闭其它",
"confirm", "确定", "confirm", "确定",
code.XTERM, "终端",
"today", "今天", "today", "今天",
)[text]||text )[text]||text
}, },

View File

@ -1,5 +1,5 @@
fieldset.Search { background-color:#061c3ceb; padding:10px; position:fixed; left:230px; top:48px; } fieldset.Search { background-color:#061c3ceb; padding:10px; position:fixed; left:230px; top:48px; }
fieldset.Search>div.action>div.item.filter>input { background-color:#6b7488; margin-right:0; width:320px; } fieldset.Search>div.action>div.item.filter>input { background-color:#6b7488; }
fieldset.Search>div.output table.content { width:100%; } fieldset.Search>div.output table.content { width:100%; }
fieldset.Search>div.output>div.profile { max-width:unset; } fieldset.Search>div.output>div.profile { max-width:unset; }
body.dark fieldset.Search>div.action>div.item.filter>input { background-color:#212121; } body.dark fieldset.Search>div.action>div.item.filter>input { background-color:#212121; }

View File

@ -129,7 +129,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
}) })
} }
function load(msg) { var skip = false; can.db.tabview[key] = msg function load(msg) { var skip = false; can.db.tabview[key] = msg
can.onimport.tabs(can, [{name: decodeURI(can.base.beginWith(file, "http://")? file.split(web.QS)[0]: file.split(mdb.FS)[0].split(isIndex()? nfs.PT: nfs.PS).pop()), text: file, _menu: shy([ var name = file
if (can.base.beginWith(file, web.HTTP)) { name = decodeURI(file.split(web.QS)[0])
var link = can.misc.ParseURL(can, name); if (link.pod) { name = link.pod }
} else {
name = file.split(mdb.FS)[0].split(isIndex()? nfs.PT: nfs.PS).pop()
}
can.onimport.tabs(can, [{name: name, text: file, _menu: shy([
nfs.SAVE, nfs.TRASH, web.REFRESH, nfs.SAVE, nfs.TRASH, web.REFRESH,
], function(event, button, meta) { can.onaction[button](event, can, button) })}], function(event, tabs) { ], function(event, button, meta) { can.onaction[button](event, can, button) })}], function(event, tabs) {
can._tab = msg._tab = tabs._target, show(skip), skip = true can._tab = msg._tab = tabs._target, show(skip), skip = true
@ -297,7 +303,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { var key = can.onexport.
if (item.index == web.CODE_XTERM && item.args.length > 0) { item.style = html.OUTPUT } if (item.index == web.CODE_XTERM && item.args.length > 0) { item.style = html.OUTPUT }
can.onimport.plug(can, item, function(sub) { sub.onimport.size(sub, can.ui.content.offsetHeight, can.ui.content.offsetWidth, true) can.onimport.plug(can, item, function(sub) { sub.onimport.size(sub, can.ui.content.offsetHeight, can.ui.content.offsetWidth, true)
sub.onimport._open = function(_, msg, arg) { sub.onimport._open = function(_, msg, arg) {
var link = can.misc.ParseURL(can, arg); if (link.pod) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return } var link = can.misc.ParseURL(can, arg); if (link.pod && arg.indexOf(location.origin) == 0) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return }
can.onimport.tabview(can, "", arg, web.SPACE), sub.Update() can.onimport.tabview(can, "", arg, web.SPACE), sub.Update()
} }
sub.onaction.close = function() { msg._tab._close() } sub.onaction.close = function() { msg._tab._close() }

View File

@ -48,6 +48,9 @@ Volcanos(chat.ONFIGURE, {
"=", function() { can.onimport.tabview(can, "", sub._index, ctx.INDEX) }, "=", function() { can.onimport.tabview(can, "", sub._index, ctx.INDEX) },
)) ))
}) }, }) },
xterm: function(can, target, zone) { can.onimport._zone(can, zone, web.CODE_XTERM, function(sub, msg) {
sub.onexport.record = function(sub, value, key, item) { can.onimport.tabview(can, "", [web.CODE_XTERM, item.hash, item.name||item.type].join(mdb.FS), ctx.INDEX) }
}) },
space: function(can, target, zone) { can.onimport._zone(can, zone, web.DREAM, function(sub, msg) { space: function(can, target, zone) { can.onimport._zone(can, zone, web.DREAM, function(sub, msg) {
sub.onimport._open = function(_, msg, arg) { sub.onimport._open = function(_, msg, arg) {
var link = can.misc.ParseURL(can, arg); if (link.pod) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return } var link = can.misc.ParseURL(can, arg); if (link.pod) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return }
@ -66,7 +69,7 @@ Volcanos(chat.ONFIGURE, {
} } } }
}) }, }) },
}) })
Volcanos(chat.ONACTION, {list: ["编译", "变更", "源码", "终端", "导图", "计划", "收藏", "首页"], Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "导图", "计划", "收藏", "首页"],
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) { _run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) {
can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button) can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button)
can.ui.zone.source.refresh() can.ui.zone.source.refresh()
@ -105,9 +108,7 @@ Volcanos(chat.ONACTION, {list: ["编译", "变更", "源码", "终端", "导图"
var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0]) var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0])
}) }, }) },
"编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) }, "编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) },
// "变更": function(event, can) { can.onimport.tabview(can, "", [web.CODE_GIT_REPOS, can.core.Split(can.Option(nfs.PATH), nfs.PS).pop(), nfs.MASTER, "index", can.Option(nfs.FILE)].join(mdb.FS), ctx.INDEX) }, "源码": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_STATUS, ctx.INDEX) },
"变更": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_STATUS, ctx.INDEX) },
"源码": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_REPOS, ctx.INDEX) },
"终端": function(event, can) { can.onimport.tabview(can, "", web.CODE_XTERM, ctx.INDEX) }, "终端": function(event, can) { can.onimport.tabview(can, "", web.CODE_XTERM, ctx.INDEX) },
"导图": function(event, can) { can.onimport.tabview(can, "", web.WIKI_DRAW, ctx.INDEX) }, "导图": function(event, can) { can.onimport.tabview(can, "", web.WIKI_DRAW, ctx.INDEX) },
"计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) }, "计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) },

View File

@ -2,6 +2,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireModules
var item = msg.TableDetail(); item.hash = item.hash||can.Option(mdb.HASH), can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg), can.onappend._status(can), can.onkeymap._build(can) var item = msg.TableDetail(); item.hash = item.hash||can.Option(mdb.HASH), can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg), can.onappend._status(can), can.onkeymap._build(can)
if (item.type == html.LAYOUT) { can.onimport._layout(can, item) } else { can.onimport._connect(can, item, can._output) } can.onimport.layout(can) if (item.type == html.LAYOUT) { can.onimport._layout(can, item) } else { can.onimport._connect(can, item, can._output) } can.onimport.layout(can)
can.sup.onexport.link = function() { return can.misc.MergePodCmd(can, {pod: can.Conf(ice.POD), cmd: web.CODE_XTERM, hash: item.hash}) } can.sup.onexport.link = function() { return can.misc.MergePodCmd(can, {pod: can.Conf(ice.POD), cmd: web.CODE_XTERM, hash: item.hash}) }
can.sup.onexport.title(can, item.name||item.type)
}) }, }) },
_layout: function(can, item) { _layout: function(can, item) {
function connect(item, output, tabs) { can.run(can.request({}, item), [item.hash], function(msg) { function connect(item, output, tabs) { can.run(can.request({}, item), [item.hash], function(msg) {
@ -57,7 +58,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireModules
} can._output = term._output, can.runAction(can.request({}, term._item), web.INPUT, [btoa(data)], function() {}) } can._output = term._output, can.runAction(can.request({}, term._item), web.INPUT, [btoa(data)], function() {})
} }
}, },
grow: function(can, msg) { var arg = msg.detail.slice(1), term = can.db[arg[0]]; arg[1] == "~~~end~~~"? can.onaction.delete(can, term._output): term.write(arg[1]) }, grow: function(can, msg) { var arg = msg.detail.slice(1), term = can.db[arg[0]]; arg[1] == "~~~end~~~"? can.onaction.delete(can, term._output): term.write(arg[1]); msg.Option(ice.LOG_DISABLE, ice.TRUE) },
layout: function(can) { function show(target, height, width) { var list = can.page.SelectChild(can, target, can.page.Keys(html.DIV_OUTPUT, html.DIV_LAYOUT)) layout: function(can) { function show(target, height, width) { var list = can.page.SelectChild(can, target, can.page.Keys(html.DIV_OUTPUT, html.DIV_LAYOUT))
var h = height/list.length, w = width; if (can.page.ClassList.has(can, target, html.FLEX)) { h = height, w = width/list.length } if (target == can._fields) { h = height, w = width } var h = height/list.length, w = width; if (can.page.ClassList.has(can, target, html.FLEX)) { h = height, w = width/list.length } if (target == can._fields) { h = height, w = width }
can.core.List(list, function(target) { can.page.style(can, target, html.HEIGHT, h, html.WIDTH, w), can.page.ClassList.has(can, target, html.LAYOUT)? show(target, h, w): target._term && target._term._fit.fit() }) can.core.List(list, function(target) { can.page.style(can, target, html.HEIGHT, h, html.WIDTH, w), can.page.ClassList.has(can, target, html.LAYOUT)? show(target, h, w): target._term && target._term._fit.fit() })

View File

@ -50,6 +50,7 @@ Volcanos(chat.ONIMPORT, {
}).length == 0) { can.onappend.board(can, arg) } }).length == 0) { can.onappend.board(can, arg) }
}, },
_open: function(can, msg, arg) { return can.Update(), can.user.open(arg) }, _open: function(can, msg, arg) { return can.Update(), can.user.open(arg) },
_close: function(can, msg) { return can.user.close() || history.back() },
size: function(can, height, width, auto, mode) { height -= can.onexport.actionHeight(can)+can.onexport.statusHeight(can) size: function(can, height, width, auto, mode) { height -= can.onexport.actionHeight(can)+can.onexport.statusHeight(can)
auto? can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height? can.ConfHeight(height): "", html.MAX_WIDTH, can.ConfWidth(width)): auto? can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height? can.ConfHeight(height): "", html.MAX_WIDTH, can.ConfWidth(width)):
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "") can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "")

View File

@ -8,7 +8,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
can.page.Select(can, can.page.Create(can, html.DIV, value.action), html.INPUT, function(target) { can.page.Select(can, can.page.Create(can, html.DIV, value.action), html.INPUT, function(target) {
action.push(target.name), target.name != target.value && can.user.trans(can, kit.Dict(target.name, target.value)) action.push(target.name), target.name != target.value && can.user.trans(can, kit.Dict(target.name, target.value))
}) })
can.onimport.item(can, {name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]), title: value[mdb.TEXT]}, function(event) { can.onimport.item(can, {name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]}, function(event) {
can.sup.onexport.record(can, value.name, mdb.NAME, value, event) can.sup.onexport.record(can, value.name, mdb.NAME, value, event)
}, function() { return shy(action, function(event, button, meta, carte) { can.misc.Event(event, can, function(msg) { }, function() { return shy(action, function(event, button, meta, carte) { can.misc.Event(event, can, function(msg) {
can.sup.onexport.action(can, button, value) || can.run(event, [ctx.ACTION, button], function(msg) { can.sup.onimport._process(can.sup, msg) || can.Update() }), carte.close() can.sup.onexport.action(can, button, value) || can.run(event, [ctx.ACTION, button], function(msg) { can.sup.onimport._process(can.sup, msg) || can.Update() }), carte.close()

View File

@ -78,6 +78,7 @@ var mdb = {
} }
var web = {CHAT: "chat", var web = {CHAT: "chat",
SHARE: "share", SPACE: "space", DREAM: "dream", SHARE: "share", SPACE: "space", DREAM: "dream",
SPIDE: "spide",
WEBSITE: "website", DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", INPUT: "input", WEBSITE: "website", DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", INPUT: "input",
CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage",
SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",