1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-04-06 12:27:00 +08:00
parent 17dab20a35
commit fe46ea610f
2 changed files with 16 additions and 2 deletions

View File

@ -28,6 +28,7 @@ Volcanos("user", {help: "用户操作", agent: {
isExtension: location && location.protocol && location.protocol == "chrome-extension:",
isLocalFile: location && location.protocol && location.protocol == "file:",
isLandscape: function() { return window.innerWidth > window.innerHeight },
isPortrait: function() { return window.innerWidth < window.innerHeight },
mod: {
isPod: location && location.pathname && (location.pathname.indexOf("/chat/pod/") == 0 || location.pathname.indexOf("/x/") == 0),
isDiv: location && location.pathname && (location.pathname.indexOf("/chat/div/") == 0),

View File

@ -1,14 +1,27 @@
Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target) {
can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg)
if (msg.Length() > 0) { return can.onappend.table(can, msg) }
can.page.Modify(can, target, msg.Result())
can.page.Select(can, target, wiki.ITEM, function(item) { var data = item.dataset||{}
can.core.CallFunc([can.onimport, data.type], [can, data, item])
can.page.Modify(can, item, {style: can.base.Obj(data.style)})
can.page.style(can, item, html.MAX_WIDTH, can.ConfWidth()-(can.user.isWindows? 40: 30))
can.core.CallFunc([can.onimport, data.type], [can, data, item])
// can.page.style(can, item, html.MAX_WIDTH, can.ConfWidth()-(can.user.isWindows? 40: 30))
})
},
image: function(can, data, target) {
can.page.style(can, target, html.MAX_HEIGHT, can.ConfHeight()/2, html.MAX_WIDTH, can.ConfWidth())
// if (can.user.isMobile) {
if (can.user.isLandscape()) {
} else{
can.page.style(can, target, html.MAX_HEIGHT, can.ConfHeight(), html.MAX_WIDTH, can.ConfWidth())
}
// return
// }
// can.page.style(can, target, html.MAX_HEIGHT, can.ConfHeight()/4)
},
navmenu: function(can, data, target) { var nav = can.sup._navmenu
nav = nav||can.page.Append(can, can._fields, [{view: wiki.NAVMENU}]).first
can.onmotion.clear(can, nav), can._fields.insertBefore(nav, can._output)