1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-28 18:02:02 +08:00
This commit is contained in:
shylinux 2021-11-05 08:38:12 +08:00
parent 6857ebd13f
commit 976f76bd52
5 changed files with 9 additions and 5 deletions

View File

@ -413,7 +413,7 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can, targe
can.page.Select(can, target, can.core.Keys(html.FIELDSET, chat.MAIN), function(field, index) { can.page.Select(can, target, can.core.Keys(html.FIELDSET, chat.MAIN), function(field, index) {
if (can.user.isMobile) { if (can.user.isMobile) {
can.page.Modify(can, field, {style: {"padding-top": can.user.isLandscape? "0px": ""}}) can.page.Modify(can, field, {style: {"padding-top": can.user.isLandscape()? "0px": ""}})
} else { } else {
height -= can.page.Select(can, field, can.core.Keys(html.DIV, html.ACTION))[0].offsetHeight height -= can.page.Select(can, field, can.core.Keys(html.DIV, html.ACTION))[0].offsetHeight

View File

@ -20,7 +20,7 @@ Volcanos("user", {help: "用户操作", agent: {
}, },
}, },
isIE: navigator.userAgent.indexOf("MSIE") > -1, isIE: navigator.userAgent.indexOf("MSIE") > -1,
isLandscape: window.innerWidth > window.innerHeight, isLandscape: function() { return window.innerWidth > window.innerHeight },
isWeiXin: navigator.userAgent.indexOf("MicroMessenger") > -1, isWeiXin: navigator.userAgent.indexOf("MicroMessenger") > -1,
isIPhone: navigator.userAgent.indexOf("iPhone") > -1, isIPhone: navigator.userAgent.indexOf("iPhone") > -1,
isMobile: navigator.userAgent.indexOf("Mobile") > -1, isMobile: navigator.userAgent.indexOf("Mobile") > -1,
@ -50,7 +50,7 @@ Volcanos("user", {help: "用户操作", agent: {
return text && (document.title = text), document.title return text && (document.title = text), document.title
}, },
topic: function(can, name) { topic: function(can, name) {
can.user.isMobile && (name += " mobile") && can.user.isLandscape && (name += " landscape") can.user.isMobile && (name += " mobile") && can.user.isLandscape() && (name += " landscape")
can.page.Modify(can, document.body, {className: name}) can.page.Modify(can, document.body, {className: name})
}, },
language: function(can) { language: function(can) {

View File

@ -180,6 +180,7 @@ fieldset {
} }
fieldset>form.option { fieldset>form.option {
float:left; float:left;
display:contents;
} }
fieldset>form.option>div.item { fieldset>form.option>div.item {
float:left; margin-right:3px; float:left; margin-right:3px;

View File

@ -200,10 +200,13 @@ Volcanos("ondetail", {help: "用户交互", list: [],
can.run(event, can.misc.Concat([ctx.ACTION, "inner"], cmds), function(msg) { can.run(event, can.misc.Concat([ctx.ACTION, "inner"], cmds), function(msg) {
msg.Option(ice.MSG_ACTION, cli.CLOSE) msg.Option(ice.MSG_ACTION, cli.CLOSE)
can.get("Action", "size", function(left, top, width, height) { left = left||0 can.get("Action", "size", function(left, top, width, height) { left = left||0
if (height > window.innerHeight) { height = window.innerHeight }
var top = 120, margin = 20; if (can.user.isMobile) { margin = 0 var top = 120, margin = 20; if (can.user.isMobile) { margin = 0
if (can.user.isLandscape) { if (can.user.isLandscape()) {
height += (can.user.mod.isCmd? -20: 200)
top = 24, sub.Conf(chat.HEIGHT, height-top) top = 24, sub.Conf(chat.HEIGHT, height-top)
} else { } else {
height += (can.user.mod.isCmd? -80: 200)
top = 48, sub.Conf(chat.HEIGHT, height-top) top = 48, sub.Conf(chat.HEIGHT, height-top)
} }
} else { } else {

View File

@ -4,7 +4,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
can.onappend._status(can, ["from", "commit", "total", "max", "date", "text", "add", "del"]) can.onappend._status(can, ["from", "commit", "total", "max", "date", "text", "add", "del"])
can.msg = msg, can.data = msg.Table(), can.onimport._sum(can) can.msg = msg, can.data = msg.Table(), can.onimport._sum(can)
can.Action(chat.HEIGHT, msg.Option(chat.HEIGHT)||can.user.mod.isCmd? "max": can.user.isMobile&&can.user.isLandscape? "200": "400") can.Action(chat.HEIGHT, msg.Option(chat.HEIGHT)||can.user.mod.isCmd? "max": can.user.isMobile&&can.user.isLandscape()? "200": "400")
can.Action("speed", parseInt(msg.Option("speed")||"100")) can.Action("speed", parseInt(msg.Option("speed")||"100"))
can.onappend.plugin(can, {type: chat.OUTPUT, index: "web.wiki.draw"}, function(sub) { can.onappend.plugin(can, {type: chat.OUTPUT, index: "web.wiki.draw"}, function(sub) {