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

opt portal

This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-07-05 00:45:29 +08:00
parent b66da3f811
commit 0bf2b069c6
10 changed files with 70 additions and 73 deletions

View File

@ -254,8 +254,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
action === false || can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
action === false || sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
// can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, ""), can.onappend.style(sub, sub.Conf(ctx.STYLE))
can.page.style(can, can._output, html.HEIGHT, ""), can.onappend.style(sub, sub.Conf(ctx.STYLE))
can.onappend.style(sub, sub.Conf(ctx.STYLE))
can.onappend.style(sub, sub.Conf(ctx.STYLE))
if (can.isFullMode() || can.isCmdMode()) { can.onimport.size(can, can.page.height(), can.page.width(), true) }
can.onmotion.story.auto(can, can._output), can.onexport.output(can, msg), can.base.isFunc(cb) && cb(msg)
}, target: output})

View File

@ -322,7 +322,7 @@ fieldset.xterm div.layout div.output { border-left:gray solid 1px; border-top:gr
fieldset.xterm div.layout div.output.select { border:blue 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; }
fieldset.draw div.output svg { margin-bottom:-4px; height:100%; width:100%; }
fieldset.draw.trend div.output svg { background-color:#1b5b738c; }
fieldset.draw.spide div.output svg text { cursor:pointer; }
fieldset.draw.spide div.output svg path { stroke-width:1; }

View File

@ -57,14 +57,15 @@ Volcanos(chat.ONACTION, {_init: function(can) {
},
onsize: function(can) { can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth) },
onmain: function(can) {
if (can.base.beginWith(location.pathname, "/wiki/portal/", "/chat/cmd/web.wiki.portal/")) { return can.onengine.signal(can, chat.ONLOGIN) }
can.run({}, [], function(msg) { if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
return msg.Option(chat.SSO)? can.user.jumps(msg.Option(chat.SSO)): can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg.Option(aaa.LOGIN))
} can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.userrole = msg.Option(ice.MSG_USERROLE), can.user.info.avatar = msg.Option(aaa.AVATAR), can.user.info.background = msg.Option(aaa.BACKGROUND)
function show(msg) {
can.user.info.usernick = can.Conf(aaa.USERNICK), can.user.info.userrole = msg.Option(ice.MSG_USERROLE), can.user.info.avatar = msg.Option(aaa.AVATAR), can.user.info.background = msg.Option(aaa.BACKGROUND)
can.user.info.language = msg.SearchOrOption(aaa.LANGUAGE)||navigator.language.split("-")[0], msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
can.onmotion.clear(can), can.onimport._init(can, msg, can._output), can.onengine.signal(can, chat.ONLOGIN, msg)
})
can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN)
}
can.base.beginWith(location.pathname, "/wiki/portal/", "/chat/cmd/web.wiki.portal/")? show(can.request()):
can.run({}, [], function(msg) { if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
return msg.Option(chat.SSO)? can.user.jumps(msg.Option(chat.SSO)): can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg.Option(aaa.LOGIN))
} show(msg) })
},
onstorm_select: function(can, river, storm) { can.Conf(chat.RIVER, river), can.Conf(chat.STORM, storm) },
onaction_cmd: function(can) { can.onappend.style(can, html.HIDE) },

View File

@ -1,6 +1,6 @@
fieldset.inner>form.option input[name=path] { width:80px; }
fieldset.inner>form.option input[name=file] { width:160px; }
fieldset.inner>div.output { overflow:hidden; }
fieldset.inner:not(.output)>div.output { overflow:hidden; }
fieldset.inner>div.output div.content { position:relative; }
fieldset.inner>div.output div.content td.text { height:20px; }
fieldset.inner>div.output div.content td.text span.comment { color:var(--code-comment); }

View File

@ -165,7 +165,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
if (can.base.isFunc(cb)) { return {name: name, _trans: can.onfigure._trans? can.onfigure._trans[name]||"": "", _init: function(target, zone) { return cb(can, target, zone, path) }} }
}), can.ui.project) },
profile: function(can, msg) { var _msg = can.db.tabview[can.onexport.keys(can)]; _msg.Option(html.WIDTH, msg.Option(html.WIDTH)), border = 1
var height = (can.ui.content._root||can.ui.content).offsetHeight, width = can.onexport.size(can, _msg.Option(html.WIDTH)||0.5, can.ConfWidth()-can.ui.project.offsetWidth)+border
var height = (can.ui.content._root||can.ui.content).offsetHeight, width = can.onexport.size(can, _msg.Option(html.WIDTH)||0.5, can.ConfWidth()-can.ui.project.offsetWidth)+border
if (msg.Result().indexOf("<iframe src=") > -1) { if (_msg._profile != can.ui._profile) { can.page.Remove(can, _msg._profile) }
var src = can.page.Select(can, can.page.Create(can, html.DIV, msg.Result()), html.IFRAME, function(target) { return target.src })[0]
can.ui.profile = _msg._profile = can.page.Append(can, can.ui._profile.parentNode, [{view: [html.PROFILE, html.IFRAME], src: src, style: {height: height, width: width}}])._target
@ -190,6 +190,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
process: function(can, msg, target, height, width, cb) { can.onmotion.clear(can, target)
if (msg.Option(ice.MSG_PROCESS) == ice.PROCESS_FIELD) {
msg.Table(function(item) { item.type = chat.STORY, item.height = height, item.width = width, item.display = msg.Option(ice.MSG_DISPLAY)
if (can.base.isIn(item.index, web.WIKI_WORD)) { item.style = html.OUTPUT }
can.onimport.plug(can, item, function(sub) {
sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
sub.onexport.output = function(_sub, _msg) { can.onmotion.delay(can, function() { can.base.isFunc(cb) && cb(_sub, _msg) }) }

View File

@ -256,6 +256,7 @@ Volcanos(chat.ONSYNTAX, {
"ul": code.KEYWORD, "li": code.KEYWORD,
"label": code.KEYWORD, "span": code.KEYWORD, "img": code.KEYWORD, "svg": code.KEYWORD, "div": code.KEYWORD,
"video": code.KEYWORD,
"iframe": code.KEYWORD,
"hover": code.DATATYPE, "focus": code.DATATYPE, "not": code.DATATYPE, "type": code.FUNCTION, "name": code.FUNCTION,
"padding": code.FUNCTION, "padding-left": code.FUNCTION, "padding-top": code.FUNCTION,

View File

@ -67,7 +67,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
var target = can.onimport.block(can, figure.data.name||value.shape, data, group); can.core.ItemCB(value, function(key, cb) { target[key] = cb })
return value._init && value._init(target), target
},
layout: function(can) { can.onmotion.toggle(can, can._action, can.ConfWidth() > 1600)
layout: function(can, height, width) { can.onmotion.toggle(can, can._action, can.ConfWidth() > 1600)
can.page.style(can, can._output, html.HEIGHT, height, html.WIDTH, width)
can.ui.layout && can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) { can.page.style(can, can.svg, html.MIN_HEIGHT, height, html.MIN_WIDTH, width) })
},
})
@ -152,7 +153,7 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
})
Volcanos(chat.ONDETAIL, {list: [cli.START, ice.COPY, html.LABEL, "toimage", mdb.REMOVE],
_select(can, name, cb) { if (!name) { return } var target = can.page.SelectOne(can, can.svg, nfs.PT+name, cb)
can.onimport._profile(can, target), can.onimport._display(can, target), can.onimport.layout(can)
can.onimport._profile(can, target), can.onimport._display(can, target), can.onimport.layout(can, can.ConfHeight(), can.ConfWidth())
return target
},
start: function(event, can) { var target = event.target

View File

@ -1,17 +1,33 @@
fieldset.word.plugin>form.option>div.item>input[name=path] { width:320px; }
fieldset.word>form.option>div.item>input[name=path] { width:320px; }
body.mobile fieldset.word>form.option>div.item>input[name=path] { width:180px; }
body.webview fieldset.word>form.option>div.item>input[name=path] { width:160px; }
fieldset.word>div.output { padding:10px; }
fieldset.word>div.output>p { margin:20px auto; }
fieldset.word>div.output div.story.flex { display:flex; justify-content:center; }
fieldset.word>div.output div.story.flex>* { padding:20px; }
fieldset.word>div.output h2.story[data-type=spark][data-name=title] { text-align:center; }
fieldset.word>div.output h2 { margin-top:40px; }
fieldset.word>div.output h3 { margin-top:20px; }
fieldset.word>div.output table { width:100%; text-align:center; }
fieldset.word>div.output img { max-height:100%; max-width:100%; }
fieldset.word>div.output video { max-height:100%; width:100%; }
fieldset.word>div.output iframe { height:480px; width:100%; }
fieldset.word>div.output svg.story[data-index] text { cursor:pointer; }
fieldset.word>div.output input.story[type=button] { font-family:system-ui; font-weight:bold; padding:20px 40px; margin:10px; height:64px; }
fieldset.word>div.output fieldset.web.code.inner.output div.output { border-left:blue solid 5px; }
fieldset.word>div.navmenu { background-color:inherit; overflow:auto; min-width:120px; clear:both; float:left; }
fieldset.word>div.navmenu div.list { margin-left:20px; }
fieldset.word>div.navmenu div.item { font-size:1.4em; font-weight:bold; font-family:cursive; padding:4px 20px; }
fieldset.word>div.navmenu>div.item { font-size:1.6em; }
fieldset.word>div.output { padding:10px; }
fieldset.word>div.output>p.story { margin:10px; }
// fieldset.word>div.output>fieldset.story:not(:hover)>form.option { display:none; }
// fieldset.word>div.output>fieldset.story:not(:hover)>div.action { display:none; }
fieldset.word a { word-break:break-all; }
fieldset.word img { word-break:break-all; }
fieldset.word svg.story[data-index] text { cursor:pointer; }
div.story[data-type=spark] label { user-select:none; }
div.story[data-type=spark_tabs] { margin-top:20px; }
div.story[data-type=spark_tabs]>div.tabs>div.item { font-style:italic; padding:5px 20px; height:32px; float:left; }
div.story[data-type=spark_tabs]>div.tabs>div.item.select { border-bottom:blue solid 2px; }
div.story[data-type=spark_tabs]>div.story:not(.select) { display:none; }
fieldset.word.play.float { top:0; }
fieldset.word.play.float>div.action { display:contents; }
fieldset.word.play.float>div.status { clear:none; }
@ -24,9 +40,3 @@ fieldset.word.play.float div.content.grid div.page { background-color:#a4cbecb5;
fieldset.word.play.float h1 { text-align:center; }
fieldset.word.play.float h2 { text-align:center; }
fieldset.word.play.float h3 { text-align:center; }
div.story[data-type=spark] label { user-select:none; }
div.story[data-type=spark_tabs] { margin-top:20px; }
div.story[data-type=spark_tabs]>div.tabs>div.item { font-style:italic; padding:5px 20px; height:32px; float:left; }
div.story[data-type=spark_tabs]>div.tabs>div.item.select { border-bottom:blue solid 2px; }
div.story[data-type=spark_tabs]>div.story:not(.select) { display:none; }
fieldset.word>div.output>fieldset.web.code.inner.output div.output { border-left:blue solid 5px; }

View File

@ -1,31 +1,34 @@
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can), can.Conf(html.PADDING, 10)
can.page.Modify(can, target, msg.Result())
can.page.Select(can, target, wiki.STORY_ITEM, function(target) { var meta = target.dataset||{}
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDING, 10)
can.onmotion.clear(can), can.page.Modify(can, target, msg.Result()), can.onimport._display(can, target)
},
_display: function(can, target, cb) { can.onappend.style(can, "word")
can.page.Select(can, target, wiki.STORY_ITEM, function(target) { var meta = target.dataset||{}; cb && cb(target, meta)
can.core.CallFunc([can.onimport, can.onimport[meta.name]? meta.name: meta.type||target.tagName.toLowerCase()], [can, meta, target])
var _meta = can.base.Obj(meta.meta); _meta && _meta.style && can.page.style(can, target, can.base.Obj(_meta.style))
meta.style && can.page.style(can, target, can.base.Obj(meta.style))
}), can.onmotion.delay(can, function() { can.onimport.layout(can) }, 300)
can.page.Select(can, target, "a", function(target) { target.innerText = target.innerText || target.href })
})
can.page.Select(can, target, "a", function(target) {
target.innerText = target.innerText || target.href, target.href = target.href || target.innerText, target.target = target || "_blank"
})
},
navmenu: function(can, meta, target) { var nav = can.sup._navmenu
nav = can.onmotion.clear(can, nav||can.page.insertBefore(can, [wiki.NAVMENU], can._output)), can.sup._navmenu = nav
can.onimport.list(can, can.base.Obj(meta.data), function(event, item) {
var link = item.meta.link; if (!link || link == can.Option(nfs.PATH)) { return false }
if (can.base.beginWith(link, web.HTTP)) { return can.user.open(link) }
if (can.base.beginWith(link, web.HTTP, nfs.PS)) { return can.user.opens(link) }
if (can.onmotion.cache(can, function() { can.isCmdMode() && can.user.title(item.meta.name); return can.Option(nfs.PATH, link) })) { return }
return can.sup.Update(event, [link])
}, nav)
},
premenu: function(can, meta, target) { can.page.Select(can, can._output, can.page.Keys(wiki.H2, wiki.H3), function(_target) {
can.page.Append(can, target, [{text: [_target.innerHTML, html.DIV, html.ITEM], onclick: function() {
_target.scrollIntoView()
}}]), _target.onclick = function(event) { target.scrollIntoView() }
can.onimport.item(can, {name: _target.innerHTML}, function() { _target.scrollIntoView() }, function() {}, target), _target.onclick = function(event) { target.scrollIntoView() }
}) },
endmenu: function(can, meta, target) { can.page.Select(can, can._output, can.page.Keys(wiki.H2, wiki.H3), function(_target) {
can.page.Append(can, target, [{text: [_target.innerHTML, html.DIV, html.ITEM], onclick: function() {
_target.scrollIntoView()
}}])
can.onimport.item(can, {name: _target.innerHTML}, function() { _target.scrollIntoView() }, function() {}, target)
}) },
title: function(can, meta, target) { can.isCmdMode() && target.tagName == "H1" && can.user.title(meta.text) },
title: function(can, meta, target) {
can.isCmdMode() && target.tagName == "H1" && can.user.title(meta.text)
},
spark: function(can, meta, target) {
if (meta[mdb.NAME] == html.INNER) { return can.onmotion.copy(can, target) }
can.page.Select(can, target, html.SPAN, function(item) { can.onmotion.copy(can, item, function() {
@ -39,18 +42,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
return tabs
}); select && select.click()
},
field: function(can, meta, target, width) { var item = can.base.Obj(meta.meta); item.inputs = item.list, item.feature = item.meta
can.onappend._init(can, item, [chat.PLUGIN_STATE_JS], function(sub) {
sub.run = function(event, cmds, cb, silent) { var msg = sub.request(event)
if (msg.Option(nfs.PATH) == can.Option(nfs.PATH)) { msg.Option(nfs.PATH, "") }
can.runAction(event, chat.STORY, [meta.type, meta.name, meta.text].concat(cmds), cb, true)
}, can._plugins = (can._plugins||[]).concat([sub])
sub.ConfHeight(sub.Conf("_height", parseInt(item.height))||can.base.Min(300, can.ConfHeight()-300)), sub.ConfWidth(item.width = (width||can.ConfWidth())-(can.user.isWindows? 42: 22))
can.page.style(can, sub._output, html.MAX_WIDTH, sub.ConfWidth())
can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() {
sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd"))
})
field: function(can, meta, target) { var item = can.base.Obj(meta.meta), width = item.width
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width", width)||(can.ConfWidth()-2*can.Conf(html.PADDING)), true)
can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) })
}, can._output, target)
},
table: function(can, meta, target) {
@ -58,7 +53,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
can.page.Select(can, target, html.TD, function(item) { can.onmotion.copy(can, item) })
},
chart: function(can, meta, target) {
can.page.style(can, target, html.MAX_WIDTH, can.ConfWidth()-2*can.Conf(html.PADDING), html.OVERFLOW, ice.AUTO)
if (!meta.fg && !meta.bg) { target.className.baseVal = "story auto" }
target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
meta.index && can.onappend._float(can, meta.index, can.base.Obj(meta.args, []).concat([event.target.innerHTML]))
@ -69,29 +63,16 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
})); can.page.style(can, ui._target, {left: event.clientX, top: event.clientY})
}) }
},
image: function(can, meta, target) {
can.page.style(can, target, html.MAX_HEIGHT, can.base.Min(can.ConfHeight()-2*can.Conf(html.PADDING), window.innerHeight/2), html.MAX_WIDTH, can.ConfWidth()-2*can.Conf(html.PADDING))
},
video: function(can, meta, target) {
can.page.style(can, target, html.MAX_HEIGHT, can.base.Min(can.ConfHeight()-2*can.Conf(html.PADDING), window.innerHeight/2), html.MAX_WIDTH, can.ConfWidth()-2*can.Conf(html.PADDING))
},
audio: function(can, meta, target) {},
layout: function(can) { var height = can.ConfHeight(), width = can.ConfWidth(), padding = can.Conf(html.PADDING)
can.isCmdMode() && can.ConfHeight(can.page.height())
layout: function(can, height, width) { can.onmotion.delay(can, function() { padding = can.Conf(html.PADDING)
if (can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
if (can.sup._navmenu) { can.page.style(can, can.sup._navmenu, html.HEIGHT, can.ConfHeight())
can.page.style(can, can._output, html.HEIGHT, height, html.WIDTH, width = can.ConfWidth()-can.sup._navmenu.offsetWidth, "clear", "none", "float", "left")
} else {
can.isCmdMode() && can.ConfHeight(can.page.height()) && can.page.styleHeight(can, can._output, "")
can.isCmdMode() && can.page.styleHeight(can, can._output, "")
}
can.core.List(can._plugins, function(sub) {
sub.ConfHeight(sub.Conf("_height")||can.base.Min(300, height-300)), sub.ConfWidth(width-(can.user.isWindows? 4*padding: 2*padding))
sub.onimport.size(sub, can.base.Min(300, height-300), width-(can.user.isWindows? 4*padding: 2*padding), true)
})
can.page.Select(can, can._output, can.page.Keys(html.IMG, html.VIDEO), function(target) {
can.page.style(can, target, html.MAX_HEIGHT, height-2*padding, html.MAX_WIDTH, width-2*padding)
})
},
can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.base.Min(can.ConfHeight()/2, 300, 600), sub.Conf("_width")||(can.ConfWidth()-2*padding), true) })
}, 100) },
}, [""])
Volcanos(chat.ONACTION, {_trans: {view: "视图"},
onkeydown: function(event, can) { can.keylist = can.onkeymap._parse(event, can, "normal", can.keylist) },

View File

@ -148,7 +148,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
list: function(can, root, cb, target, cbs) { target = target||can._output
can.core.List(root.list, function(item) { var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.meta.name], onclick: function(event) {
can.base.isFunc(cb) && cb(event, item) || can.onmotion.toggle(can, ui.list), can.onmotion.select(can, target, html.DIV_ITEM, event.target)
}, _init: function(target) { cbs && cbs(target, item) }}, {view: html.LIST}]); can.onimport.list(can, item, cb, ui.list, cbs) })
}, _init: function(target) {
if (item.meta.name == "_") { target.innerHTML = "", can.onappend.style(can, html.SPACE, target) }
cbs && cbs(target, item)
}}, {view: html.LIST}]); can.onimport.list(can, item, cb, ui.list, cbs) })
},
})
Volcanos(chat.ONLAYOUT, {