1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-06-03 10:17:02 +08:00
parent 5a501e9831
commit 3de3c9afa6
3 changed files with 23 additions and 13 deletions

View File

@ -416,19 +416,19 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
},
board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return }
var code = can.page.Append(can, target||can._output, [{text: [can.page.Color(text), html.DIV, html.CODE]}]).code
can.page.SelectChild(can, code, "iframe", function(target) {
if (text.indexOf("<fieldset") == 0) { can.page.Select(can, code, html.FIELDSET, function(target) { var data = target.dataset
data.index && can.onappend.plugin(can, {index: data.index}, function(sub) {
can.page.Modify(can, sub._legend, data.index.split(nfs.PT).pop())
}, can._output, target)
}) } else if (text.indexOf("<iframe") == 0) { can.page.Select(can, code, html.IFRAME, function(target) { var data = target.dataset
can.page.style(can, target, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
})
if (text.indexOf("<fieldset") > 0) {
can.page.Select(can, target, html.FIELDSET, function(target) { var data = target.dataset
data.index && can.onappend.plugin(can, {index: data.index}, function(sub) {
can.page.Modify(can, sub._legend, data.index.split(nfs.PT).pop())
}, can._output, target)
})
}
can.page.Select(can, code, html.INPUT_BUTTON, function(target) { target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
can.run(can.request(event, can.Option()), [ctx.ACTION, target.name])
}) } }); return code.scrollBy && code.scrollBy(0, 10000), code
}) } else if (text.indexOf("<svg") > 0) { can.page.Select(can, code, html.SVG, function(target) {
can.page.style(can, target, {height: can.ConfHeight(), width: can.ConfWidth()})
}) } else { can.page.Select(can, code, html.INPUT_BUTTON, function(target) {
target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
can.run(can.request(event, can.Option()), [ctx.ACTION, target.name])
}) }
}) } return code.scrollBy && code.scrollBy(0, 10000), code
},
tools: function(can, msg, cb, target) { can.onimport.tool(can, can.base.Obj(msg.Option(ice.MSG_TOOLKIT), []), cb, target) },
layout: function(can, list, type, target) { const FLOW = html.FLOW, FLEX = html.FLEX

View File

@ -52,7 +52,13 @@ Volcanos(chat.ONACTION, {_init: function(can) { can.onmotion.hidden(can) }, list
if (data.type == ssh.SHELL) { meta = {index: web.CODE_XTERM, args: [data.text]} }
if (data.type == ctx.INDEX) { meta = {index: data.text.split(mdb.FS)[0], args: data.text.split(mdb.FS).slice(1) } }
if (data.type == nfs.FILE) { meta = {index: web.CODE_VIMER, args: can.misc.SplitPath(can, data.text)} }
if (data.type == nfs.SHY) { meta = {index: web.WIKI_WORD, args: data.name} }
if (data.type == nfs.SHY) { meta = {index: web.WIKI_WORD, args: data.text} }
if (data.ctx == ice.NFS && data.cmd == nfs.PACK) { var ls = can.misc.SplitPath(can, data.text)
can.runAction(event, cli.RUN, [web.CODE_VIMER, ctx.ACTION, mdb.RENDER, data.type, ls[1], ls[0]], function(msg) { msg.Table(function(meta) {
can.onappend.plugin(can, meta, function(sub) { can._plugins = (can._plugins||[]).concat(sub), sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth()-1, true), sub.Focus() }, can.ui.profile)
}), can.onappend.board(can, msg.Result(), can.ui.profile) })
return
}
can.onappend.plugin(can, meta, function(sub) { can._plugins = (can._plugins||[]).concat(sub), sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth()-1, true), sub.Focus() }, can.ui.profile)
},
})

View File

@ -51,6 +51,8 @@ var ice = {
LIB_MISC: "lib/misc.js",
LIB_PAGE: "lib/page.js",
REQUIRE: "require",
NFS: "nfs",
}
var ctx = {
@ -128,6 +130,7 @@ var nfs = {
_CSS: ".css", _JS: ".js",
DF: ice.DF, PS: ice.PS, PT: ice.PT,
PWD: "./", SRC: "src/", USR: "usr/",
PACK: "pack",
IMAGE_PNG: "image/png",
IMAGE_JPEG: "image/jpeg",
@ -138,6 +141,7 @@ var cli = {
COLOR: "color", BLACK: "black", WHITE: "white", BLUE: "blue", RED: "red", GRAY: "gray", CYAN: "cyan", GREEN: "green", PURPLE: "purple", YELLOW: "yellow",
MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear",
RUN: "run",
PLAY: "play",
OPENS: "opens",
LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows",