mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
6eebf8f8e0
commit
f9ca819136
4
const.js
4
const.js
@ -77,7 +77,7 @@ var mdb = {
|
||||
QS: ice.QS, AT: ice.AT,
|
||||
EQ: ice.EQ, FS: ice.FS,
|
||||
}
|
||||
var web = {CHAT: "chat",
|
||||
var web = {CHAT: "chat", STUDIO: "studio",
|
||||
DREAM: "dream", SPACE: "space", ROUTE: "route", SPIDE: "spide", COUNT: "count", SHARE: "share",
|
||||
WEBSITE: "website", DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", INPUT: "input",
|
||||
CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage",
|
||||
@ -134,6 +134,8 @@ var gdb = {
|
||||
}
|
||||
var tcp = {
|
||||
HOST: "host", PORT: "port",
|
||||
SERVER: "server",
|
||||
CLIENT: "client",
|
||||
}
|
||||
var nfs = {
|
||||
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
|
||||
|
43
frame.js
43
frame.js
@ -38,11 +38,13 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
|
||||
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
|
||||
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { if (msg._can && msg._can._toast) { return } toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
|
||||
msg.OptionDefault(ice.MSG_THEME, can.getHeader(chat.THEME), ice.MSG_LANGUAGE, can.user.info.language, ice.MSG_HEIGHT, panel.Conf(html.HEIGHT)||panel._target.offsetHeight+"", ice.MSG_WIDTH, panel.Conf(html.WIDTH)||panel.offsetWidth+"")
|
||||
msg.Option(ice.MSG_HEIGHT, msg.Option(ice.MSG_HEIGHT)+""), msg.Option(ice.MSG_WIDTH, msg.Option(ice.MSG_WIDTH)+"")
|
||||
if (can.base.isUndefined(msg[ice.MSG_DAEMON])) { var sub = msg._can; can.base.isUndefined(sub._daemon) && can.ondaemon._list[0] && (sub._daemon = can.ondaemon._list.push(sub)-1)
|
||||
msg.OptionDefault(ice.MSG_THEME, can.getHeader(chat.THEME))
|
||||
|
||||
var sub = msg._can;
|
||||
if (can.base.isUndefined(msg[ice.MSG_DAEMON])) { can.base.isUndefined(sub._daemon) && can.ondaemon._list[0] && (sub._daemon = can.ondaemon._list.push(sub)-1)
|
||||
if (sub._daemon) { msg.Option(ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], sub._daemon)) }
|
||||
} if (!can.misc.CookieSessid(can) && can.user.info.sessid) { msg.Option(ice.MSG_SESSID, can.user.info.sessid) }
|
||||
can.base.isIn(sub.ConfIndex(), "qrcode", "cli.qrcode") && can.page.exportValue(sub, msg)
|
||||
can.onengine.signal(panel, chat.ONREMOTE, can.request({}, {_follow: panel._follow, _msg: msg, _cmds: cmds}))
|
||||
var names = msg.Option(chat._NAMES)||panel._names||((can.Conf("iceberg")||Volcanos.meta.iceberg)+"/chat/"+panel._name)
|
||||
can.misc.Run(event, can, {names: names, daemon: msg[ice.MSG_DAEMON]}, cmds, function(msg) { toast && toast.close(), toast = true
|
||||
@ -135,7 +137,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
Option: function(key, value) { return can.page.SelectArgs(can, option, key, value)[0] },
|
||||
Update: function(event, cmds, cb, silent) { sub.request(event)._caller(), sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input([], !silent), cb, silent); return true },
|
||||
Focus: function() { can.page.SelectOne(can, option, html.INPUT_ARGS, function(target) { target.focus() }) },
|
||||
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds = can.base.trim(cmds)
|
||||
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
||||
return !save || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds), cmds
|
||||
},
|
||||
Clone: function() { meta.args = can.page.SelectArgs(can), can.onappend._init(can, meta, list, function(sub) { can.base.isFunc(cb) && cb(sub, true), can.onmotion.delay(can, sub.Focus) }, target) },
|
||||
@ -268,7 +270,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
},
|
||||
|
||||
field: function(can, type, item, target) { type = type||html.STORY, item = item||{}
|
||||
var name = can.core.Split(item.nick||item.name||"").pop()||""; can.base.isIn(name, "server", "client", "studio") && (name = (item.index||"").split(".").slice(-2).join(".")), name = can.core.Keys(item.space, name)
|
||||
var name = can.core.Split(item.nick||item.name||"").pop()||""; can.base.isIn(name, tcp.SERVER, tcp.CLIENT, web.STUDIO) && (name = (item.index||"").split(".").slice(-2).join(".")), name = can.core.Keys(item.space, name)
|
||||
var title = item.help && item.help != name && !can.user.isEnglish(can)? name+"("+can.core.Split(item.help)[0]+")": name
|
||||
target = can.base.isFunc(target)? target(): target
|
||||
return can.page.Append(can, target||can._output, [{view: [type, html.FIELDSET], list: [{type: html.LEGEND, list: [item.icon && {icon: item.icon}, {text: title}]}, {view: [html.OPTION, html.FORM]}, html.ACTION, html.OUTPUT, html.STATUS]}])
|
||||
@ -284,13 +286,37 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(event.target.value) == -1)) { return tr }
|
||||
}).length+" lines") } }, icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", input.onkeyup({target: event.target.previousSibling}) }})
|
||||
} if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) { target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name]) }) } }
|
||||
|
||||
var _style = can.page.buttonStyle(can, item.name)
|
||||
var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name], _style)], list: [item.icon && {icon: item.icon}, input].concat(icon), _init: function(target, _input) {
|
||||
if (item.type == html.SELECT) { _input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item) }
|
||||
if (item.type == html.SELECT) {
|
||||
_input.select.value = value||_item.value||_item.values[0], can.onappend.select(can, _input.select, _item)
|
||||
can.onappend.style(can, html.BUTTON, target)
|
||||
}
|
||||
item.style && can.onappend.style(can, item.style, target)
|
||||
}}])[item.name]; return _input
|
||||
},
|
||||
mores: function(can, target, value, limit) {
|
||||
var list = can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||
target.name == target.value && (target.value = can.user.trans(can, target.value))
|
||||
var _style = can.page.buttonStyle(can, target.name); _style && can.onappend.style(can, _style, target)
|
||||
can.user.trans(can, kit.Dict(target.name, target.value))
|
||||
return {type: html.BUTTON, name: target.name, value: target.value, style: _style}
|
||||
})
|
||||
if (list.length <= limit) {
|
||||
target.onclick = function(event) { can.run(can.request(event, value), [ctx.ACTION, event.target.name]) }
|
||||
} else {
|
||||
can.page.Appends(can, target, can.core.List(list.slice(0, limit-1), function(item) {
|
||||
return {type: html.INPUT, data: {type: html.BUTTON}, name: item.name, value: item.value, className: item.style, onclick: function(event) {
|
||||
can.run(can.request(event, value), [ctx.ACTION, item.name])
|
||||
}}
|
||||
}))
|
||||
can.page.Append(can, target, [{type: html.INPUT, data: {type: html.BUTTON}, name: "more", value: can.user.trans(can, "more"), onclick: function(event) {
|
||||
can.user.carte(event, can, {}, can.core.List(list.slice(limit-1), function(item) { return item.name }), function(event, button) {
|
||||
can.run(can.request(event, value), [ctx.ACTION, button])
|
||||
})
|
||||
}}])
|
||||
}
|
||||
},
|
||||
select: function(can, select, item) {
|
||||
return can.page.Append(can, select.parentNode, [{type: html.INPUT, data: {className: html.SELECT, type: html.BUTTON, name: item.name, value: can.user.trans(can, item.value||item.values[0]), title: item.name}, onclick: function(event) { var target = event.target
|
||||
var carte = can.user.carte(event, can, {}, item.values, function(event, button) { carte.close(); if (target.value == button) { return }
|
||||
@ -312,10 +338,11 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
item.run = function(event, cmds, cb) { can.run(can.request(event, data, can.Option()), cmds, cb, true) }
|
||||
item._enter = function(event, value) { if (event.ctrlKey) { run(event, mdb.MODIFY, [key, value]) } }
|
||||
can.onmotion.modifys(can, event.target, function(event, value, old) { run(event, mdb.MODIFY, [key, value]) }, item)
|
||||
}, _init: function(target) {
|
||||
key == ctx.ACTION && can.onappend.mores(can, target, data, can.user.isMobile && !can.user.isLandscape()? 2: can.isCmdMode()? 5: 3)
|
||||
}}
|
||||
}); table && can.onappend.style(can, chat.CONTENT, table), msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.onappend.style(can, ctx.ACTION, table)
|
||||
;(can.isCmdMode() || table.offsetWidth > can.ConfWidth() / 2) && can.onappend.style(can, "full", table)
|
||||
can.page.Select(can, table, html.INPUT_BUTTON, function(target) { target.name == target.value && (target.value = can.user.trans(can, target.value)) })
|
||||
return keys && can.page.RangeTable(can, table, can.core.List(keys, function(key) { return can.page.Select(can, table, html.TH, function(th, index) { if (th.innerHTML == key) { return index } })[0] })), table
|
||||
},
|
||||
board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return }
|
||||
|
50
index.css
50
index.css
@ -17,11 +17,11 @@ body {
|
||||
--panel-bg-color:var(--panel-output-bg-color);
|
||||
--panel-fg-color:var(--panel-output-fg-color);
|
||||
--panel-output-fg-color: var(--body-fg-color);
|
||||
--panel-output-bg-color:var(--input-bg-color);
|
||||
--panel-hover-bg-color:var(--hover-bg-color);
|
||||
--panel-hover-fg-color:var(--hover-fg-color);
|
||||
--plugin-border-color:var(--box-border); --plugin-radius:10px;
|
||||
--plugin-bg-color:var(--legend-bg-color);
|
||||
--panel-output-bg-color:var(--input-bg-color);
|
||||
--plugin-fg-color:var(--body-fg-color);
|
||||
--th-bg-color:var(--plugin-bg-color);
|
||||
--td-hover-bg-color:var(--hover-bg-color);
|
||||
@ -30,15 +30,14 @@ body {
|
||||
--float-fg-color:var(--plugin-fg-color);
|
||||
--carte-bg-color:var(--plugin-bg-color);
|
||||
|
||||
--desktop-icon-size:80px;
|
||||
--code-font-size:14px; --code-font-family:monospace;
|
||||
--code-bg-color:black; --code-fg-color:silver; --code-border-color:var(--notice-bg-color);
|
||||
--code-comment:green; --code-keyword:royalblue; --code-package:blue;
|
||||
--code-datatype:lavender; --code-function:lightgreen;
|
||||
--code-constant:gray; --code-string:orange; --code-object:silver;
|
||||
--svg-stroke-width:1;
|
||||
--svg-stroke-width:1; --desktop-icon-size:80px;
|
||||
}
|
||||
body.windows { --code-font-family:courier new; }
|
||||
body.windows { --code-font-family:"Courier New"; }
|
||||
/* element */
|
||||
* { tab-size:4; box-sizing:border-box; padding:0; border:0; margin:0; }
|
||||
legend { padding:0 20px; }
|
||||
@ -62,7 +61,6 @@ table.content.action th:last-child { position:sticky; right:2px; box-shadow: var
|
||||
table.content.action td:last-child { position:sticky; right:2px; box-shadow: var(--box-shadow); }
|
||||
table.content.action td:last-child input { margin-right:10px; box-shadow:var(--box-shadow); }
|
||||
table.content col.time { width:180px; }
|
||||
table.content col.action { width:180px; }
|
||||
table.content:hover col.option { background-color:var(--hover-bg-color); }
|
||||
fieldset.panel.Action.tabs table.content { width:100%; }
|
||||
h1 { text-align:center; margin:20px 0; } h2 { margin:20px 0; } h3 { margin:20px 0; }
|
||||
@ -77,18 +75,20 @@ iframe { height:420px; width:100%; }
|
||||
fieldset>legend { margin-right:10px; box-shadow:var(--box-shadow); }
|
||||
fieldset>form.option>div.item:not(.icon) { margin-right:10px; box-shadow:var(--box-shadow); }
|
||||
fieldset>form.option>div.item.text.cmd { color:var(--code-fg-color); width:100%; }
|
||||
fieldset>form.option>div.item.textarea { width:100%; }
|
||||
fieldset>form.option>div.item.textarea { width:100%; height:96px; }
|
||||
fieldset>form.option>div.item.select { border-radius:5px; }
|
||||
fieldset>form.option>div.item.select>input { min-width:80px; }
|
||||
fieldset>form.option>div.item.button { border-radius:5px; }
|
||||
fieldset>div.action>div.item { margin-right:10px; box-shadow:var(--box-shadow); }
|
||||
fieldset>div.action>div.item.select { border-radius:5px; }
|
||||
fieldset>div.action>div.item.select:not(.cmds) { border-radius:5px; }
|
||||
fieldset>div.action>div.item.cmds.select { border-bottom:var(--notice-bg-color) solid 2px; height:32px; }
|
||||
fieldset>div.action>div.item.button { border-radius:5px; }
|
||||
fieldset>div.output { width:100%; }
|
||||
fieldset>div.status { width:100%; }
|
||||
fieldset.input>legend { display:none; }
|
||||
fieldset.input.key div.action { display:none; }
|
||||
fieldset.input.key div.output table.content { width:100%; }
|
||||
fieldset.input.key div.status { background-color:var(--plugin-bg-color); }
|
||||
fieldset.input.key div.status:not(.hide) { display:block; position:sticky; bottom:0; }
|
||||
fieldset.input.key.simple th { display:none; }
|
||||
fieldset.input.key.simple td { min-width:40px; }
|
||||
@ -129,6 +129,7 @@ body>div.input div.action { width:100%; }
|
||||
body>div.input div.action>div.item { margin:5px; float:right; }
|
||||
body>div.input div.action>div.item>input[type=button] { width:110px; }
|
||||
body>div.input.login>div.output { text-align:center; }
|
||||
body>div.input.simple td:first-child { display:none; }
|
||||
body>div.upload div.action input[type=file] { width:320px; }
|
||||
body>div.upload div.output { border:var(--box-notice); }
|
||||
body>div.upload div.output div.progress { background-color:var(--progress-bg-color); height:10px; width:0; }
|
||||
@ -139,10 +140,11 @@ body>div.upload div.status div.size { text-align:center; }
|
||||
body { font-size:16px; }
|
||||
legend { font-size:1.2rem; line-height:30px; height:32px; }
|
||||
select, input { font-size:1rem; height:32px; } input::placeholder, textarea::placeholder { font-style:italic; }
|
||||
textarea { font-size:1rem; tab-size:2; padding:5px; height:96px; width:100%; resize:vertical; }
|
||||
textarea { font-size:1rem; tab-size:2; padding:5px; height:96px; width:100%; resize:vertical; outline:none; }
|
||||
table.content, div.code, div.story[data-type=spark] { white-space:pre; margin:0; }
|
||||
div.story[data-type=spark] { padding:0 5px; border-left:var(--notice-bg-color) solid 5px; }
|
||||
fieldset>div.action>div.tabs { font-style:italic; padding-left:10px; box-shadow:var(--box-shadow); margin-left:5px; }
|
||||
fieldset>div.action>div.tabs { font-style:italic; padding:5px 10px; box-shadow:var(--box-shadow); margin-left:5px; }
|
||||
fieldset>div.action>div.cmds { font-style:italic; padding:5px 10px; box-shadow:var(--box-shadow); margin-left:5px; }
|
||||
fieldset>div.output>div.code { font-size:14px; }
|
||||
fieldset>div.status { font-style:italic; max-height:32px; }
|
||||
fieldset>div.status>div.item { padding:5px; height:31px; }
|
||||
@ -247,12 +249,14 @@ div.profile:not(.toggle) { border-left:var(--box-border); width:50%; }
|
||||
div.display:not(.toggle) { border-top:var(--box-border); }
|
||||
/* table card */
|
||||
div.output.card>div.item.stop { color:var(--disable-fg-color); }
|
||||
div.output.card>div.item { padding:10px; border:var(--box-border); margin:10px; width:320px; float:left; box-shadow:var(--box-shadow); }
|
||||
div.output.card>div.item { background:var(--plugin-bg-color); padding:10px; border:var(--box-border); border-radius:var(--plugin-radius); margin:10px; width:320px; float:left; box-shadow:var(--box-shadow); }
|
||||
div.output.card>div.item>div.title { font-size:1.2rem; font-weight:bold; padding:10px; border-bottom:var(--box-border); }
|
||||
div.output.card>div.item>div.content { padding:10px; height:70px; }
|
||||
div.output.card>div.item>div.content { white-space:pre; padding:10px; height:70px; }
|
||||
div.output.card>div.item>div.action { text-align:right; width:100%; display:flex; }
|
||||
div.output.card>div.item:not(:hover)>div.action { visibility:hidden; }
|
||||
// div.output.card>div.item:not(:hover)>div.action { visibility:hidden; }
|
||||
div.output.card>div.item>div.action>input { margin-right:5px; box-shadow:var(--box-shadow); }
|
||||
input[type=button].danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
input[type=button].notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
/* display */
|
||||
fieldset.panel>legend { display:none; }
|
||||
fieldset.panel>div.status { display:none; }
|
||||
@ -292,7 +296,8 @@ input:not([type=button]) { border:var(--input-border); }
|
||||
input:not([type=button]):hover { border:var(--box-notice); }
|
||||
input:not([type=button]):focus { border:var(--box-notice); }
|
||||
input[type=button]:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
textarea { background-color:var(--input-bg-color); color:var(--input-fg-color); }
|
||||
textarea { background-color:var(--input-bg-color); color:var(--input-fg-color); border:var(--box-border); }
|
||||
textarea:focus { border:var(--box-notice); }
|
||||
table.content tr:hover { background-color:var(--tr-hover-bg-color); }
|
||||
table.content tr.select { background-color:var(--tr-hover-bg-color); }
|
||||
table.content th { background-color:var(--th-bg-color); color:var(--th-fg-color); }
|
||||
@ -309,7 +314,7 @@ span.item:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-c
|
||||
span.item.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
span.icon:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
div.item:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
div.item.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
div.item.select:not(.button) { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
div.item.danger input:hover[type=button] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
div.item.notice input:hover[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
div.action div.tabs:hover {
|
||||
@ -327,10 +332,11 @@ div.tabs div:hover { background-color:var(--hover-bg-color); color:var(--hover-f
|
||||
div.tabs div.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
div.plug legend { background-color:var(--output-bg-color); border-radius:0; }
|
||||
div.plug legend:hover { background-color:var(--hover-bg-color); }
|
||||
div.plug legend.select { background-color:var(--plugin-bg-color); border-bottom:var(--box-notice); }
|
||||
div.plug legend.select { background-color:var(--plugin-bg-color); border-bottom:var(--box-notice); border-bottom-width:2px; }
|
||||
div.complete>table { background-color:var(--plugin-bg-color); }
|
||||
fieldset>div.output { background-color:var(--output-bg-color); }
|
||||
fieldset>div.status { border-top:var(--status-border); }
|
||||
fieldset>div.status>div.item:first-child { margin-left:10px; }
|
||||
fieldset.panel:not(.main) { background-color:var(--panel-bg-color); color:var(--panel-fg-color); }
|
||||
fieldset.panel:not(.main)>div.output { background-color:var(--panel-output-bg-color); color:var(--panel-output-fg-color); }
|
||||
fieldset.panel:not(.main)>div.output a { color:var(--panel-output-fg-color); }
|
||||
@ -345,8 +351,8 @@ fieldset.input td:hover { background-color:var(--td-hover-bg-color); }
|
||||
div.float { background-color:var(--float-bg-color); color:var(--float-fg-color); }
|
||||
div.carte div.item { background-color:var(--carte-bg-color); }
|
||||
div.carte div.item:hover { background-color:var(--hover-bg-color); }
|
||||
div.carte div.item.danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
div.carte div.item.notice { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
div.carte div.item.danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
div.carte div.item.notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
/* print */
|
||||
body.print { -webkit-filter: grayscale(100%); }
|
||||
body.print { background-color:white; color:black; }
|
||||
@ -401,14 +407,24 @@ fieldset.web.code.docker.studio>div.output>fieldset>form.option>div:first-child
|
||||
fieldset.web.code.docker.studio>div.output { padding:10px; }
|
||||
fieldset.web.code.git.status>div.output table.content { width:100%; }
|
||||
fieldset.inner>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||
fieldset.vimer>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||
body>div.input.vimer.plug td:first-child { display:none; }
|
||||
fieldset.cmd>div.action>div.tabs.select { border-bottom:var(--notice-bg-color) solid 2px; height:32px; }
|
||||
fieldset.cmd>div.status>legend.select { border-top:var(--notice-bg-color) solid 2px; }
|
||||
fieldset.cmd>div.output>div.project div.item.select { border-right:var(--notice-bg-color) solid 4px; }
|
||||
/* fieldset.cmd>div.output>div.project div.item { line-height:32px; } */
|
||||
fieldset.web.code.xterm>div.action>div.tabs:only-child { display:none; }
|
||||
fieldset.macos.desktop.cmd>div.output>fieldset.macos.dock { z-index:11; }
|
||||
fieldset.studio>div.output { padding:10px; }
|
||||
fieldset.studio>div.action>div.cmds { padding:5px 20px; }
|
||||
fieldset.studio>div.output>fieldset>form.option div.icon.delete { display:none; }
|
||||
fieldset.studio>div.output>fieldset>form.option div.icon:nth-child(2) { margin-left:5px; }
|
||||
fieldset.studio>div.output>fieldset>div.output>table.content { width:100%; }
|
||||
fieldset.studio>div.output>fieldset:not(.select) { display:none; }
|
||||
fieldset.can.view { font-size:14px; }
|
||||
fieldset.can.data { font-size:14px; }
|
||||
fieldset.dream>div.output.card>div.item>div.title>img { height:48px; float:left; }
|
||||
fieldset.dream>div.output.card>div.item>div.title>span { line-height:48px; margin-left:10px; }
|
||||
fieldset.inner>form.option input[name=path] { width:80px; }
|
||||
fieldset.inner>form.option input[name=file] { width:160px; }
|
||||
body.zh fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; border-top:var(--box-border); }
|
||||
|
@ -126,9 +126,9 @@ Volcanos("misc", {
|
||||
} catch (e) { can.misc.Warn(e), msg.Reply() }
|
||||
}) }
|
||||
},
|
||||
Resource(can, path) {
|
||||
Resource(can, path, pod) {
|
||||
if (path.indexOf(nfs.PS) == 0 || path.indexOf(ice.HTTP) == 0) { return path }
|
||||
return can.base.MergeURL("/require/"+path, ice.POD, can.Conf(web.SPACE)||can.Conf(ice.POD))
|
||||
return can.base.MergeURL("/require/"+path, ice.POD, pod||can.Conf(web.SPACE)||can.Conf(ice.POD))
|
||||
},
|
||||
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) },
|
||||
|
@ -356,4 +356,8 @@ Volcanos("page", {
|
||||
return can.base.isIn(name, mdb.CREATE, mdb.INSERT, cli.RESTART, cli.START, cli.BUILD, cli.RUN, web.OPEN)? "notice":
|
||||
can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, "drop", cli.STOP)? "danger": ""
|
||||
},
|
||||
exportValue: function(can, msg) {
|
||||
const styles = getComputedStyle(can._target); can.core.List(["--plugin-bg-color", "--plugin-fg-color"].concat(can.core.List(arguments).slice(2)), function(key) { msg.Option(key, styles.getPropertyValue(key)) })
|
||||
return msg
|
||||
},
|
||||
})
|
||||
|
13
lib/user.js
13
lib/user.js
@ -44,7 +44,7 @@ Volcanos("user", {
|
||||
if (location.search.indexOf("debug=true") > 0 && url.indexOf("debug=true") == -1) {
|
||||
var ls = url.split("#"); ls[0] += (ls[0].indexOf("?") > 0? "&": "?") + "debug=true", url = ls.join("#")
|
||||
}
|
||||
window.openurl? window.openurl(url): window.parent && window.parent.openurl? window.parent.openurl(url): window.open(url)
|
||||
window.openurl? window.openurl(url): window.parent && window.parent.openurl? window.parent.openurl(url): this.open(url)
|
||||
},
|
||||
open: function(url) {
|
||||
if (window.open(url)) { return }
|
||||
@ -105,9 +105,11 @@ Volcanos("user", {
|
||||
template: function(can, file) {
|
||||
return can.base.MergeURL(can.base.Path(nfs.SRC_TEMPLATE, can.Conf(ctx.INDEX), file), ice.POD, can.user.space(can))
|
||||
},
|
||||
share: function(can, msg, cmds) { can.run(msg, cmds||[ctx.ACTION, chat.SHARE], function(msg) { can.user.copy(msg._event, can, msg.Append(mdb.NAME))
|
||||
can.user.toast(can, {title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
|
||||
}) },
|
||||
share: function(can, msg, cmds) { can.page.exportValue(can, msg)
|
||||
can.run(msg, cmds||[ctx.ACTION, chat.SHARE], function(msg) { can.user.copy(msg._event, can, msg.Append(mdb.NAME))
|
||||
can.user.toast(can, {title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
|
||||
})
|
||||
},
|
||||
copy: function(event, can, text) { if (!text) { return }
|
||||
if (navigator.clipboard) { var ok = false; navigator.clipboard.writeText(text).then(function() { ok = true })
|
||||
if (ok) { return can.user.toastSuccess(can, text, "copy success"), can.misc.Log(nfs.COPY, text), text }
|
||||
@ -154,7 +156,7 @@ Volcanos("user", {
|
||||
},
|
||||
input: function(event, can, form, cb, button) { if (!form || form.length == 0) { return cb() }
|
||||
var msg = can.request(event); event = event._event||event; var need = {}
|
||||
var ui = can.page.Append(can, document.body, [{view: [[html.INPUT, chat.FLOAT]], list: [
|
||||
var ui = can.page.Append(can, document.body, [{view: [[html.INPUT].concat(can.ConfIndex().split("."), msg.Option(mdb.TYPE), [chat.FLOAT])], list: [
|
||||
msg.Option(wiki.TITLE) && {view: [wiki.TITLE, html.LEGEND, msg.Option(wiki.TITLE)]},
|
||||
{view: html.OPTION, list: [{type: html.TABLE, list: can.core.List(form, function(item) {
|
||||
item = can.base.isString(item)? {type: html.TEXT, name: item}: item.length > 0? {type: html.SELECT, name: item[0], values: item.slice(1)}: item
|
||||
@ -191,7 +193,6 @@ Volcanos("user", {
|
||||
can.getActionSize(function(left, top, height) { can.page.style(can, ui._target, html.LEFT, left||0, html.TOP, (height/4||0)) })
|
||||
}
|
||||
can.onmotion.delay(can, function() { action.focus() })
|
||||
// can.onmotion.move(can, ui._target, {})
|
||||
can.onmotion.resize(can, ui._target)
|
||||
return button === true && action.submit(event, can, html.SUBMIT), action
|
||||
},
|
||||
|
@ -18,8 +18,8 @@ fieldset.Action.grid>div.output>fieldset.plugin>div.action { display:none; }
|
||||
fieldset.Action.grid>div.output>fieldset.plugin>div.status { display:none; }
|
||||
fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { width:80px; }
|
||||
fieldset.Action>div.project.toggle { font-size:32px; cursor:pointer; padding-top:50px; height:150px; position:fixed; top:30%; border-top-right-radius:20px; border-bottom-right-radius:20px; }
|
||||
fieldset.Action>div.project.toggle { background-color:#4a566e6e; color:var(--body-fg-color); width:20px; }
|
||||
fieldset.Action>div.project.toggle:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); width:20px; }
|
||||
fieldset.Action>div.project.toggle { background-color:#4a566e6e; color:var(--panel-fg-color); width:20px; }
|
||||
fieldset.Action>div.project.toggle:hover { background-color:var(--hover-bg-color); color:var(--panel-hover-fg-color); width:20px; }
|
||||
fieldset.Action.tabview>div.project.toggle { display:none; }
|
||||
fieldset.Action.vertical>div.project.toggle { display:none; }
|
||||
fieldset.Action.horizon>div.project.toggle { display:none; }
|
||||
|
@ -25,6 +25,7 @@ fieldset.inner>div.output>div.layout>div.tabs>div.tabs:hover { background-color:
|
||||
fieldset.inner>div.output>div.layout>div.tabs>div.tabs.select { background-color:var(--output-bg-color); border-top-left-radius:10px; border-top-right-radius:10px; border-bottom:lightgray solid 2px; }
|
||||
fieldset.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:none; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>iframe.profile { border-left:var(--box-border); }
|
||||
// fieldset.inner>div.output>div.layout>div.layout>div.profile { white-space:pre; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile h1 { text-align:left; padding:10px 0; border-bottom:var(--box-border); margin:20px 0; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile h2 { padding:10px 0; border-bottom:var(--box-border); margin:20px 0; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile pre>code { padding-left:10px; border-left:var(--code-border-color) solid 5px; display:block; }
|
||||
@ -36,7 +37,7 @@ fieldset.inner>div.output>div.layout>div.display pre>code { padding-left:10px; b
|
||||
fieldset.inner>div.output>div.layout>div.display div.code { white-space:unset; padding:20px; }
|
||||
fieldset.inner>div.output>div.layout>div.display div.status>div { padding:5px; float:left; }
|
||||
fieldset.inner>div.output>div.layout>div.display div.status { position:sticky; bottom:0; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.tabs { height:38px; display:block; overflow:hidden; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.tabs { height:38px; display:block; overflow:hidden; background-color:var(--plugin-bg-color); }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.tabs.hide { display:none; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.tabs>div { padding:10px; height:38px; float:left; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.tabs>div.icon { font-size:26px; line-height:32px; padding:2px 5px; position:sticky; top:0; }
|
||||
@ -54,6 +55,9 @@ fieldset.inner.cmd>div.output>div.layout>div.path span.view { font-size:22px; pa
|
||||
fieldset.inner.cmd>div.output>div.layout>fieldset.plug { bottom:32px; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug { height:32px; position:fixed; right:0; bottom:0; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { font-size:1rem; font-style:italic; padding:0 10px; float:right; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove { padding:5px; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove:hover { background-color:var(--hover-bg-color); }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend:not(:hover)>span.remove { visibility:hidden; }
|
||||
div.path span.item { padding:5px; }
|
||||
div.carte.path.float { font-size:var(--code-font-size); } div.carte.path.float div.item { padding:5px; }
|
||||
div.carte.cmd.float { font-size:var(--code-font-size); } div.carte.cmd.float div.item { padding:5px; }
|
||||
|
@ -230,6 +230,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
can.page.Append(can, target, [{type: html.IFRAME, src: src, style: {height: height, width: width}}])
|
||||
} else if (msg.Length() > 0 || msg.Result() != "") {
|
||||
can.onappend.table(can, msg, function(value, key, index, item) { return {text: [value, html.TD], onclick: function(event) {
|
||||
if (event.target.type == html.BUTTON) { return can.runAction(can.request(event, item), event.target.name, [], function() {
|
||||
|
||||
}) }
|
||||
item.file && can.onimport.tabview(can, item.path, item.file||can.Option(nfs.FILE), item.line)
|
||||
}} }, target), can.onappend.board(can, msg, target), msg.Option(ice.MSG_STATUS) && can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, [html.STATUS])._target)
|
||||
can.onmotion.delay(can, function() {
|
||||
@ -262,7 +265,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
if (can.isCmdMode()) { can.ui.zone.source._layout(), can.ui.zone[can.Option(nfs.PATH)] && can.ui.zone[can.Option(nfs.PATH)]._layout() }
|
||||
},
|
||||
exts: function(can, url, cb) { var sub = can.db.toolkit[url.split(web.QS)[0]]; if (sub) { return can.base.isFunc(cb)? cb(sub): sub.select() }
|
||||
can.onimport.toolkit(can, {index: ice.CAN_PLUGIN, display: (url[0] == nfs.PS || url.indexOf(web.HTTP) == 0? "": can.base.Dir(can._path))+url}, function(sub) {
|
||||
can.onimport.toolkit(can, {index: ice.CAN_PLUGIN, display: (url[0] == nfs.PS || url.indexOf(web.HTTP) == 0? "": can.base.Dir(can._path))+url,
|
||||
style: url.split(nfs.PS).pop().split(nfs.PT)[0]}, function(sub) {
|
||||
sub.run = function(event, cmds, cb) {
|
||||
if (cmds.length > 0 && cmds[0] == ctx.ACTION) {
|
||||
can.run(can.request(event, can.Option()), cmds, cb||function(msg) { can.onappend._output(sub, msg, sub.Conf(ctx.DISPLAY)) })
|
||||
@ -270,6 +274,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
}, can.db.toolkit[url.split(web.QS)[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select(), can.page.Modify(can, sub._legend, can.base.trimPrefix(url, "inner/"))
|
||||
})
|
||||
},
|
||||
grow: function(can, msg, arg) { can.onimport.exts(can, "inner/output.js", function(sub) { sub.Conf(ctx.INDEX, can.ConfIndex())
|
||||
sub.select(true), can.onmotion.delay(can, function() {
|
||||
can.page.Append(can, sub._output, [{text: arg}]), sub._output.scrollTop = sub._output.scrollHeight
|
||||
can.misc.sessionStorage(can, [can.ConfIndex(), "output"], sub._output.innerHTML)
|
||||
})
|
||||
}) },
|
||||
}, [""])
|
||||
Volcanos(chat.ONFIGURE, {
|
||||
source: function(can, target, zone, path) { var args = can.base.getValid(can.misc.SearchHash(can), [can.Option(nfs.PATH), can.Option(nfs.FILE)])
|
||||
@ -332,8 +342,14 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
||||
} var content = can.ui.content; if (content._root) { can.onmotion.cache(can, function() { return key }, content) }
|
||||
if (can.onexport.parse(can) == nfs.SVG) { msg.Option(ctx.INDEX, web.WIKI_DRAW+mdb.FS+path+file) }
|
||||
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, function(target) { can.ui.content = target, cb(msg._content = content._root? (target._root = content._root): target) }, content._root? content: can.ui._profile.parentNode) }
|
||||
if (can.base.beginWith(msg.Results(), "<img")) { return can.onsyntax._image(can, msg, content, cb, key) }
|
||||
can.onsyntax._split(can, msg, content, cb, key)
|
||||
},
|
||||
_image: function(can, msg, content, cb, key) {
|
||||
if (!content._root && can.db.history.length > 1) { content = can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._profile), content._cache_key = key }
|
||||
content._max = 0, content._msg = msg, msg.__content = content, content.innerHTML = msg.Results()
|
||||
can.onengine.signal(can, VIEW_CREATE, msg), can.base.isFunc(cb) && cb(msg._content = content._root? content._root: content)
|
||||
},
|
||||
_split: function(can, msg, content, cb, key) {
|
||||
var path = msg.Option(nfs.PATH, can.Option(nfs.PATH)), file = msg.Option(nfs.FILE, can.Option(nfs.FILE))
|
||||
function show(p) {
|
||||
@ -341,9 +357,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
||||
p.keyword = p.keyword||{}, can.core.Item(can.onsyntax[from].keyword, function(key, value) { p.keyword[key] = p.keyword[key] || value })
|
||||
can.core.Item(can.onsyntax[from], function(key, value) { p[key] = p[key] || value })
|
||||
})
|
||||
p && p.prepare && can.core.ItemForm(p.prepare, function(value, index, key) {
|
||||
p.keyword = p.keyword||{}, p.keyword[value] = key
|
||||
})
|
||||
p && p.prepare && can.core.ItemForm(p.prepare, function(value, index, key) { p.keyword = p.keyword||{}, p.keyword[value] = key })
|
||||
if (!content._root && can.db.history.length > 1) { content = can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._profile), content._cache_key = key }
|
||||
content._max = 0, content._msg = msg, msg.__content = content, can.page.Appends(can, content, [{view: ["tips", "", msg.Option(nfs.FILE)]}])
|
||||
if (msg.Length() > 0) { can.onsyntax._change(can, msg), can.onaction.rerankLine(can, "tr.line:not(.delete)>td.line")
|
||||
|
@ -94,8 +94,8 @@ Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码"
|
||||
})
|
||||
},
|
||||
"命令": function(event, can) { can.user.input(event, can, [{name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list) { can.onimport.tabview(can, "", list[0]+(list[1]? mdb.FS+list[1]: ""), ctx.INDEX) }) },
|
||||
"插件": function(event, can) { can.user.input(event, can, [web.SPACE, {name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list) { var sub = can.db.toolkit[list.join(",")]; if (sub) { sub.select(); return }
|
||||
can.onimport.toolkit(can, {space: list[0], index: list[1], args: can.core.Split(list[2]||"")}, function(sub) { can.db.toolkit[list.join(",")] = sub.select() })
|
||||
"插件": function(event, can) { can.user.input(can.request(event, {type: "plug"}), can, [{name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list, data) { var sub = can.db.toolkit[list.join(",")]; if (sub) { sub.select(); return }
|
||||
can.onimport.toolkit(can, {index: data.index, args: can.core.Split(data.args||"")}, function(sub) { can.db.toolkit[list.join(",")] = sub.select() })
|
||||
}) },
|
||||
"扩展": function(event, can) { can.user.input(can.request(event, {action: "extension"}), can, ["url"], function(list) { var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0]) }) },
|
||||
"编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) },
|
||||
|
@ -35,7 +35,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
return can.page.style(can, div, html.MAX_HEIGHT, can.onexport.outputHeight(can)), can.page.Append(can, div, [{text: arg}]), can._output.scrollTop = div.offsetTop, div.scrollBy(0, 10000), true
|
||||
}).length == 0) { can.onappend.board(can, arg) }
|
||||
},
|
||||
_open: function(can, msg, arg) { can.user.open(arg), can.Update() },
|
||||
_open: function(can, msg, arg) { can.user.opens(arg), can.Update() },
|
||||
_close: function(can, msg) { can.user.close() || history.back() },
|
||||
change: function(event, can, name, value, cb) { return can.page.SelectArgs(can, can._option, "", function(input) { if (input.name != name || value == input.value) { return }
|
||||
can.page.Select(can, input.parentNode, "span.value", function(target) { target.innerText = value })
|
||||
@ -195,14 +195,14 @@ Volcanos(chat.ONEXPORT, {
|
||||
title: function(can, title) { can.isCmdMode() && can.user.title(title) },
|
||||
marginTop: function() { return 0 }, marginBottom: function() { return 0 },
|
||||
actionHeight: function(can) { return can.page.ClassList.has(can, can._target, html.OUTPUT)? 0: html.ACTION_HEIGHT },
|
||||
outputHeight: function(can) { var height = can.sub.ConfHeight()
|
||||
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) }
|
||||
can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
|
||||
return can.base.Min(height, can.sub.ConfHeight()/2)
|
||||
},
|
||||
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.ACTION_HEIGHT },
|
||||
link: function(can) { var meta = can.Conf(), args = can.Option()
|
||||
args.pod = meta._space||meta.space||meta.pod, args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd)
|
||||
return can.misc.MergePodCmd(can, args, true)
|
||||
}, args: function(can) { return can.Option() },
|
||||
link: function(can) { var args = can.Option(); args.pod = can.ConfSpace(), args.cmd = can.ConfIndex(); return can.misc.MergePodCmd(can, args, true) },
|
||||
args: function(can) { return can.Option() },
|
||||
close: function(can, msg) {},
|
||||
})
|
||||
|
@ -1,22 +1,19 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg, cb) { cb && cb(msg), can.onmotion.clear(can)
|
||||
_init: function(can, msg, cb) {
|
||||
can.isCmdMode() && can.sup.onimport.size(can.sup, can.page.height(), can.page.width())
|
||||
can.onmotion.clear(can), can.onmotion.hidden(can, can._status), cb && cb(msg)
|
||||
can.onimport._tabs(can, msg) // can.onimport._full(can, msg)
|
||||
},
|
||||
_tabs: function(can, msg) {
|
||||
can.onappend.style(can, "studio")
|
||||
msg.Table(function(value, index) { value.nick = value.help||value.name.split(" ")[0]
|
||||
_tabs: function(can, msg) { can.onappend.style(can, web.STUDIO)
|
||||
msg.Table(function(value, index) { value.nick = value.help||value.name.split(lex.SP)[0]
|
||||
var target = can.onimport.item(can, value, function() {
|
||||
if (can.onmotion.cache(can, function() { return value.index }, can._output)) { return }
|
||||
can.onappend.plugin(can, value, function(sub) {
|
||||
if (value._plugin) { return can.onmotion.select(can, can._output, html.FIELDSET, value._plugin._target) }
|
||||
can.onappend.plugin(can, value, function(sub) { value._plugin = sub
|
||||
can.onmotion.select(can, can._output, html.FIELDSET, value._plugin._target)
|
||||
sub.onexport.output = function() { sub.onimport.size(sub, can.ConfHeight()-20, can.ConfWidth()-20) }
|
||||
target.oncontextmenu = function(event) {
|
||||
sub._legend.onclick(event)
|
||||
}
|
||||
target.oncontextmenu = function(event) { sub._legend.onclick(event) }, can.onmotion.hidden(can, sub._legend)
|
||||
}, can._output)
|
||||
|
||||
}, function(event) {
|
||||
}, can._action); index == 0 && target.click()
|
||||
}, null, can._action); index == 0 && target.click(), can.onappend.style(can, "cmds", target)
|
||||
})
|
||||
},
|
||||
_full: function(can, msg) {
|
||||
@ -30,7 +27,5 @@ Volcanos(chat.ONIMPORT, {
|
||||
}, function() {}); index == 0 && target.click()
|
||||
})
|
||||
},
|
||||
layout: function(can) {
|
||||
can.page.styleHeight(can, can._output, can.ConfHeight())
|
||||
},
|
||||
layout: function(can) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth()) },
|
||||
})
|
||||
|
@ -7,11 +7,17 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target), can.onmotion.story.auto(can, target)
|
||||
}
|
||||
},
|
||||
card: function(can, msg, target) { can.page.Appends(can, target||can._output, msg.Table(function(value) {
|
||||
return {view: [[html.ITEM, value.status]], list: [{view: [wiki.TITLE, html.DIV, value.name]}, {view: [wiki.CONTENT, html.DIV, value.text]},
|
||||
{view: html.ACTION, inner: value.action, onclick: function(event) { can.run(can.request(event, value), [ctx.ACTION, event.target.name]) }},
|
||||
]}
|
||||
})), can.onlayout.expand(can, can._output, 320) },
|
||||
card: function(can, msg, target) {
|
||||
can.sup.onexport.outputMargin = function() { return 211 }
|
||||
can.page.Appends(can, target||can._output, msg.Table(function(value) {
|
||||
return {view: [[html.ITEM, value.status]], list: [
|
||||
{view: [wiki.TITLE, html.DIV], list: [value.icon && {img: can.misc.Resource(can, value.icon, value.name)}, {text: value.name}]},
|
||||
{view: [wiki.CONTENT, html.DIV, value.text]},
|
||||
{view: html.ACTION, inner: value.action, _init: function(target) { can.onappend.mores(can, target, value, 5) }},
|
||||
]}
|
||||
}))
|
||||
can.onimport.layout = function() { can.onlayout.expand(can, can._output, 320) }
|
||||
},
|
||||
_vimer_zone: function(can, msg, target) { msg.Table(function(value) { var action = can.page.parseAction(can, value)
|
||||
can.onimport.item(can, {name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]}, function(event) {
|
||||
can.sup.onexport.record(can, value.name, mdb.NAME, value, event)
|
||||
@ -79,7 +85,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
can.base.isFunc(button)? button(event, button): can.onaction[button](event, can, button), can.onkeymap.prevent(event)
|
||||
}}]) },
|
||||
icon: function(can, msg, target, cb) { return msg.Table(function(value) {
|
||||
var space = value.space||can.ConfSpace(); value.icon && (value.icon = can.base.MergeURL(value.icon, ice.POD, space))
|
||||
var space = value.space||can.ConfSpace()||can.misc.Search(can, ice.POD); value.icon && (value.icon = can.base.MergeURL(value.icon, ice.POD, space))
|
||||
value.icon = can.misc.PathJoin(value.icon||can.page.drawText(can, value.name, 80))
|
||||
return can.page.Append(can, target, [{view: html.ITEM, list: [{view: html.ICON, list: [{img: value.icon}]}, {view: [mdb.NAME, "", value.name]}], _init: function(target) {
|
||||
cb && cb(target, value)
|
||||
@ -175,11 +181,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
sub.onimport.size(sub, can.ConfHeight()/2, (can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0))/2)
|
||||
can.onmotion.select(can, status, html.LEGEND, sub._legend), can.onmotion.toggle(can, sub._target, true), sub.Focus()
|
||||
if (sub._delay_init || meta.msg) { sub._delay_init = false, meta.msg = false, sub.Update() }
|
||||
}) }, sub._delay_init = true, sub.onaction.close = function() { sub.select() }, sub.select = function() { return sub._legend.click(), sub }
|
||||
sub.hidden = function() { can.onmotion.hidden(can, sub._target), can.page.ClassList.del(can, sub._legend, html.SELECT) }
|
||||
sub.onaction._close = function() {
|
||||
can.page.Remove(can, sub._target), can.page.Remove(can, sub._legend), can.onexport.tool(can)
|
||||
}) }, sub._delay_init = true, sub.onaction.close = function() { sub.select() }, sub.select = function(show) {
|
||||
if (show && can.page.ClassList.has(can, sub._legend, html.SELECT)) { return sub }
|
||||
return sub._legend.click(), sub
|
||||
}
|
||||
sub.hidden = function() { can.onmotion.hidden(can, sub._target), can.page.ClassList.del(can, sub._legend, html.SELECT) }
|
||||
sub.onaction._close = function() { can.page.Remove(can, sub._target), can.page.Remove(can, sub._legend), can.onexport.tool(can) }
|
||||
can.base.isFunc(cb) && cb(sub), can.onexport.tool(can)
|
||||
}, target)
|
||||
})
|
||||
|
19
proto.js
19
proto.js
@ -44,23 +44,19 @@ var Volcanos = shy({
|
||||
if (name.indexOf("/plugin/") == 0) { name = "/volcanos"+name }
|
||||
if (name.indexOf("/volcanos/") == 0 && meta.volcano) { name = meta.volcano+name }
|
||||
if (name.indexOf("/require/") == 0 && meta.iceberg) { name = meta.iceberg+name }
|
||||
// meta.cache[name] || name == ""? next(): meta._load(name, next)
|
||||
meta.cache[name]? next(): meta._load(name, next)
|
||||
},
|
||||
requestPodCmd: function(event) { return can.request(event, {space: can.Conf(web.SPACE), index: can.Conf(ctx.INDEX)}) },
|
||||
requestPodCmd: function(event) { return can.request(event, {space: can.ConfSpace(), index: can.ConfIndex()}) },
|
||||
request: function(event) { event = event||{}, event = event._event||event
|
||||
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
||||
function set(key, value) {
|
||||
if (key == "_method") { return msg._method = value }
|
||||
value == "" || msg.Option(key) || msg.Option(key, value) }
|
||||
function set(key, value) { if (key == "_method") { return msg._method = value }
|
||||
value == "" || msg.Option(key) || msg.Option(key, value)
|
||||
}
|
||||
can.core.List(arguments, function(item, index) { if (!item || index == 0) { return }
|
||||
can.base.isFunc(item.Option)? can.core.List(item.Option(), function(key) {
|
||||
key.indexOf("_") == 0 || key.indexOf("user.") == 0 || set(key, item.Option(key))
|
||||
}): can.core.Item(can.base.isFunc(item)? item(): item, set)
|
||||
})
|
||||
// set(ctx.INDEX, can.Conf(ctx.INDEX))
|
||||
set(ice.MSG_MODE, can.Mode())
|
||||
set(ice.MSG_HEIGHT, (can.ConfHeight()||"32")+""), set(ice.MSG_WIDTH, (can.ConfWidth()||"320")+"")
|
||||
return msg
|
||||
},
|
||||
requestAction: function(event, button) { return can.request(event, {action: button, _toast: ice.PROCESS+" "+button}) },
|
||||
@ -92,7 +88,6 @@ var Volcanos = shy({
|
||||
setAction: function(key, value) { return can.set(chat.ACTION, key, value) },
|
||||
getAction: function(key, cb) { return can.get(chat.ACTION, key, cb) },
|
||||
getActionSize: function(cb) { return can.get(chat.ACTION, nfs.SIZE, cb) },
|
||||
|
||||
isPanelType: function() { return can.page.ClassList.has(can, can._fields||can._target, chat.PANEL) },
|
||||
isPluginType: function() { return can.page.ClassList.has(can, can._fields||can._target, chat.PLUGIN) },
|
||||
isStoryType: function() { return can.page.ClassList.has(can, can._fields||can._target, chat.STORY) },
|
||||
@ -104,10 +99,10 @@ var Volcanos = shy({
|
||||
isAutoMode: function() { return can.Mode() == "" },
|
||||
Mode: function(value) { return can.Conf(ice.MODE, value) },
|
||||
ConfDefault: function(value) { can.core.Item(value, function(k, v) { can.Conf(k) || can.Conf(k, v) }) },
|
||||
ConfHeight: function(value) { return can.Conf(html.HEIGHT, value) },
|
||||
ConfWidth: function(value) { return can.Conf(html.WIDTH, value) },
|
||||
ConfSpace: function() { return can.Conf(web.SPACE)||can.Conf("_space") },
|
||||
ConfIndex: function() { return can.Conf(ctx.INDEX)||can.Conf("_index") },
|
||||
ConfHeight: function(value) { return can.Conf(html.HEIGHT, value) },
|
||||
ConfWidth: function(value) { return can.Conf(html.WIDTH, value) },
|
||||
Conf: function(key, value) { var res = can._conf
|
||||
for (var i = 0; i < arguments.length; i += 2) {
|
||||
if (typeof key == code.OBJECT) { res = can.core.Value(can._conf, arguments[i]), i--; continue }
|
||||
@ -140,8 +135,6 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
|
||||
window.onerror = function(message, source, lineno, colno, error) { debug? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) }
|
||||
window.onmousemove = function(event) { window._mousemove && (window._mousemove.onmousemove(event)) }
|
||||
window.onmouseup = function(event) { window._mousemove && (window._mousemove.onmouseup(event)) }
|
||||
// window.ondblclick = function(event) { can.onkeymap.prevent(event) }
|
||||
// window.onkeydown = function(event) { if (event.key == code.ESCAPE && !can.page.tagis(event.target, html.INPUT)) { can.onkeymap.prevent(event) } }
|
||||
}
|
||||
} else { // nodejs
|
||||
global.document = {}, global.location = {}, global.window = {}, global.navigator = {userAgent: "nodejs"}
|
||||
|
Loading…
x
Reference in New Issue
Block a user