mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt code
This commit is contained in:
parent
08f0df672d
commit
a58b5f619e
2
frame.js
2
frame.js
@ -493,7 +493,7 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, targe
|
||||
can.onengine.signal(can, chat.ONSIZE, can.request({}, {width: width, height: height}))
|
||||
},
|
||||
topic: function(can, topic) { topic && (can._topic = topic)
|
||||
can.user.topic(can, can._topic || can.misc.Search(can, chat.TOPIC) || ((can.base.isNight()||can.user.mod.isPod)? chat.BLACK: chat.WHITE))
|
||||
can.user.topic(can, can._topic || can.misc.Search(can, chat.TOPIC) || Volcanos.meta.args.topic || ((can.base.isNight()||can.user.mod.isPod)? chat.BLACK: chat.WHITE))
|
||||
can.page.ClassList.add(can, document.body, can.user.language(can))
|
||||
},
|
||||
background: function(can, url, target) {
|
||||
|
@ -48,7 +48,7 @@ Volcanos("user", {help: "用户操作", agent: {
|
||||
return can.base.Time(time, (fmt||"%y-%m-%d %H:%M:%S").replace("%w", list[now.getDay()]))
|
||||
},
|
||||
|
||||
title: function(text) { return text && (document.title = text), document.title },
|
||||
title: function(text) { return text && (document.title = Volcanos.meta.args.name||text), document.title },
|
||||
topic: function(can, name) {
|
||||
can.user.isMobile && (name += " mobile") && can.user.isLandscape() && (name += " landscape")
|
||||
can.page.Modify(can, document.body, {className: name})
|
||||
@ -151,7 +151,7 @@ Volcanos("user", {help: "用户操作", agent: {
|
||||
"飞书": function() { location.href = "/chat/lark/sso" },
|
||||
}; if (auto) { return list["授权"]() }
|
||||
|
||||
var ui = can.user.input({}, can, [{type: html.USERNAME}, {type: html.PASSWORD}], function(event, button, data, list) { return list[button]() }, can.base.Obj(method, ["登录", "扫码", "授权"]))
|
||||
var ui = can.user.input({}, can, [{type: html.USERNAME}, {type: html.PASSWORD}], function(event, button) { return list[button]() }, can.base.Obj(method, ["登录", "扫码", "授权"]))
|
||||
can.page.Modify(can, ui._target, {className: "input login", style: {left: (window.innerWidth-ui._target.offsetWidth)/2, top: window.innerHeight/6}})
|
||||
},
|
||||
logout: function(can, force) { if (force||can.user.confirm("logout?")) {
|
||||
|
@ -2,9 +2,9 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=0.8,user-scalable=no">
|
||||
<meta charset="utf-8"><title>volcanos</title>
|
||||
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="/page/cache.css">
|
||||
<link rel="stylesheet" type="text/css" href="/page/index.css">
|
||||
<link rel="stylesheet" type="text/css" href="/page/cache.css">
|
||||
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<script src="/proto.js"></script>
|
||||
|
@ -93,7 +93,8 @@ Volcanos({name: "chat", panels: [
|
||||
"web.dream",
|
||||
]},
|
||||
release: {name: "发布 release", index: [
|
||||
"web.code.publish", "web.code.compile", "web.code.autogen", "web.code.git.server",
|
||||
"web.code.install", "web.code.upgrade", "web.code.publish", "web.code.compile", "web.code.autogen", "web.code.binpack", "web.code.webpack",
|
||||
"web.code.git.server",
|
||||
]},
|
||||
research: {name: "测试 research", index: [
|
||||
"web.code.favor", "web.code.bench", "web.code.pprof",
|
||||
|
@ -1,4 +1,5 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg) {
|
||||
can.onaction.layout(can, can.misc.SearchOrConf(can, chat.LAYOUT)||Volcanos.meta.args.layout||"auto", true)
|
||||
var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM)
|
||||
can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next) {
|
||||
item.height = can.Conf(html.HEIGHT)-can.Conf(html.MARGIN_Y)
|
||||
@ -132,7 +133,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, cb, t
|
||||
return key
|
||||
}, can._action, can._output)) {
|
||||
var conf = can.core.Value(can._root, can.core.Keys(chat.RIVER, river, chat.STORM, storm))||{}
|
||||
can.onaction.layout(can, conf.layout||can.misc.SearchOrConf(can, chat.LAYOUT)||"auto", true)
|
||||
can.onaction.layout(can, conf.layout||can.misc.SearchOrConf(can, chat.LAYOUT)||Volcanos.meta.args.layout||"auto", true)
|
||||
return
|
||||
}
|
||||
|
||||
@ -146,7 +147,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, cb, t
|
||||
onsize: function(can, msg, height, width) { can.Conf({height: height, width: width}) },
|
||||
|
||||
help: function(can, button) { can.user.open("/help/"+button+".shy") },
|
||||
layout: function(can, button, slient) {
|
||||
layout: function(can, button, silent) {
|
||||
if (button == "toimage") {
|
||||
can.onmotion.toimage(event, can, document.title, can._output)
|
||||
return
|
||||
@ -167,7 +168,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, cb, t
|
||||
can.getActionSize(function(height, width) { var m = parseInt(data.m)||2, n = parseInt(data.n)||2
|
||||
can.page.css(can.base.replaceAll(chat.ACTION_LAYOUT_FMT, "_width", (width-(4*m+1)*html.PLUGIN_MARGIN)/m+"px", "_height", (height-(4*n+1)*html.PLUGIN_MARGIN)/n+"px"))
|
||||
})
|
||||
}, slient)
|
||||
}, silent)
|
||||
}
|
||||
can.onlayout._init(can)
|
||||
},
|
||||
|
@ -171,8 +171,10 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, cb, t
|
||||
can.core.List(["_event", "_can", "_xhr", ice.MSG_SESSID, ""], function(key) { delete(msg[key]) })
|
||||
})
|
||||
var msg = can.request(event, {
|
||||
name: meta.name, content: JSON.stringify(Volcanos.meta.pack),
|
||||
topic: can._topic, layout: can.getAction(chat.LAYOUT),
|
||||
river: can.Conf(chat.RIVER), storm: can.Conf(chat.STORM),
|
||||
name: meta.name, content: JSON.stringify(Volcanos.meta.pack),
|
||||
args: "name,topic,layout,river,storm",
|
||||
})
|
||||
|
||||
var toast = can.user.toast(can, "打包中...", code.WEBPACK, 1000000)
|
||||
|
Loading…
x
Reference in New Issue
Block a user