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-04-28 23:26:42 +08:00
parent 8a85e91e35
commit df13edfa46
9 changed files with 35 additions and 34 deletions

View File

@ -31,6 +31,7 @@ var ice = {
MSG_SOURCE: "_source", MSG_TARGET: "_target", MSG_SOURCE: "_source", MSG_TARGET: "_target",
MSG_ACTION: "_action", MSG_STATUS: "_status", MSG_ACTION: "_action", MSG_STATUS: "_status",
MSG_PROCESS: "_process", MSG_DISPLAY: "_display", MSG_TOOLKIT: "_toolkit", MSG_PROCESS: "_process", MSG_DISPLAY: "_display", MSG_TOOLKIT: "_toolkit",
MSG_DISPLAY_CSS: "_display_css",
MSG_USERWEB: "user.web", MSG_USERPOD: "user.pod", MSG_USERWEB: "user.web", MSG_USERPOD: "user.pod",
MSG_USERROLE: "user.role", MSG_USERNAME: "user.name", MSG_USERNICK: "user.nick", MSG_LANGUAGE: "user.lang", MSG_USERROLE: "user.role", MSG_USERNAME: "user.name", MSG_USERNICK: "user.nick", MSG_LANGUAGE: "user.lang",

View File

@ -311,7 +311,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
Volcanos(display, {_root: can._root, _follow: can.core.Keys(can._follow, display), _fields: can._target, _target: output, _path: display||chat.PLUGIN_TABLE_JS, Volcanos(display, {_root: can._root, _follow: can.core.Keys(can._follow, display), _fields: can._target, _target: output, _path: display||chat.PLUGIN_TABLE_JS,
_legend: can._legend, _option: can._option, _action: action||can._action, _output: output, _status: status||can._status, _legend: can._legend, _option: can._option, _action: action||can._action, _output: output, _status: status||can._status,
Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status, db: {}, ui: {layout: function() {}}, Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status, db: {}, ui: {layout: function() {}},
}, [display, chat.PLUGIN_TABLE_JS], function(sub) { sub.Conf(can.Conf()) }, [display, msg.Option(ice.MSG_DISPLAY_CSS), chat.PLUGIN_TABLE_JS], function(sub) { sub.Conf(can.Conf())
sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): [] sub.db.hash = can.isCmdMode()? can.misc.SearchHash(can): []
var last = can.sub; last && can.core.CallFunc([last, "onaction.hidden"], {can: last}) var last = can.sub; last && can.core.CallFunc([last, "onaction.hidden"], {can: last})
sub.run = function(event, cmds, cb, silent) { var msg = sub.request(event)._caller() sub.run = function(event, cmds, cb, silent) { var msg = sub.request(event)._caller()
@ -323,7 +323,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) }) can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) })
} }
can.page.ClassList.del(can, sub._fields, html.FORM), delete(can._status._cache), delete(can._status._cache_key) can.page.ClassList.del(can, sub._fields, html.FORM), delete(can._status._cache), delete(can._status._cache_key)
sub._output.className = html.OUTPUT, can.onappend.style(can, sub._args.style, can._output) sub._output.className = html.OUTPUT
// can.onappend.style(can, sub._args.style, can._output)
// can.isCmdMode() && can.onappend.style(can, html.OUTPUT) // can.isCmdMode() && can.onappend.style(can, html.OUTPUT)
sub.isCmdMode() && sub.onexport.title(sub, sub.ConfIndex()) sub.isCmdMode() && sub.onexport.title(sub, sub.ConfIndex())
can.onmotion.toggle(can, can._action, true) can.onmotion.toggle(can, can._action, true)

View File

@ -37,7 +37,7 @@ body {
--hover-bg-color:#5066b961; --hover-fg-color:var(--notice-fg-color); --hover-bg-color:#5066b961; --hover-fg-color:var(--notice-fg-color);
--body-font-family:sans-serif; --code-font-family:monospace; --body-font-family:sans-serif; --code-font-family:monospace;
--project-width:230px; --river-width:var(--project-width); --project-width:230px; --river-width:var(--project-width);
--float-height:480px; --float-width:1200px; --desktop-icon-size:80px; --float-height:640px; --float-width:1200px; --desktop-icon-size:80px;
} }
body { body {
--body-bg-color:var(--panel-bg-color); --body-fg-color:var(--plugin-fg-color); --body-bg-color:var(--panel-bg-color); --body-fg-color:var(--plugin-fg-color);
@ -105,9 +105,8 @@ body.width4 { /* 1280-1600 笔记本 显示器调试 */
} }
body.width5 { /* 1600-1920 */ body.width5 { /* 1600-1920 */
} }
body.width6 { /* 1920-2240 显示器 */ body.width6 { /* 1920-2240 显示器 */
--project-width:280px; --river-width:280px; --input-width:180px; --url-input-width:1000px; --qrcode-width:420px; --card-height:160px; --project-width:280px; --river-width:280px; --input-width:180px; --url-input-width:1000px; --qrcode-width:420px; --card-height:160px;
--float-height:640px; --float-width:1400px;
--plug-height:480px; --plug-width:1000px; --plug-height:480px; --plug-width:1000px;
} }
/* element */ /* element */
@ -194,6 +193,9 @@ 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.select {
border-right:var(--box-notice3);
}
div.project div.item:not(.hide) { div.project div.item:not(.hide) {
// white-space:pre; // white-space:pre;
line-height:24px; line-height:24px;
@ -655,7 +657,7 @@ body.windows div.item.button.refresh>span.icon { font-size:22px; line-height:30p
div.item.button._space.icons { flex-grow:1; min-width:var(--button-margin); } div.item.button._space.icons { flex-grow:1; min-width:var(--button-margin); }
div.item.button._space.icons:hover { background-color:unset; cursor:unset; } div.item.button._space.icons:hover { background-color:unset; cursor:unset; }
fieldset.inner fieldset.story div.item.button._space.icons { margin-left:0; flex-grow:1; } fieldset.inner fieldset.story div.item.button._space.icons { margin-left:0; flex-grow:1; }
div.tabs>span { font-style:italic; } div.tabs>span { font-style:italic; white-space:pre; }
div.tabs>span.icon { font-size:var(--icon-font-size); font-style:normal; padding-left:var(--input-padding); visibility:hidden; } div.tabs>span.icon { font-size:var(--icon-font-size); font-style:normal; padding-left:var(--input-padding); visibility:hidden; }
div.tabs.select>span.icon { visibility:visible; } div.tabs.select>span.icon { visibility:visible; }
div.tabs:hover>span.icon { visibility:visible; } div.tabs:hover>span.icon { visibility:visible; }

View File

@ -25,6 +25,10 @@ Volcanos("misc", {
StatusTimeCount: function(obj) { msg.append && msg.Status(can.base.Copy(kit.Dict(mdb.TIME, can.base.Time(), mdb.COUNT, msg.Length()+"x"+msg.append.length), obj)) }, StatusTimeCount: function(obj) { msg.append && msg.Status(can.base.Copy(kit.Dict(mdb.TIME, can.base.Time(), mdb.COUNT, msg.Length()+"x"+msg.append.length), obj)) },
Status: function(obj) { return msg.Option(ice.MSG_STATUS, JSON.stringify(can.core.Item(obj, function(key, value) { return {name: key, value: value} }))) }, Status: function(obj) { return msg.Option(ice.MSG_STATUS, JSON.stringify(can.core.Item(obj, function(key, value) { return {name: key, value: value} }))) },
OptionDefault(key, val) { var arg = arguments; for (var i = 0; i < arg.length; i += 2) { msg.Option(arg[i]) || msg.Option(arg[i], arg[i+1]) } return msg.Option(key) }, OptionDefault(key, val) { var arg = arguments; for (var i = 0; i < arg.length; i += 2) { msg.Option(arg[i]) || msg.Option(arg[i], arg[i+1]) } return msg.Option(key) },
OptionSimple(key) { var arg = arguments, res = []
for (var i = 0; i < arg.length; i++) { res.push(arg[i], msg.Option(arg[i])) }
return res
},
Option: function(key, val) { if (key == undefined) { return msg.option || [] } Option: function(key, val) { if (key == undefined) { return msg.option || [] }
if (can.base.isObject(key)) { return can.core.Item(key, msg.Option) } if (can.base.isObject(key)) { return can.core.Item(key, msg.Option) }
if (val == undefined) { return can.base.isIn(key, msg.option) && msg[key] && msg[key][0] || "" } if (val == undefined) { return can.base.isIn(key, msg.option) && msg[key] && msg[key][0] || "" }

View File

@ -7,7 +7,7 @@ fieldset.Footer>div.output div.state label { font-size:var(--status-font-size);
fieldset.Footer>div.output div.title:first-child { margin-left:var(--header-height); } fieldset.Footer>div.output div.title:first-child { margin-left:var(--header-height); }
fieldset.Footer>div.output div.toast { font-family:var(--status-font-family); line-height:18px; max-width:var(--url-input-width); overflow:auto; float:right; } fieldset.Footer>div.output div.toast { font-family:var(--status-font-family); line-height:18px; max-width:var(--url-input-width); overflow:auto; float:right; }
fieldset.Footer>div.output div.cmd { padding:0; margin-left:20px; } fieldset.Footer>div.output div.cmd { padding:0; margin-left:20px; }
fieldset.Footer>div.output input[type=button] { background-color:transparent; border:0; } fieldset.Footer>div.output input[type=button] { background-color:transparent; color:var(--panel-fg-color); border:0; }
fieldset.Footer>div.output div.cmd>input[name=cmd] { padding-left:30px; } fieldset.Footer>div.output div.cmd>input[name=cmd] { padding-left:30px; }
fieldset.Footer>div.output div.menu>div.River { display:flex; justify-content:space-around; } fieldset.Footer>div.output div.menu>div.River { display:flex; justify-content:space-around; }
fieldset.Footer>div.output div.menu>div.River>div.item { height:var(--footer-height); display:flex; flex-direction:column; text-align:center; flex-grow:1; } fieldset.Footer>div.output div.menu>div.River>div.item { height:var(--footer-height); display:flex; flex-direction:column; text-align:center; flex-grow:1; }

View File

@ -95,8 +95,10 @@ tr.line>td.line { text-align:right; line-height:var(--code-line-height); padding
tr.line>td.text { white-space:pre; line-height:var(--code-line-height); padding-left:var(--input-padding); width:100%; } tr.line>td.text { white-space:pre; line-height:var(--code-line-height); padding-left:var(--input-padding); width:100%; }
tr.line:hover { background-color:var(--hover-bg-color); } tr.line:hover { background-color:var(--hover-bg-color); }
tr.line.insert { background-color:#283e2d; } tr.line.delete { background-color:#3c2626; } tr.line.insert { background-color:#283e2d; } tr.line.delete { background-color:#3c2626; }
body.light tr.line.insert { background-color:#ffeef0; } body.light tr.line.delete { background-color:#e6ffed; } body.light tr.line.delete { background-color:#ffeef0; }
body.white tr.line.insert { background-color:#ffeef0; } body.white tr.line.delete { background-color:#e6ffed; } body.light tr.line.insert { background-color:#e6ffed; }
body.white tr.line.insert { background-color:#ffeef0; }
body.white tr.line.delete { background-color:#e6ffed; }
fieldset.inner:not(.monaco)>div.output div.content>tr.line * { font-family:var(--code-font-family); font-size:var(--code-font-size); } fieldset.inner:not(.monaco)>div.output div.content>tr.line * { font-family:var(--code-font-family); font-size:var(--code-font-size); }
body:not(.windows) fieldset.inner>div.output>div.project * { font-family:var(--code-font-family); font-size:var(--code-font-size); } body:not(.windows) fieldset.inner>div.output>div.project * { font-family:var(--code-font-family); font-size:var(--code-font-size); }
body:not(.windows) fieldset.inner>div.output>div.layout>div.tabs { font-family:var(--code-font-family); font-size:var(--code-font-size); } body:not(.windows) fieldset.inner>div.output>div.layout>div.tabs { font-family:var(--code-font-family); font-size:var(--code-font-size); }

View File

@ -64,14 +64,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDI
}, },
field: function(can, meta, target) { var item = can.base.Obj(meta.meta), padding = can.Conf(html.PADDING) field: function(can, meta, target) { var item = can.base.Obj(meta.meta), padding = can.Conf(html.PADDING)
if (!item.width || parseInt(item.width) > can.ConfWidth()) { item.width = can.ConfWidth()-2*padding } var width = item.width if (!item.width || parseInt(item.width) > can.ConfWidth()) { item.width = can.ConfWidth()-2*padding } var width = item.width
can.core.Item(item, function(key, value) { can.core.Item(item, function(key, value) { if (can.base.beginWith(key, "meta.")) { can.core.Value(item, key, value), delete(item[key]) } })
if (can.base.beginWith(key, "meta.") && key != ctx.INDEX) {
can.core.Value(item, key, value)
delete(item[key])
}
})
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
sub.onimport.size(sub, can.base.Max(html.STORY_HEIGHT, can.ConfHeight()), sub.Conf("_width", width), true) sub.onimport.size(sub, can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-2*html.ACTION_HEIGHT-2*padding), sub.Conf("_width", width), true)
var size = sub.onimport.size; sub.onimport.size = function(can, height, width, auto, mode) { size(can, height, width, auto, mode), can.page.style(can, sub._output, html.MAX_HEIGHT, "", "overflow-y", "hidden") } var size = sub.onimport.size; sub.onimport.size = function(can, height, width, auto, mode) { size(can, height, width, auto, mode), can.page.style(can, sub._output, html.MAX_HEIGHT, "", "overflow-y", "hidden") }
can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) }) can.core.Value(item, "auto.cmd") && can.onmotion.delay(function() { sub.runAction(sub.request({}, can.core.Value(item, "opts")), can.core.Value(item, "auto.cmd")) })
can.page.style(can, sub._target, html.WIDTH, width) can.page.style(can, sub._target, html.WIDTH, width)

View File

@ -14,31 +14,26 @@ Volcanos(chat.ONIMPORT, {
_cookie: function(can, msg) { can.misc.Cookie(can, msg._arg[0], msg._arg[1]), can.Update() }, _cookie: function(can, msg) { can.misc.Cookie(can, msg._arg[0], msg._arg[1]), can.Update() },
_session: function(can, msg) { can.misc.sessionStorage(can, msg._arg[0], msg._arg[1]), can.Update() }, _session: function(can, msg) { can.misc.sessionStorage(can, msg._arg[0], msg._arg[1]), can.Update() },
_field: function(can, msg, cb) { _field: function(can, msg, cb) {
var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-can.onexport.actionHeight(can)-can.onexport.statusHeight(can)), width = can.ConfWidth() var height = can.ConfHeight()-can.onexport.actionHeight(can)-can.onexport.statusHeight(can), width = can.ConfWidth()
var tabs = false, tabHash = msg.Option("field.tabs") var tabs = false, tabHash = msg.Option("field.tabs")
if (tabHash) { height = can.ConfHeight()-can.onexport.actionHeight(can)-can.onexport.statusHeight(can) if (tabHash) {
can.sub && can.sub.onimport.tabs(can, [{name: tabHash.slice(0, 6)}], function() { can.sub && can.sub.onimport.tabs(can, [{name: tabHash.slice(0, 6)}], function() {
can.onmotion.cache(can, function() { return tabHash }) can.onmotion.cache(can, function() { return tabHash })
}), tabs = true }), tabs = true
} else {
height = can.base.Max(html.STORY_HEIGHT, height)
} }
// height -= 4, width -= 4 msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash })
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
// if (can.page.tagis(can._target, html.FIELDSET_STORY) || can._msg && can._msg.IsDetail()) { item.style = item.style||html.FLOAT }
tabs && can.onmotion.cache(can, function() { return tabHash })
can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) {
can._plugins = (can._plugins||[]).concat([sub])
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX); can.run(can.request(event, {pod: item.space}), (msg[ice.MSG_PREFIX]? msg[ice.MSG_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) } sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX); can.run(can.request(event, {pod: item.space}), (msg[ice.MSG_PREFIX]? msg[ice.MSG_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) }
if (item.style != html.FLOAT && can.base.isIn(sub.ConfIndex(), wiki.PORTAL, chat.IFRAME, chat.DESKTOP, wiki.WORD, code.VIMER,)) { height = can.base.Max(can.onexport.outputHeight(can), can.ConfHeight(), 480) }
can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub) can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub)
if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300) if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)
sub.onexport.output = function() { sub.onexport.output = function() { if (tabs) {
if (tabs) { msg.Option(ice.MSG_ACTION) && can.onappend._action(can, msg.Option(ice.MSG_ACTION)) msg.Option(ice.MSG_ACTION) && can.onappend._action(can, msg.Option(ice.MSG_ACTION))
sub.sub.onimport.tabs(can, [{name: tabHash.slice(0, 6)}], function() { sub.sub.onimport.tabs(can, [{name: tabHash.slice(0, 6)}], function() {
tabs || can.onmotion.cache(can, function() { return tabHash }) tabs || can.onmotion.cache(can, function() { return tabHash })
}), tabs = false }), tabs = false
} } }
}
if (can.base.isIn(sub.ConfIndex(), wiki.WORD)) { sub.onexport.output = function() { can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, "") } }
}, item.style == html.FLOAT && can.page.tagis(can._target, "fieldset.story")? document.body: can._output) }, item.style == html.FLOAT && can.page.tagis(can._target, "fieldset.story")? document.body: can._output)
}) })
}, },

View File

@ -30,7 +30,8 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {},
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] = nfs.P+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()
var name = (libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? libs[0]: libs[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 = "/v"+name } if (name.indexOf("/lib/") == 0) { name = "/v"+name }
if (name.indexOf("/panel/") == 0) { name = "/v"+name } if (name.indexOf("/panel/") == 0) { name = "/v"+name }