1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-04-20 19:26:22 +08:00
parent 2bc798aceb
commit 4086075a75
6 changed files with 34 additions and 18 deletions

View File

@ -205,6 +205,12 @@ var nfs = {
USR_ICONS_ICEBERGS: "usr/icons/icebergs.jpg", USR_ICONS_ICEBERGS: "usr/icons/icebergs.jpg",
USR_ICONS_VOLCANOS: "usr/icons/volcanos.jpg", USR_ICONS_VOLCANOS: "usr/icons/volcanos.jpg",
V: "/v/",
M: "/m/",
P: "/p/",
X: "/x/",
S: "/s/",
C: "/c/",
REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/", REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/",
SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
WIKI_PORTAL: "/wiki/portal/", WIKI_PORTAL: "/wiki/portal/",
@ -282,15 +288,10 @@ var chat = {
"local/wiki/feel.js", "local/wiki/feel.js",
"local/wiki/word.js", "local/wiki/word.js",
"local/team/plan.js", "local/team/plan.js",
].map(function(p) { return "/plugin/"+p }).concat([ ].map(function(p) { return "/v/plugin/"+p }),
"usr/icebergs/core/wiki/portal.css",
"usr/icebergs/core/wiki/portal.js",
].map(function(p) {
return "/require/"+p
})),
PLUGIN_LOCAL: "/plugin/local/", PLUGIN_STORY: "/plugin/story/", PLUGIN_INPUT: "/plugin/input/", PLUGIN_LOCAL: "/plugin/local/", PLUGIN_STORY: "/plugin/story/", PLUGIN_INPUT: "/plugin/input/",
PLUGIN_INPUT_JS: "/plugin/input.js", PLUGIN_TABLE_JS: "/plugin/table.js", PLUGIN_STATE_JS: "/plugin/state.js", PLUGIN_INPUT_JS: "/plugin/input.js", PLUGIN_TABLE_JS: "/plugin/table.js", PLUGIN_STATE_JS: "/plugin/state.js",
FRAME_JS: "/volcanos/frame.js", FRAME_JS: "/v/frame.js",
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap", ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport", ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport",
@ -412,8 +413,8 @@ var icon = {
dream: "bi bi-box", space: "bi bi-box", store: "bi bi-shop", dream: "bi bi-box", space: "bi bi-box", store: "bi bi-shop",
word: "bi bi-book", repos: "bi bi-git", vimer: "bi bi-bug", build: "bi bi-tools", xterm: "bi bi-terminal", word: "bi bi-book", repos: "bi bi-git", vimer: "bi bi-bug", build: "bi bi-tools", xterm: "bi bi-terminal",
stats: "bi bi-card-list", stats: "bi bi-card-list",
matrix: "bi bi-grid-3x3-gap", matrix: "bi bi-grid-3x3-gap",
feel: "bi bi-images", feel: "bi bi-images",
plan: "bi bi-calendar4-week", plan: "bi bi-calendar4-week",
status: "bi bi-git", status: "bi bi-git",

View File

@ -349,7 +349,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
can.core.List((can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST]))||[]).concat([ can.core.List((can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST]))||[]).concat([
can.ConfSpace() && {name: web.SPACE, value: can.ConfSpace()}, can.ConfSpace() && {name: web.SPACE, value: can.ConfSpace()},
], can.misc.Search(can, log.DEBUG)==ice.TRUE? [ ], can.misc.Search(can, log.DEBUG)==ice.TRUE? [
fileline && {name: nfs.SOURCE, value: can.base.trimPrefix(fileline.split("?")[0], nfs.REQUIRE), onclick: function(event) { can.onkeymap.prevent(event) fileline && {name: nfs.SOURCE, value: can.base.trimPrefix(fileline.split("?")[0], nfs.REQUIRE, nfs.P), onclick: function(event) { can.onkeymap.prevent(event)
var ls = can.misc.SplitPath(can, fileline); if (event.metaKey) { var ls = can.misc.SplitPath(can, fileline); if (event.metaKey) {
can.user.open(can.misc.MergePodCmd(can, {pod: can.ConfSpace(), cmd: web.CODE_VIMER, path: ls[0], file: ls[1]})) can.user.open(can.misc.MergePodCmd(can, {pod: can.ConfSpace(), cmd: web.CODE_VIMER, path: ls[0], file: ls[1]}))
} else { can.onappend._float(can, web.CODE_VIMER, ls) } } else { can.onappend._float(can, web.CODE_VIMER, ls) }

View File

@ -1,4 +1,10 @@
/* variable */ /* variable */
@media (prefers-color-scheme: light) {
body { --plugin-bg-color:white; --plugin-fg-color:black; }
}
@media (prefers-color-scheme: dark) {
body { --plugin-bg-color:black; --plugin-fg-color:silver; }
}
body.light { body.light {
--plugin-bg-color:white; --plugin-fg-color:black; --plugin-bg-color:white; --plugin-fg-color:black;
--code-keyword:darkblue; --code-comment:green; --code-keyword:darkblue; --code-comment:green;
@ -169,7 +175,12 @@ body.en span[lang^=zh] { display:none; } body.zh span[lang^=en] { display:none;
div.project div.action { width:100%; } div.project div.action { width:100%; }
div.project div.list { margin-left:var(--button-margin); clear:both; } div.project div.list { margin-left:var(--button-margin); clear:both; }
div.project div.list fieldset { position:static; } div.project div.list fieldset { position:static; }
div.project div.item:not(.hide) { font-family:var(--code-font-family); white-space:pre; line-height:24px; padding:0 var(--button-margin); display:flex; align-items:center; } div.project div.item:not(.hide) {
// white-space:pre;
line-height:24px;
padding:0 var(--button-margin); display:flex; align-items:center;
cursor:pointer;
}
div.project div.item img { height:var(--action-height); width:var(--action-height); } div.project div.item img { height:var(--action-height); width:var(--action-height); }
div.project div.item img { margin:0; } div.project div.item img { margin:0; }
div.project div.item input:not([type=button]) { border-right:0; } div.project div.item input:not([type=button]) { border-right:0; }
@ -527,7 +538,8 @@ body { font-family:var(--body-font-family); }
legend { font-family:var(--legend-font-family); font-style:italic; } legend { font-family:var(--legend-font-family); font-style:italic; }
input { font-family:var(--input-font-family); } input { font-family:var(--input-font-family); }
kbd { font-family:var(--code-font-family); line-height:var(--code-line-height); } kbd { font-family:var(--code-font-family); line-height:var(--code-line-height); }
kbd:hover { background-color:var(--hover-bg-color); } // kbd:hover { background-color:var(--hover-bg-color); }
kbd:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
table.content { font-family:var(--table-font-family); } table.content { font-family:var(--table-font-family); }
table.content th { font-family:var(--input-font-family); font-style:italic; } table.content th { font-family:var(--input-font-family); font-style:italic; }
body div.code { font-family:var(--table-font-family); } body div.code { font-family:var(--table-font-family); }

View File

@ -204,7 +204,7 @@ Volcanos("misc", {
}, },
ResourceFavicon(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) }, ResourceFavicon(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) },
Resource(can, path, space, serve) { Resource(can, path, space, serve) {
if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.REQUIRE+path+_version } if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.P+path+_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)) { if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); path = u.origin + path } }
if (path.indexOf("pod=") > 0) { 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)) return can.base.MergeURL(path, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD))
@ -245,6 +245,7 @@ Volcanos("misc", {
SplitPath: function(can, path) { SplitPath: function(can, path) {
if (path.indexOf("http") == 0) { return [path] } if (path.indexOf("http") == 0) { return [path] }
if (path.indexOf("/require/") == 0) { return [path] } if (path.indexOf("/require/") == 0) { return [path] }
if (path.indexOf("/p/") == 0) { return [path] }
if (path.indexOf("/plugin/") == 0) { return ["usr/volcanos/", path.split("?")[0]] } if (path.indexOf("/plugin/") == 0) { return ["usr/volcanos/", path.split("?")[0]] }
var ls = path.split(nfs.PS); if (ls.length == 1) { return [nfs.PWD, ls[0]] } var ls = path.split(nfs.PS); if (ls.length == 1) { return [nfs.PWD, ls[0]] }
if (ls[0] == ice.USR) { return [ls.slice(0, 2).join(nfs.PS)+nfs.PS, ls.slice(2).join(nfs.PS)] } if (ls[0] == ice.USR) { return [ls.slice(0, 2).join(nfs.PS)+nfs.PS, ls.slice(2).join(nfs.PS)] }

View File

@ -394,7 +394,7 @@ Volcanos("page", {
requireModules: function(can, libs, cb, cbs) { if (!libs || libs.length == 0) { return cb && cb() } requireModules: function(can, libs, cb, cbs) { if (!libs || libs.length == 0) { return cb && cb() }
for (var i = 0; i < libs.length; i++) { if (libs[i].indexOf(nfs.PS) == 0 || libs[i].indexOf(ice.HTTP) == 0) { continue } for (var i = 0; i < libs.length; i++) { if (libs[i].indexOf(nfs.PS) == 0 || libs[i].indexOf(ice.HTTP) == 0) { continue }
if (libs[i].indexOf(nfs._CSS) == -1 && libs[i].indexOf(nfs._JS) == -1) { libs[i] = libs[i]+"/lib/"+libs[i]+nfs._JS } if (libs[i].indexOf(nfs._CSS) == -1 && libs[i].indexOf(nfs._JS) == -1) { libs[i] = libs[i]+"/lib/"+libs[i]+nfs._JS }
libs[i] = nfs.REQUIRE_MODULES+libs[i] libs[i] = nfs.M+libs[i]
} can.require(libs, cb, cbs) } can.require(libs, cb, cbs)
}, },
requireDraw: function(can, cb) { can.require([chat.PLUGIN_LOCAL+"wiki/draw.js", chat.PLUGIN_LOCAL+"wiki/draw/path.js"], function() { requireDraw: function(can, cb) { can.require([chat.PLUGIN_LOCAL+"wiki/draw.js", chat.PLUGIN_LOCAL+"wiki/draw/path.js"], function() {

View File

@ -28,15 +28,17 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {},
} }
if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) } if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) }
if (libs[0] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) } if (libs[0] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) }
if (libs[0].indexOf(nfs.SRC) == 0 || libs[0].indexOf(nfs.USR) == 0) { libs[0] = "/require/"+libs[0] } 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] } 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].split(ice.QS)[0]).toLowerCase()
function next() { can._load(name, cbs), can.require(libs.slice(1), cb, cbs) } function next() { can._load(name, cbs), can.require(libs.slice(1), cb, cbs) }
if (name.indexOf("/lib/") == 0) { name = "/volcanos"+name } if (name.indexOf("/lib/") == 0) { name = "/v"+name }
if (name.indexOf("/panel/") == 0) { name = "/volcanos"+name } if (name.indexOf("/panel/") == 0) { name = "/v"+name }
if (name.indexOf("/plugin/") == 0) { name = "/volcanos"+name } if (name.indexOf("/plugin/") == 0) { name = "/v"+name }
if (name.indexOf("/volcanos/") == 0 && meta.volcano) { name = meta.volcano+name } if (name.indexOf("/volcanos/") == 0 && meta.volcano) { name = meta.volcano+name }
if (name.indexOf("/require/") == 0 && meta.iceberg) { name = meta.iceberg+name } if (name.indexOf("/require/") == 0 && meta.iceberg) { name = meta.iceberg+name }
if (name.indexOf("/p/") == 0 && meta.iceberg) { name = meta.iceberg+name }
if (name.indexOf("/v/") == 0 && meta.iceberg) { name = meta.iceberg+name }
meta.cache[name]? next(): meta._load(name, next) meta.cache[name]? next(): meta._load(name, next)
}, },
request: function(event) { event = event||{}, event = event._event||event request: function(event) { event = event||{}, event = event._event||event