mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
66ece69382
commit
bcd73814cb
5
const.js
5
const.js
@ -82,8 +82,9 @@ var mdb = {FOREACH: "*", RANDOMS: "%",
|
||||
EQ: ice.EQ, FS: ice.FS,
|
||||
}
|
||||
var web = {
|
||||
SERVE: "serve", SPACE: "space", ROUTE: "route", DREAM: "dream", STORE: "store",
|
||||
SHARE: "share", TOKEN: "token", SPIDE: "spide", ADMIN: "admin", STATS: "stats", COUNT: "count",
|
||||
SERVE: "serve", SPACE: "space", DREAM: "dream", ROUTE: "route",
|
||||
SHARE: "share", TOKEN: "token", STATS: "stats", COUNT: "count",
|
||||
SPIDE: "spide", STORE: "store", ADMIN: "admin", MATRIX: "matrix",
|
||||
|
||||
WORKER: "worker", SERVER: "server", MASTER: "master", GATEWAY: "gateway",
|
||||
ORIGIN: "origin", VENDOR: "vendor", ONLINE: "online", OFFLINE: "offline",
|
||||
|
1
frame.js
1
frame.js
@ -941,6 +941,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
||||
can.page.style(can, _target, "z-index", _target == target? 9: 8)
|
||||
})
|
||||
}
|
||||
target.click()
|
||||
},
|
||||
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
||||
filter: function(can, value) {
|
||||
|
@ -89,6 +89,9 @@ body.width5 { /* 1600-1920 */
|
||||
}
|
||||
body.width6 { /* 1920-2240 显示器 */
|
||||
--river-width:280px; --input-width:180px; --card-height:160px;
|
||||
--project-width:280px;
|
||||
--float-height:640px;
|
||||
--float-width:1400;
|
||||
}
|
||||
/* element */
|
||||
* { box-sizing:border-box; padding:0; border:0; margin:0; tab-size:4; }
|
||||
@ -217,7 +220,8 @@ fieldset.input.float table.content td { padding:var(--input-padding); }
|
||||
body div.float { padding:var(--plugin-padding); }
|
||||
fieldset.Action>div.toast { height:fit-content; width:fit-content; overflow:auto;
|
||||
position:absolute; right:var(--plugin-margin);
|
||||
bottom:calc(var(--footer-height) + var(--action-height) + var(--plugin-margin));
|
||||
top:calc(var(--header-height) + var(--plugin-margin) + var(--action-height));
|
||||
/* bottom:calc(var(--footer-height) + var(--action-height) + var(--plugin-margin)); */
|
||||
}
|
||||
body.mobile fieldset.Action>div.toast {
|
||||
bottom:calc(var(--footer-height) + var(--action-height));
|
||||
@ -306,6 +310,7 @@ body>div.upload div.status div.show { float:right; }
|
||||
body>div.upload div.status div.size { text-align:center; }
|
||||
/* display */
|
||||
fieldset>form.option:not(.hide), fieldset>div.action:not(.hide):not(.flex) { display:contents; } .hide, .hidden { display:none; }
|
||||
body:not(.mobile) fieldset:not(.Action):not(.output):not(.cmd)>div.action:not(.hide):not(.flex) { display:flex; }
|
||||
fieldset.panel>legend, fieldset.panel>div.status { display:none; }
|
||||
fieldset.output>legend, fieldset.output>form.option, fieldset.output>div.action:not(.flex), fieldset.output>div.status, fieldset.output>div.item { display:none; }
|
||||
div.action, div.output, div.status, div.project, div.content, div.profile, div.display, table.content, table.content td, div.list, div.code, div.story, div.float, fieldset.float { overflow:auto; }
|
||||
@ -316,6 +321,8 @@ fieldset.auto, fieldset.full, fieldset.float { position:fixed; }
|
||||
fieldset.full { position:fixed; left:0; top:0; }
|
||||
fieldset.plug { position:sticky; bottom:0; right:0; float:right; }
|
||||
fieldset.vimer>div.output fieldset.plug { position:absolute; bottom:0; right:0; float:right; }
|
||||
fieldset.vimer>div.output div.project fieldset.plug { position:static; float:unset;}
|
||||
fieldset.vimer>div.output div.project fieldset.plug div.output.card>div.item { min-width:120px; width:calc(100% - 2*var(--input-margin)); }
|
||||
div.float { position:fixed; }
|
||||
div.output { position:relative; } div.content { position:relative; }
|
||||
div.output>div.code { position:sticky; left:0; }
|
||||
|
@ -86,7 +86,7 @@ Volcanos("user", {
|
||||
toast: function(can, content, title, duration, progress, hash) { can = can._fields? can.sup: can
|
||||
var meta = can.base.isObject(content)? content: {content: content, title: title, duration: duration, progress: progress, hash: hash}
|
||||
meta.title = meta.title||can.core.Keys(can.ConfSpace(), can.ConfIndex())||can._name.split(nfs.PS).slice(-2).join(nfs.PS)
|
||||
meta.hash && (meta.title += " "+meta.hash.slice(0, 6)), meta.action = meta.action||[""]
|
||||
meta.hash && can.misc.isDebug(can) && (meta.title += " "+meta.hash.slice(0, 6)), meta.action = meta.action||[""]
|
||||
var width = meta.width||390; if (width < 0) { width = can.page.width() + width }
|
||||
var ui = can.page.Append(can, can._root.Action._toast, [{view: [[chat.TOAST, meta.style, chat.FLOAT]], style: {width: width}, list: [
|
||||
{view: [wiki.TITLE, "", meta.title||""], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }},
|
||||
@ -109,7 +109,6 @@ Volcanos("user", {
|
||||
can.onmotion.delay(can, function() { can.page.Remove(can, ui._target) }, 1000)
|
||||
}), _target: ui._target,
|
||||
}); can.onmotion.story.auto(can, ui._target)
|
||||
// , meta.resize && can.onmotion.delayResize(can, ui._target, meta.resize)
|
||||
if (meta.action && meta.action.length == 1 && meta.action[0] === "") {
|
||||
can.page.Select(can, action._target, html.DIV_ACTION, function(target) { can.onmotion.hidden(can, target) })
|
||||
} can._toast && (typeof can._toast.close == code.FUNCTION && can._toast.close(), delete(can._toast))
|
||||
@ -124,7 +123,6 @@ Volcanos("user", {
|
||||
share: function(can, msg, cmds) { can.page.exportValue(can, msg)
|
||||
can.run(msg, cmds||[ctx.ACTION, chat.SHARE], function(msg) { can.user.copy(msg._event, can, msg.Append(mdb.NAME))
|
||||
var ui = can.user.toast(can, {style: cli.QRCODE, title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
|
||||
// can.page.style(can, ui._target, html.TOP, (can.page.height() - ui._target.offsetHeight)/4)
|
||||
})
|
||||
},
|
||||
copy: function(event, can, text) { if (!text) { return }
|
||||
|
@ -110,7 +110,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { can.db.list = can.misc.S
|
||||
can.getActionSize(function(height, width) { var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can, height, width) || can.onlayout._plugin(can, button) })
|
||||
},
|
||||
_menus: [[html.LAYOUT, ALL, TABS, TABVIEW, VERTICAL, HORIZON, GRID, FREE, FLOW, PAGE], web.STORE, web.DREAM, web.DESKTOP, web.PORTAL],
|
||||
_trans: kit.Dict(web.STORE, "商店", web.DREAM, "空间", web.DESKTOP, "桌面", web.PORTAL, "官网", html.LAYOUT, "布局", ALL, "详情布局", TABS, "标签布局", TABVIEW, "标签分屏", VERTICAL, "上下分屏", HORIZON, "左右分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
_trans: kit.Dict(html.LAYOUT, "布局", ALL, "详情布局", TABS, "标签布局", TABVIEW, "标签分屏", VERTICAL, "上下分屏", HORIZON, "左右分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
})
|
||||
Volcanos(chat.ONLAYOUT, {
|
||||
tabs: function(can, height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) },
|
||||
|
@ -22,10 +22,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
}) },
|
||||
_theme: function(can, theme) { return can.ui.diy&&can.ui.diy[theme]||theme },
|
||||
_avatar: function(can, msg) { can.user.isExtension || can.user.isLocalFile || can.page.Modify(can, "div.state.avatar>img", {src: can.onexport.avatar(can)}) },
|
||||
_background: function(can, msg) { if (can.user.isExtension || can.user.isLocalFile) { return }
|
||||
can.onlayout.background(can, can.onexport.background(can))
|
||||
// window.parent == window? can.onlayout.background(can, can.onexport.background(can)): can.page.style(can, document.body, html.BACKGROUND_COLOR, cli.TRANSPARENT)
|
||||
},
|
||||
_background: function(can, msg) { if (can.user.isExtension || can.user.isLocalFile) { return } can.onlayout.background(can, can.onexport.background(can)) },
|
||||
_search: function(can, msg, target) {
|
||||
can._search = can.onappend.input(can, {type: html.TEXT, _className: "args trans", icon: icon.SEARCH, name: mdb.SEARCH, value: can.misc.Search(can, "_search"), onkeydown: function(event) { can.onkeymap.input(event, can)
|
||||
event.key == code.ENTER && can.onengine.signal(can, chat.ONOPENSEARCH, can.request(event, {type: mdb.FOREACH, word: event.target.value||""}))
|
||||
@ -131,9 +128,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
||||
theme: function(event, can) { can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) {
|
||||
can.onimport.theme(can, can.onimport._theme(can, target.className == icon.SUN? html.DARK: html.LIGHT))
|
||||
}) },
|
||||
qrcode: function(event, can) {
|
||||
can.user.share(can, can.request(event, {_handle: ice.TRUE}), [ctx.ACTION, cli.QRCODE])
|
||||
},
|
||||
qrcode: function(event, can) { can.user.share(can, can.request(event, {_handle: ice.TRUE}), [ctx.ACTION, cli.QRCODE]) },
|
||||
language: function(event, can) { can.onimport.language(can, can.user.info.language.indexOf("zh") == 0? "en-us": "zh-cn") },
|
||||
email: function(event, can) { can.user.input(can.request(event, {to: can.user.info.email, subject: can.user.title()}), can, [{name: "to", _trans: "收件人", need: "must"}, "subject","content"], function(args) {
|
||||
can.runAction(event, aaa.EMAIL, args, function() { can.user.toastSuccess(can) })
|
||||
|
@ -82,6 +82,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
}); var index = args[0]
|
||||
can.core.List(args.slice(1), function(val) { can.page.Append(can, target, [{text: [val, "", html.ITEM], onclick: function(event) {
|
||||
can.runAction(can.request(event, {index: index}), mdb.INPUTS, [ctx.ARGS], function(msg) {
|
||||
debugger
|
||||
can.user.carte(event, can, {}, msg[msg.append[0]], function(event, button) { can.onimport.tabview(can, "", [index, button].join(mdb.FS), ctx.INDEX) })
|
||||
})
|
||||
}}]) })
|
||||
@ -142,7 +143,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg; can.onexport.hash(can)
|
||||
can.isCmdMode() && can.onexport.title(can, (isIndex()||isSpace()? "": path)+file), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView()
|
||||
if (isSpace()) {
|
||||
can.ui.path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}))
|
||||
can.ui.path.innerHTML = can.page.Format(html.A, can.base.trimPrefix(can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}), location.origin))
|
||||
} else if (isIndex()) {
|
||||
can.onimport._tabPath(can, nfs.PT, ice.CMD, can.Option(nfs.FILE), function(p, pre) {
|
||||
can.onimport.tabview(can, "", can.core.Keys(can.base.trimSuffix(pre, nfs.PT), p), ctx.INDEX)
|
||||
|
@ -51,12 +51,10 @@ Volcanos(chat.ONFIGURE, {
|
||||
if (link.pod) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return }
|
||||
can.onimport.tabview(can, "", arg, web.SPACE)
|
||||
}
|
||||
sub.onexport.record = function(sub, value, key) { can.onimport.tabview(can, "", value, web.SPACE) }
|
||||
sub.onexport.record = function(sub, value, key) {
|
||||
can.onimport.tabview(can, "", value, web.SPACE) }
|
||||
can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) })
|
||||
}), zone.toggle(false) },
|
||||
repos: function(can, target, zone) { can.onimport._zone(can, zone, {index: web.CODE_GIT_SEARCH, style: html.OUTPUT, mode: mdb.ZONE}, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, data) { can.onimport.tabview(can, "", [web.CODE_GIT_SEARCH, value].join(","), ctx.INDEX) }
|
||||
}), zone.toggle(false) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: ["创建", "编译", "源码", "计划", "流程", "文档", "后台", "桌面", "官网"], _trans: {show: "预览", exec: "展示"},
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) {
|
||||
|
@ -23,7 +23,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
can.page.Append(can, target, list), can.onmotion.orderShow(can, target)
|
||||
},
|
||||
_vimer_zone: function(can, msg, target) { msg.Table(function(value) { var action = can.page.parseAction(can, value)
|
||||
can.onimport.item(can, {icon: can.misc.Resource(can, value.icon||value.avatar_url), name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]||value.description}, function(event) {
|
||||
can.onimport.item(can, {type: value.type, status: value.status, icon: can.misc.Resource(can, value.icon||value.icons||value.avatar_url), name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]||value.description}, function(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) { 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() })
|
||||
@ -37,7 +37,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
"=", function() { can.onimport.tabview(can, "", [sub.ConfIndex()].concat(sub.Conf(ctx.ARGS)).join(","), ctx.INDEX) },
|
||||
))
|
||||
var action = can.core.List(sub.Conf(ctx.INPUTS), function(item) { if (item.type == html.BUTTON && [ice.LIST, ice.BACK].indexOf(item.name) == -1) { return item.name } })
|
||||
sub.onexport.output = function(_sub, msg) { zone._total(msg.Length()), cb(sub, msg)
|
||||
sub.onexport.output = function(_sub, msg) {
|
||||
zone._total(msg.Length()), cb(sub, msg)
|
||||
zone._menu = shy({_trans: sub._trans}, action.concat(can.base.Obj(msg.Option(ice.MSG_ACTION), [])), function(event, button, meta, carte) {
|
||||
sub.Update(event, [ctx.ACTION, button]), carte.close()
|
||||
}), can.user.toastSuccess(can)
|
||||
@ -129,7 +130,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
can.user.carteItem(event, can, item)
|
||||
}
|
||||
var icon = item.icon||item.icons
|
||||
var ui = can.page.Append(can, target, [{view: html.ITEM, list: [
|
||||
var ui = can.page.Append(can, target, [{view: [[html.ITEM, item.type, item.status]], list: [
|
||||
icon && (can.base.contains(icon, ice.HTTP, ".png", ".jpg")? {img: can.misc.Resource(can, icon)}: {icon: icon}),
|
||||
{text: item.nick||item.name||item.zone}], title: item.title, onclick: function(event) {
|
||||
can.onmotion.select(can, target, html.DIV_ITEM, event.currentTarget)
|
||||
|
Loading…
x
Reference in New Issue
Block a user