1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-06-06 00:02:04 +08:00
parent 7622ca567f
commit 8fcb2dfdfa
3 changed files with 148 additions and 141 deletions

View File

@ -220,10 +220,13 @@ Volcanos("misc", {
}) }
return socket
},
ResourceFavicon: function(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) },
ResourceFavicon: function(can, path, space) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO, space) },
Resource: function(can, path, space, serve) {
if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.P+path+_version }
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 (can.base.beginWith(path, web.HTTP)) { return path }
if (path.indexOf("pod=") > 0) { return path }
return can.base.MergeURL(path, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD))
},

View File

@ -24,7 +24,8 @@ Volcanos(chat.ONFIGURE, {
can.core.List(paths.concat(msg.Table(function(value) { return value.path })), function(p) {
if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.isIn(p,
// nfs.USR_LEARNING, nfs.USR_INTSHELL,
nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_PROGRAM, nfs.USR_NODE_MODULES,
nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_NODE_MODULES,
// nfs.USR_PROGRAM,
nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT
)) { return }
if (p && paths.indexOf(p) == -1 && p[0] != nfs.PS) { paths.push(p) }
@ -308,3 +309,4 @@ Volcanos(chat.ONKEYMAP, {
},
}, _engine: {},
})

View File

@ -32,7 +32,9 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {},
if (libs[0].indexOf(nfs.SRC) == 0 || libs[0].indexOf(nfs.USR) == 0) { libs[0] = nfs.P+libs[0] }
if (libs[0][0] != nfs.PS && libs[0].indexOf(web.HTTP) != 0) { libs[0] = can._path.slice(0, can._path.lastIndexOf(ice.PS)+1)+libs[0] }
// var name = (libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? libs[0]: libs[0].split(ice.QS)[0]).toLowerCase()
var name = (libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? libs[0]: libs[0]).toLowerCase()
// var name = (libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? libs[0]: libs[0]).toLowerCase()
var name = libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? libs[0]: libs[0]
if (name.indexOf("pod=") == -1) { name = name.toLowerCase() }
function next() { can._load(name, cbs), can.require(libs.slice(1), cb, cbs) }
if (name.indexOf("/lib/") == 0) { name = "/v"+name }
if (name.indexOf("/panel/") == 0) { name = "/v"+name }
@ -139,7 +141,7 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "", debug = false)
}
meta._load = function(url, cb) {
if (meta.version) { url += (url.indexOf(web.QS) == -1? web.QS: "&")+meta.version.slice(1) }
if (meta.version && url.indexOf("/p/usr/icons/") == -1) { url += (url.indexOf(web.QS) == -1? web.QS: "&")+meta.version.slice(1) }
if (meta._cache[url]) { return meta._cache[url].push(cb) } else { meta._cache[url] = [cb] }
function _cb() { meta._cache[url].forEach(function(cb) { cb() }), delete(meta._cache[url]) }
switch (url.split(web.QS)[0].split(nfs.PT).pop().toLowerCase()) {