From a63f1d4dab5e6dcb6eb10e66b88bd0e5c19c7312 Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 10 Feb 2025 23:04:58 +0800 Subject: [PATCH] opt some --- const.js | 1 + lib/misc.js | 5 ++++- lib/user.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/const.js b/const.js index b8d27b26..d6b5c43c 100644 --- a/const.js +++ b/const.js @@ -362,6 +362,7 @@ var html = { FLOAT_HEIGHT: 480, FLOAT_WIDTH: 1200, PLUGIN_PADDING: 0, PLUGIN_MARGIN: 0, + IFRAME_HEIGHT: 420, HEADER_HEIGHT: 48, ACTION_HEIGHT: 32, STATUS_HEIGHT: 32, QRCODE_HEIGHT: 363, QRCODE_WIDTH: 360, CARD_HEIGHT: 160, CARD_WIDTH: 280, diff --git a/lib/misc.js b/lib/misc.js index 38c66e6c..f1449579 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -253,7 +253,10 @@ Volcanos("misc", { Resource: function(can, path, space, serve) { if (!path) { return "" } if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.P+path+(path.indexOf("usr/icons/") == -1? (space? can.core.Split(_version, "&")[0]: _version): "") } if (!can.base.beginWith(path, web.HTTP)) { if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); path = u.origin + path } } - if (!space && can.base.beginWith(path, web.HTTP)) { return path } + if (!space && can.base.beginWith(path, web.HTTP)) { + debugger + return location.origin+path + } if (!space && path.indexOf("pod=") > 0) { return path } if (can.base.beginWith(path, "/") && path.indexOf("pod=") > 0) { return path } return can.base.MergeURL(path, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) diff --git a/lib/user.js b/lib/user.js index d4a7c0a2..152b797e 100644 --- a/lib/user.js +++ b/lib/user.js @@ -394,7 +394,7 @@ Volcanos("user", { } } else if (value.type == mdb.PLUGIN) { _list.push(value.name), list[value.name] = function(target) { - can.onappend.plugin(can, {space: value.space, index: value.index, args: can.core.Split(value.args), height: html.QRCODE_HEIGHT, width: 420, style: html.OUTPUT}, function(sub) { + can.onappend.plugin(can, {space: value.space, index: value.index, args: can.core.Split(value.args), height: html.QRCODE_HEIGHT, width: html.IFRAME_HEIGHT, style: html.OUTPUT}, function(sub) { var run = sub.run; sub.run = function(event, cmds, cb) { var msg = can.request(event, {space: arg[0]}); can.page.exportValue(can, msg), run(event, cmds, cb) } }, ui.output) } @@ -422,7 +422,7 @@ Volcanos("user", { ]}]), window.parent != window && window.innerHeight < 480 && can.onmotion.hidden(can, ui.output) can.page.style(can, ui._target, { left: (can.page.width()-ui._target.offsetWidth)/2, - top: can.user.isMobile? 20: can.page.height() < 480? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-can.base.Min(ui._target.offsetHeight, 420)-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT, + top: can.user.isMobile? 20: can.page.height() < 480? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-can.base.Min(ui._target.offsetHeight, html.IFRAME_HEIGHT)-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT, }) } })