mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt desktop
This commit is contained in:
parent
a8ab134d8e
commit
d75cfdadd2
2
const.js
2
const.js
@ -154,6 +154,7 @@ var nfs = {
|
|||||||
TXT: "txt", CSV: "csv", JSON: "json",
|
TXT: "txt", CSV: "csv", JSON: "json",
|
||||||
PNG: "png", WEBM: "webm",
|
PNG: "png", WEBM: "webm",
|
||||||
PWD: "./", SRC: "src/", SRC_TEMPLATE: "src/template/", SRC_DOCUMENT: "src/document/",
|
PWD: "./", SRC: "src/", SRC_TEMPLATE: "src/template/", SRC_DOCUMENT: "src/document/",
|
||||||
|
SRC_TEMPLATE_WEB_FAVICON: "src/template/web/favicon.ico",
|
||||||
USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", USR_VOLCANOS: "usr/volcanos/", USR_GEOAREA: "usr/geoarea/", USR_ICONS: "usr/icons/",
|
USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", USR_VOLCANOS: "usr/volcanos/", USR_GEOAREA: "usr/geoarea/", USR_ICONS: "usr/icons/",
|
||||||
USR_INTSHELL: "usr/intshell", USR_LEARNING: "usr/learning",
|
USR_INTSHELL: "usr/intshell", USR_LEARNING: "usr/learning",
|
||||||
REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/",
|
REQUIRE: "/require/", REQUIRE_MODULES: "/require/modules/",
|
||||||
@ -213,6 +214,7 @@ var chat = {
|
|||||||
"input/key.js",
|
"input/key.js",
|
||||||
"input/date.js",
|
"input/date.js",
|
||||||
"story/json.js",
|
"story/json.js",
|
||||||
|
"story/stats.js",
|
||||||
"story/spide.js",
|
"story/spide.js",
|
||||||
"story/trend.js",
|
"story/trend.js",
|
||||||
"local/code/xterm.js",
|
"local/code/xterm.js",
|
||||||
|
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 66 KiB |
9
frame.js
9
frame.js
@ -254,14 +254,16 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
if (can.onimport.size) {
|
if (can.onimport.size) {
|
||||||
// if (can.isFullMode() || can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
// if (can.isFullMode() || can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
||||||
can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), can.Conf("_auto"), can.Mode())
|
can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), can.Conf("_auto"), can.Mode())
|
||||||
can.onexport.output(sub, msg)
|
|
||||||
can.isCmdMode() && can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(), html.WIDTH, sub.ConfWidth())
|
can.isCmdMode() && can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(), html.WIDTH, sub.ConfWidth())
|
||||||
|
can.onexport.output(sub, msg)
|
||||||
} can.base.isFunc(cb) && cb(msg)
|
} can.base.isFunc(cb) && cb(msg)
|
||||||
}, target: output})
|
}, target: output})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status); var keys = {}
|
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status); var keys = {}
|
||||||
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])), function(item) { item = can.base.isString(item)? {name: item}: item
|
can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONEXPORT, mdb.LIST])).concat(can.misc.Search(can, log.DEBUG)==ice.TRUE? [
|
||||||
|
{name: html.HEIGHT, value: can.ConfHeight()}, {name: html.WIDTH, value: can.ConfWidth()},
|
||||||
|
]: []), function(item) { item = can.base.isString(item)? {name: item}: item
|
||||||
if (item && item.name == web.SPACE && item.value) { item.value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: item.value}), item.value) }
|
if (item && item.name == web.SPACE && item.value) { item.value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: item.value}), item.value) }
|
||||||
if (can.base.beginWith(item.value, nfs.PS, ice.HTTP)) { item.value = can.page.Format(html.A, item.value, item.value.split("?")[0]) }
|
if (can.base.beginWith(item.value, nfs.PS, ice.HTTP)) { item.value = can.page.Format(html.A, item.value, item.value.split("?")[0]) }
|
||||||
if (keys[item.name]) { return can.Status(item.name, item.value) } keys[item.name] = item
|
if (keys[item.name]) { return can.Status(item.name, item.value) } keys[item.name] = item
|
||||||
@ -600,7 +602,8 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (layout.left+target.offsetWidth > left+width) { layout.left = (right? rect.left: left+width)-target.offsetWidth-1 }
|
if (layout.left+target.offsetWidth > left+width) { layout.left = (right? rect.left: left+width)-target.offsetWidth-1 }
|
||||||
layout.left = can.base.Min(layout.left, 0), layout.top = can.base.Min(layout.top, 32)
|
layout.left = can.base.Min(layout.left, 0)
|
||||||
|
// layout.top = can.base.Min(layout.top, 32)
|
||||||
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
can.page.style(can, target, html.MAX_HEIGHT, top+height-layout.top)
|
||||||
});
|
});
|
||||||
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
can.onmotion.move(can, target, layout), can.onmotion.slideGrow(can, target)
|
||||||
|
11
index.css
11
index.css
@ -26,7 +26,7 @@ body {
|
|||||||
--code-object:silver; --code-datatype:lavender; --code-package:blue;
|
--code-object:silver; --code-datatype:lavender; --code-package:blue;
|
||||||
--code-font-family:monospace; --svg-font-family:var(--code-font-family);
|
--code-font-family:monospace; --svg-font-family:var(--code-font-family);
|
||||||
--body-font-family:sans-serif;
|
--body-font-family:sans-serif;
|
||||||
--legend-font-family:var(--input-font-family); --status-font-family:var(--input-font-family);
|
--legend-font-family:var(--input-font-family); --status-font-family:var(--body-font-family);
|
||||||
--input-font-family:cursive; --table-font-family:var(--body-font-family);
|
--input-font-family:cursive; --table-font-family:var(--body-font-family);
|
||||||
|
|
||||||
--body-font-size:16px; --legend-font-size:20px; --icon-font-size:20px;
|
--body-font-size:16px; --legend-font-size:20px; --icon-font-size:20px;
|
||||||
@ -144,7 +144,7 @@ body>div.carte input[name=filter] { margin:var(--input-margin); width:calc(100%
|
|||||||
body>div.carte div.item { white-space:pre; padding:var(--button-padding); }
|
body>div.carte div.item { white-space:pre; padding:var(--button-padding); }
|
||||||
body>div.carte div.item span.icon.next { float:right; line-height:22px; height:22px; }
|
body>div.carte div.item span.icon.next { float:right; line-height:22px; height:22px; }
|
||||||
body>div.carte.select.float>div.item { text-align:center; }
|
body>div.carte.select.float>div.item { text-align:center; }
|
||||||
body>div.input { padding:var(--plugin-padding); }
|
body>div.input { padding:var(--plugin-padding); z-index:100; }
|
||||||
body>div.input>legend { font-style:italic; width:100%; }
|
body>div.input>legend { font-style:italic; width:100%; }
|
||||||
body>div.input td { padding:var(--table-padding); }
|
body>div.input td { padding:var(--table-padding); }
|
||||||
body>div.input td:nth-child(2) { padding:var(--table-padding) 0; }
|
body>div.input td:nth-child(2) { padding:var(--table-padding) 0; }
|
||||||
@ -215,7 +215,7 @@ div.story[data-type=spark] { padding:0 var(--table-padding); border-left:var(--n
|
|||||||
fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
||||||
fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
||||||
fieldset>div.output>div.code { font-size:var(--code-font-size); }
|
fieldset>div.output>div.code { font-size:var(--code-font-size); }
|
||||||
fieldset>div.status { font-family:var(--status-font-family); font-style:italic; line-height:20px; max-height:var(--action-height); }
|
fieldset>div.status { font-family:var(--status-font-family); font-size:var(--status-font-size); font-style:italic; line-height:20px; max-height:var(--action-height); }
|
||||||
fieldset>div.status>div.item { padding:var(--input-padding); height:31px; }
|
fieldset>div.status>div.item { padding:var(--input-padding); height:31px; }
|
||||||
fieldset>div.status>div.item>label { font-size:var(--status-font-size); }
|
fieldset>div.status>div.item>label { font-size:var(--status-font-size); }
|
||||||
fieldset>div.status>div.item>span { margin-left:var(--input-padding); }
|
fieldset>div.status>div.item>span { margin-left:var(--input-padding); }
|
||||||
@ -253,7 +253,7 @@ div.item.text.limit>input { width:var(--button-width); }
|
|||||||
div.item.text.offend>input { width:var(--button-width); }
|
div.item.text.offend>input { width:var(--button-width); }
|
||||||
div.item.text.will>input { border:var(--box-notice); }
|
div.item.text.will>input { border:var(--box-notice); }
|
||||||
div.item.text>i:first-child { position:absolute; padding:7px; }
|
div.item.text>i:first-child { position:absolute; padding:7px; }
|
||||||
div.item.text>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
div.item.text>span.icon { font-size:var(--icon-font-size); padding:var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
||||||
div.item.text:hover>span.icon { visibility:visible; }
|
div.item.text:hover>span.icon { visibility:visible; }
|
||||||
div.item.button { position:relative; display:flex; align-items:center; height:var(--action-height); }
|
div.item.button { position:relative; display:flex; align-items:center; height:var(--action-height); }
|
||||||
div.item.button>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); }
|
div.item.button>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); }
|
||||||
@ -371,7 +371,8 @@ legend, form.option, form.option>div.item, div.action, div.action>div.item, div.
|
|||||||
fieldset.story, fieldset>div.output, fieldset>div.status, div.output>div.project div.item, div.content:not(.item), div.code, div.story[data-type=spark] { clear:both; }
|
fieldset.story, fieldset>div.output, fieldset>div.status, div.output>div.project div.item, div.content:not(.item), div.code, div.story[data-type=spark] { clear:both; }
|
||||||
fieldset.story { position:sticky; left:0; }
|
fieldset.story { position:sticky; left:0; }
|
||||||
fieldset.full { position:fixed; left:0; top:0; }
|
fieldset.full { position:fixed; left:0; top:0; }
|
||||||
fieldset.auto, fieldset.full, fieldset.float, div.float { position:fixed; z-index:10; box-shadow:var(--box-shadow); }
|
fieldset.auto, fieldset.full, fieldset.float { position:fixed; z-index:10; box-shadow:var(--box-shadow); }
|
||||||
|
div.float { position:fixed; z-index:100; box-shadow:var(--box-shadow); }
|
||||||
fieldset.plug { position:absolute; bottom:0; right:0; }
|
fieldset.plug { position:absolute; bottom:0; right:0; }
|
||||||
div.output { position:relative; }
|
div.output { position:relative; }
|
||||||
div.layout.flex>* { float:left; clear:none; }
|
div.layout.flex>* { float:left; clear:none; }
|
||||||
|
@ -146,14 +146,15 @@ Volcanos("misc", {
|
|||||||
}) }
|
}) }
|
||||||
return socket
|
return socket
|
||||||
},
|
},
|
||||||
|
ResourceFavicon(can) { return can.misc.Resource(can, nfs.SRC_TEMPLATE_WEB_FAVICON) },
|
||||||
Resource(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
Resource(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
||||||
return can.base.MergeURL(nfs.REQUIRE+path, ice.POD, space||can.Conf(web.SPACE))
|
return can.base.MergeURL(nfs.REQUIRE+path+_version, ice.POD, space||can.ConfSpace())
|
||||||
},
|
},
|
||||||
ShareLocal(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
ShareLocal(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
||||||
return can.base.MergeURL(nfs.SHARE_LOCAL+path, ice.POD, space||can.Conf(web.SPACE))
|
return can.base.MergeURL(nfs.SHARE_LOCAL+path+_version, ice.POD, space||can.ConfSpace())
|
||||||
},
|
},
|
||||||
ShareCache(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
ShareCache(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path }
|
||||||
return can.base.MergeURL(nfs.SHARE_CACHE+path, ice.POD, space||can.Conf(web.SPACE))
|
return can.base.MergeURL(nfs.SHARE_CACHE+path+_version, ice.POD, space||can.ConfSpace())
|
||||||
},
|
},
|
||||||
Template(can, path, file) { return can.base.Path(nfs.SRC_TEMPLATE, can.ConfIndex(), path, file) },
|
Template(can, path, file) { return can.base.Path(nfs.SRC_TEMPLATE, can.ConfIndex(), path, file) },
|
||||||
MergePath: function(can, file, path) { return file.indexOf(nfs.PS) == 0 || file.indexOf(ice.HTTP) == 0? file: can.base.Path(path, file) },
|
MergePath: function(can, file, path) { return file.indexOf(nfs.PS) == 0 || file.indexOf(ice.HTTP) == 0? file: can.base.Path(path, file) },
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
fieldset.Action { min-width:var(--project-width); }
|
fieldset.Action { min-width:var(--project-width); }
|
||||||
|
fieldset.Action>div.output { overflow-x:hidden; }
|
||||||
fieldset.Action>div.action { width:100%; display:none; background-color:var(--plugin-bg-color); }
|
fieldset.Action>div.action { width:100%; display:none; background-color:var(--plugin-bg-color); }
|
||||||
fieldset.Action>div.action div.item { font-style:italic; font-size:1.1rem; padding:10px 20px; }
|
fieldset.Action>div.action div.item { font-style:italic; font-size:1.1rem; padding:10px 20px; }
|
||||||
fieldset.Action.tabs>div.action { display:block; }
|
fieldset.Action.tabs>div.action { display:block; }
|
||||||
|
@ -3,7 +3,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
|||||||
},
|
},
|
||||||
_title: function(can, msg, target) {
|
_title: function(can, msg, target) {
|
||||||
can.core.List(can.base.getValid(can.Conf(chat.TITLE)||(can.user.isExtension? "contexts": location.host)||msg.result, [location.host]), function(item) {
|
can.core.List(can.base.getValid(can.Conf(chat.TITLE)||(can.user.isExtension? "contexts": location.host)||msg.result, [location.host]), function(item) {
|
||||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE]], list: [{img: "/volcanos/favicon.ico"}, {text: item}], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}])
|
can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE]], list: [{img: can.misc.ResourceFavicon(can)}, {text: item}], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
_state: function(can, msg, target) { can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) {
|
_state: function(can, msg, target) { can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) {
|
||||||
|
@ -48,9 +48,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.Conf("_auto", auto), can.Mode(mode), can.ConfHeight(height), can.ConfWidth(width), height -= can.onexport.actionHeight(can)+can.onexport.statusHeight(can)
|
can.Conf("_auto", auto), can.Mode(mode), can.ConfHeight(height), can.ConfWidth(width), height -= can.onexport.actionHeight(can)+can.onexport.statusHeight(can)
|
||||||
auto || auto == undefined? (can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height, html.MAX_WIDTH, width), can.page.style(can, can._target, html.HEIGHT, "", html.WIDTH, "")):
|
auto || auto == undefined? (can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height, html.MAX_WIDTH, width), can.page.style(can, can._target, html.HEIGHT, "", html.WIDTH, "")):
|
||||||
(can.page.style(can, can._output, html.HEIGHT, height, html.WIDTH, width, html.MAX_HEIGHT, "", html.MAX_WIDTH, ""), can.page.style(can, can._target, html.WIDTH, width))
|
(can.page.style(can, can._output, html.HEIGHT, height, html.WIDTH, width, html.MAX_HEIGHT, "", html.MAX_WIDTH, ""), can.page.style(can, can._target, html.WIDTH, width))
|
||||||
var sub = can.sub; if (!sub) { return auto } sub.Mode(mode), sub.ConfHeight(height), sub.ConfWidth(width)
|
if (can.misc.Search(can, log.DEBUG) == ice.TRUE) { can.Status(html.HEIGHT, can.base.Max(height, can._output.offsetHeight), html.WIDTH, width) }
|
||||||
can.onimport._size(can)
|
var sub = can.sub; if (!sub) { return auto } sub.Mode(mode), sub.ConfHeight(height), sub.ConfWidth(width), can.onimport._size(can)
|
||||||
mode? sub.onlayout[mode](sub, height, width): sub.onlayout._init(sub, height, width); return auto
|
mode? sub.onlayout[mode](sub, height, width): sub.onlayout._init(sub, height, width)
|
||||||
|
return auto
|
||||||
},
|
},
|
||||||
display_size: function(can, sub) { var border = 1
|
display_size: function(can, sub) { var border = 1
|
||||||
can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
||||||
@ -204,7 +205,7 @@ Volcanos(chat.ONEXPORT, {
|
|||||||
outputHeight: function(can) { var height = can.sub.ConfHeight() - can.onexport.outputMargin(can)
|
outputHeight: function(can) { var height = can.sub.ConfHeight() - can.onexport.outputMargin(can)
|
||||||
if (can.user.isMobile) { return can.ConfHeight() - can.onexport.actionHeight(can) - can.onexport.statusHeight(can) }
|
if (can.user.isMobile) { return can.ConfHeight() - can.onexport.actionHeight(can) - can.onexport.statusHeight(can) }
|
||||||
can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
|
can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
|
||||||
return can.base.Min(height, can.sub.ConfHeight()/2)
|
return can.base.Max(can.base.Min(height, can.sub.ConfHeight()/2), can.ConfHeight()-html.ACTION_HEIGHT, 320)
|
||||||
},
|
},
|
||||||
outputMargin: function(can) { return 0 },
|
outputMargin: function(can) { return 0 },
|
||||||
statusHeight: function(can) { return can.page.ClassList.has(can, can._target, html.OUTPUT) || !can.page.isDisplay(can._status) || can._status.innerHTML == "" || (can._target.offsetHeight > 0 && can._status.offsetHeight == 0)? 0: html.STATUS_HEIGHT },
|
statusHeight: function(can) { return can.page.ClassList.has(can, can._target, html.OUTPUT) || !can.page.isDisplay(can._status) || can._status.innerHTML == "" || (can._target.offsetHeight > 0 && can._status.offsetHeight == 0)? 0: html.STATUS_HEIGHT },
|
||||||
|
@ -221,7 +221,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONLAYOUT, {
|
Volcanos(chat.ONLAYOUT, {
|
||||||
_init: function(can, height, width) { can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width}) },
|
_init: function(can, height, width) {
|
||||||
|
can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width})
|
||||||
|
},
|
||||||
zone: function(can, height, width) { can.onlayout._init(can, height, width) },
|
zone: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
result: function(can, height, width) { can.onlayout._init(can, height, width) },
|
result: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
simple: function(can, height, width) { can.onlayout._init(can, height, width) },
|
simple: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user