1
0
forked from x/volcanos
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-07-16 14:04:35 +08:00
parent bd44981a94
commit 85fcfa4f1d
5 changed files with 17 additions and 11 deletions

View File

@ -702,7 +702,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
},
move: function(can, target, layout) { layout && can.page.style(can, target, layout), can.onmotion.resize(can, target, function() {}) },
resize: function(can, target, cb, top) { var begin, action
target.onmousedown = function(event) { if (event.which != 1 || event.target != target && !can.page.ClassList.has(can, event.target, html.STATUS)) { return } window._mousemove = target
target.onmousedown = function(event) { if (event.which != 1 || event.target != target && !(can.page.ClassList.has(can, event.target, html.STATUS) && can.page.tagis(event.target, html.DIV))) { return } window._mousemove = target
begin = {left: target.offsetLeft, top: target.offsetTop, height: target.offsetHeight, width: target.offsetWidth, x: event.x, y: event.y}
}, target.onmouseup = function(event) { begin = null, delete(window._mousemove) }
target.onmousemove = function(event) {
@ -721,7 +721,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
} else { var p = can.page.position(event, target), margin = 20, cursor = ""
if (p.x < margin) { cursor = "ew-resize", action = html.LEFT
} else if (target.offsetWidth-margin < p.x) { cursor = "ew-resize", action = html.RIGHT
} else if (target.offsetHeight-margin < p.y || can.page.ClassList.has(can, event.target, html.STATUS)) { cursor = "ns-resize", action = html.BOTTOM
} else if (target.offsetHeight-margin < p.y || can.page.ClassList.has(can, event.target, html.STATUS) && can.page.tagis(event.target, html.DIV)) { cursor = "ns-resize", action = html.BOTTOM
} else if (p.y < margin) { cursor = "ns-resize", action = html.TOP
} else { cursor = "", action = "" } can.page.style(can, target, "cursor", cursor)
}

View File

@ -321,7 +321,7 @@ fieldset.qrcode>div.output div.code { padding:0; }
fieldset.xterm>div.action>div.tabs:only-child { display:none; }
fieldset.xterm>div.layout { clear:both; }
fieldset.xterm div.layout div.output { border-left:var(--plugin-border-color) solid 1px; border-top:var(--plugin-border-color) solid 1px; }
fieldset.xterm div.layout div.output.select { border:var(--code-border-border) solid 1px; }
fieldset.xterm div.layout div.output.select { border:var(--code-border-color) solid 1px; }
fieldset.plan div.output div.content>table.content { height:100%; width:100%; }
fieldset.draw>form.option>div.item.pid>input { width:60px; }
fieldset.draw div.output svg { margin-bottom:-4px; height:100%; width:100%; }
@ -332,6 +332,7 @@ fieldset.web.code.git.status>div.output table.content { width:100%; }
fieldset.can.view { font-size:14px; }
fieldset.can.data { font-size:14px; }
img, iframe { margin-bottom:-3px; }
iframe { height:420px; width:100%; }
/* scrollbar */
div.scrollbar { background-color:#0000ff66; width:10px; position:absolute; right:0; top:0; transition:width .3s 1s; visibility:hidden; }
div.scrollbar:hover { width:50px; transition:width .1s;}

View File

@ -41,6 +41,9 @@ Volcanos(chat.ONFIGURE, {
}, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action)
can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) }) }), target)
},
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) }
}) },
favor: function(can, target, zone) { can.onimport._zone(can, zone, web.CHAT_FAVOR, function(sub, msg) {
sub.onexport.record = function(sub, value, key, item, event) { switch (item.type) {
case nfs.FILE: var ls = can.onexport.split(can, item.text); can.onimport.tabview(can, ls[0], ls[1]); break
@ -50,9 +53,6 @@ Volcanos(chat.ONFIGURE, {
case cli.OPENS: can.runAction(event, cli.OPENS, [item.text]); break
} }
}) },
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) {
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 }
@ -106,8 +106,8 @@ Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "计划"
"文档": function(event, can) { can.onimport.tabview(can, "", web.WIKI_WORD, ctx.INDEX) },
"计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) },
"桌面": function(event, can) { can.onimport.tabview(can, "", "web.chat.macos.desktop", ctx.INDEX) },
"后台": function(event, can) { can.onimport.tabview(can, "", location.origin+"/chat/portal/", web.SPACE) },
"官网": function(event, can) { can.onimport.tabview(can, "", location.origin+"/wiki/portal/", web.SPACE) },
"后台": function(event, can) { var pod = can.misc.Search(can, ice.POD); can.onimport.tabview(can, "", location.origin+"/chat/portal/"+(pod? "?pod="+pod: ""), web.SPACE) },
"官网": function(event, can) { can.onimport.tabview(can, "", can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL}), web.SPACE) },
insertLine: function(can, value, before) { var line = can.onaction.appendLine(can, value); before && can.ui.content.insertBefore(line, can.onaction._getLine(can, before)); return can.onaction.rerankLine(can), can.onexport.line(can, line) },
deleteLine: function(can, line) { line = can.onaction._getLine(can, line); var next = line.nextSibling||line.previousSibling; return can.page.Remove(can, line), can.onaction.rerankLine(can), next },
_selectLine: function(can) { can.current && can.page.Select(can, can.current.line, "td.text", function(td) { var target = can.ui.current; target.value = td.innerText

View File

@ -11,7 +11,7 @@ Volcanos(chat.ONIMPORT, {
_display: function(can, msg) { can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)) },
_clear: function(can, msg) { can.onmotion.clear(can) },
_inner: function(can, msg) { can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can) },
_field: function(can, msg, cb) { var height = can.ConfHeight(), width = can.ConfWidth(); can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
_field: function(can, msg, cb) { var height = can.ConfHeight(), width = can.ConfWidth(); can.page.SelectChild(can, can._output, can.page.Keys(html.TABLE, html.DIV_CODE), function(target) { height -= target.offsetHeight })
height = can.base.Min(msg.Option(html.HEIGHT)||height, can.isCmdMode()? can.ConfHeight()/2: 320), width = msg.Option(html.WIDTH)||can.ConfWidth()
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub, meta) {
sub.Conf(can.base.Obj(item.conf)); if (sub.isSimpleMode()) { sub.ConfHeight(can.ConfHeight()/2)
@ -19,7 +19,7 @@ Volcanos(chat.ONIMPORT, {
}
sub.run = function(event, cmds, cb) { sub.onimport.size(sub, height, width, true)
sub.onexport.output = function() { sub.onimport.size(sub, height, width, true)
can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, height, html.DISPLAY, html.BLOCK) })
// can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, height, html.DISPLAY, html.BLOCK) })
}, can.run(event, (!msg.Option("_index") || msg.Option("_index") == can._index || can._index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
}
sub._target.onclick = function() {

View File

@ -97,6 +97,7 @@ var web = {CHAT: "chat",
CHAT_IFRAME: "web.chat.iframe", CHAT_FAVOR: "web.chat.favor",
TEAM_PLAN: "web.team.plan",
WIKI_PORTAL: "web.wiki.portal",
CHAT_PORTAL: "web.chat.portal",
}
var aaa = {
LOGIN: "login", LOGOUT: "logout", INVITE: "invite", TOKEN: "token",
@ -393,7 +394,11 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
})
try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta
meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth
try {
meta.version = window._version, window.parent.outerWidth-window.parent.innerWidth > 100 && (meta.version = "")
} catch (e) {
meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "")
}
meta._load = function(url, cb) {
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break