mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
17dab20a35
commit
fe46ea610f
@ -28,6 +28,7 @@ Volcanos("user", {help: "用户操作", agent: {
|
|||||||
isExtension: location && location.protocol && location.protocol == "chrome-extension:",
|
isExtension: location && location.protocol && location.protocol == "chrome-extension:",
|
||||||
isLocalFile: location && location.protocol && location.protocol == "file:",
|
isLocalFile: location && location.protocol && location.protocol == "file:",
|
||||||
isLandscape: function() { return window.innerWidth > window.innerHeight },
|
isLandscape: function() { return window.innerWidth > window.innerHeight },
|
||||||
|
isPortrait: function() { return window.innerWidth < window.innerHeight },
|
||||||
mod: {
|
mod: {
|
||||||
isPod: location && location.pathname && (location.pathname.indexOf("/chat/pod/") == 0 || location.pathname.indexOf("/x/") == 0),
|
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),
|
isDiv: location && location.pathname && (location.pathname.indexOf("/chat/div/") == 0),
|
||||||
|
@ -1,14 +1,27 @@
|
|||||||
Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target) {
|
Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target) {
|
||||||
|
|
||||||
can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg)
|
can.onmotion.clear(can), can.base.isFunc(cb) && cb(msg)
|
||||||
if (msg.Length() > 0) { return can.onappend.table(can, msg) }
|
if (msg.Length() > 0) { return can.onappend.table(can, msg) }
|
||||||
|
|
||||||
can.page.Modify(can, target, msg.Result())
|
can.page.Modify(can, target, msg.Result())
|
||||||
can.page.Select(can, target, wiki.ITEM, function(item) { var data = item.dataset||{}
|
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.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
|
navmenu: function(can, data, target) { var nav = can.sup._navmenu
|
||||||
nav = nav||can.page.Append(can, can._fields, [{view: wiki.NAVMENU}]).first
|
nav = nav||can.page.Append(can, can._fields, [{view: wiki.NAVMENU}]).first
|
||||||
can.onmotion.clear(can, nav), can._fields.insertBefore(nav, can._output)
|
can.onmotion.clear(can, nav), can._fields.insertBefore(nav, can._output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user