mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt some
This commit is contained in:
parent
1b3aeec89f
commit
065db9b1d6
58
frame.js
58
frame.js
@ -415,7 +415,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.onmotion.modifys(can, event.target, function(event, value, old) { run(event, mdb.MODIFY, [key, value]) }, item)
|
||||
}}
|
||||
}); 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)
|
||||
table.offsetWidth > can.ConfWidth() / 2 && can.onappend.style(can, "full", table)
|
||||
;(can.isCmdMode() || table.offsetWidth > can.ConfWidth() / 2) && can.onappend.style(can, "full", table)
|
||||
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 }
|
||||
@ -702,55 +702,27 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
||||
},
|
||||
move: function(can, target, layout) { layout && can.page.style(can, target, layout), can.onmotion.resize(can, target, function() {}) },
|
||||
resize: function(can, target, cb, top) { var begin, action
|
||||
target.onclick = function(event) {
|
||||
if (can.page.tagis(event.target, html.DIV) && can.page.ClassList.has(can, event.target, html.FLOAT)) {
|
||||
} else if (can.page.tagis(event.target, html.FIELDSET)) {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
if (can.page.tagis(event.target, html.INPUT)) { return }
|
||||
can.onmotion.delay(can, function() { can.onmotion.clearCarte(can) })
|
||||
can.onkeymap.prevent(event)
|
||||
}
|
||||
target.onmousedown = function(event) { if (event.which != 1) { return }
|
||||
for (var _target = event.target; _target; _target = _target.parentNode) { if (_target == target) { break }
|
||||
if (can.page.tagis(_target, html.INPUT, html.TEXTAREA, html.TR)) { return }
|
||||
if (can.page.ClassList.has(can, _target, html.ITEM)) { return }
|
||||
}
|
||||
can.onkeymap.prevent(event)
|
||||
begin = {left: target.offsetLeft, top: target.offsetTop, width: target.offsetWidth, height: target.offsetHeight, x: event.x, y: event.y}
|
||||
window._mousemove = target.onmousemove
|
||||
target.onmousedown = function(event) { if (event.which != 1 || event.target != target && !can.page.ClassList.has(can, event.target, html.STATUS)) { return } window._mousemove = target
|
||||
begin = {left: target.offsetLeft, top: target.offsetTop, height: target.offsetHeight, width: target.offsetWidth, x: event.x, y: event.y}
|
||||
}, target.onmouseup = function(event) { begin = null, delete(window._mousemove) }
|
||||
target.onmousemove = function(event) {
|
||||
if (begin) {
|
||||
can.onkeymap.prevent(event)
|
||||
if (!window._mousemove) { return begin = null }
|
||||
if (begin) { var dy = event.y - begin.y, dx = event.x - begin.x
|
||||
switch (action) {
|
||||
case "left":
|
||||
can.page.style(can, target, html.LEFT, can.base.Min(begin.left + event.x - begin.x, 0, window.innerWidth-target.offsetWidth))
|
||||
cb? cb(target.offsetHeight, begin.width + begin.x - event.x): can.page.style(can, target, html.WIDTH, begin.width + begin.x - event.x)
|
||||
break
|
||||
case "right":
|
||||
cb? cb(target.offsetHeight, begin.width + event.x - begin.x): can.page.style(can, target, html.WIDTH, begin.width + event.x - begin.x)
|
||||
break
|
||||
case "top":
|
||||
can.page.style(can, target, html.TOP, can.base.Min(begin.top + event.y - begin.y, top, window.innerHeight-target.offsetHeight))
|
||||
cb? cb(begin.height + begin.y - event.y, target.offsetWidth): can.page.style(can, target, html.HEIGHT, begin.height + begin.y - event.y)
|
||||
break
|
||||
case "bottom":
|
||||
cb? cb(begin.height + event.y - begin.y, target.offsetWidth): can.page.style(can, target, html.HEIGHT, begin.height + event.y - begin.y)
|
||||
break
|
||||
case html.LEFT: can.page.style(can, target, html.LEFT, can.base.Min(begin.left + dx, 0, window.innerWidth-target.offsetWidth)), dx = -dx
|
||||
case html.RIGHT: cb? cb(begin.height, begin.width + dx): can.page.style(can, target, html.WIDTH, begin.width + dx); break
|
||||
case html.TOP: can.page.style(can, target, html.TOP, can.base.Min(begin.top + dy, top, window.innerHeight-target.offsetHeight)), dy = -dy
|
||||
case html.BOTTOM: cb? cb(begin.height + dy, begin.width): can.page.style(can, target, html.HEIGHT, begin.height + dy); break
|
||||
default:
|
||||
can.page.style(can, target,
|
||||
html.LEFT, can.base.Min(begin.left + event.x - begin.x, 0, window.innerWidth-target.offsetWidth),
|
||||
html.TOP, can.base.Min(begin.top + event.y - begin.y, top||0, window.innerHeight-html.ACTION_HEIGHT)
|
||||
html.LEFT, can.base.Min(begin.left + dx, 0, window.innerWidth-target.offsetWidth),
|
||||
html.TOP, can.base.Min(begin.top + dy, top||0, window.innerHeight-html.ACTION_HEIGHT)
|
||||
)
|
||||
}
|
||||
} can.onkeymap.prevent(event)
|
||||
} else { var p = can.page.position(event, target), margin = 20, cursor = ""
|
||||
if (p.x < margin) { cursor = "ew-resize", action = "left"
|
||||
} else if (target.offsetWidth-margin < p.x) { cursor = "ew-resize", action = "right"
|
||||
} else if (target.offsetHeight-margin < p.y) { cursor = "ns-resize", action = "bottom"
|
||||
} else if (p.y < margin) { cursor = "ns-resize", action = "top"
|
||||
if (p.x < margin) { cursor = "ew-resize", action = html.LEFT
|
||||
} else if (target.offsetWidth-margin < p.x) { cursor = "ew-resize", action = html.RIGHT
|
||||
} else if (target.offsetHeight-margin < p.y || can.page.ClassList.has(can, event.target, html.STATUS)) { cursor = "ns-resize", action = html.BOTTOM
|
||||
} else if (p.y < margin) { cursor = "ns-resize", action = html.TOP
|
||||
} else { cursor = "", action = "" } can.page.style(can, target, "cursor", cursor)
|
||||
}
|
||||
}
|
||||
|
18
index.css
18
index.css
@ -25,6 +25,7 @@ input[name=offend] { width:80px; }
|
||||
input[name=id] { width:60px; }
|
||||
input[name=url] { width:320px; }
|
||||
input[name=cmd] { background-color:var(--code-bg-color); color:var(--code-fg-color); width:100%; }
|
||||
div.item.text.cmd { color:var(--code-fg-color); }
|
||||
table.content.full { width:100%; }
|
||||
table.content thead { position:sticky; top:2px; }
|
||||
table.content th { padding:2px 5px; }
|
||||
@ -47,6 +48,7 @@ fieldset>div.action>div.item.select { border-radius:5px; }
|
||||
fieldset>div.action>div.item { margin-right:10px; }
|
||||
fieldset>div.output { width:100%; }
|
||||
fieldset>div.status { width:100%; }
|
||||
fieldset.cmd>div.status { height:31px; }
|
||||
fieldset.input>legend { display:none; }
|
||||
fieldset.input.key div.action { display:none; }
|
||||
fieldset.input.key div.output table.content { width:100%; }
|
||||
@ -112,7 +114,7 @@ body.en fieldset.input.date>div.action>div.item.select.month select { width:100p
|
||||
body.zh fieldset.input.date>div.action>div.item.select select { width:58px; }
|
||||
body.zh fieldset.input.date>div.action>div.item.select.year select { width:81px; }
|
||||
body.zh fieldset.input.date>div.action>div.item.select.month select { width:81px; }
|
||||
body.zh input[type=button]:not(.select) { letter-spacing:5px; }
|
||||
// body.zh input[type=button]:not(.select) { letter-spacing:5px; }
|
||||
/* icon */
|
||||
legend>i:first-child { margin-right:10px; } div.item>i:first-child { margin-right:10px; }
|
||||
form.option div.icon, form.option span.icon { font-size:20px; line-height:32px; padding:0 5px; margin:0; height:32px; }
|
||||
@ -124,8 +126,9 @@ form.option div.icon.next { font-size:18px; }
|
||||
form.option div.icon.prev { font-size:18px; }
|
||||
div.item.select>span.icon { margin-left:-25px; margin-right:3px; visibility:hidden; }
|
||||
div.item.select:hover>span.icon { visibility:visible; }
|
||||
div.item.text>span.icon { margin-left:-25px; margin-right:3px; }
|
||||
div.item.text>span.icon.delete { font-size:20px; visibility:hidden; }
|
||||
div.item.text { position:relative; }
|
||||
div.item.text>span.icon { margin-left:-25px; margin-right:3px; cursor:pointer; }
|
||||
div.item.text>span.icon.delete { position:absolute; font-size:20px; visibility:hidden; }
|
||||
div.item.text:hover>span.icon.delete { visibility:visible; }
|
||||
div.item.button>span.icon.create { font-size:26px; line-height:28px; }
|
||||
div.tabs span.icon { margin-left:5px; visibility:hidden; }
|
||||
@ -199,13 +202,12 @@ legend, form.option, form.option>div.item, div.action, div.action>div.item, div.
|
||||
fieldset.story, div.output, fieldset>div.status, div.project div.item, div.content:not(.item), div.code, div.story[data-type=spark] { clear:both; }
|
||||
div.output { position:relative; } div.layout.flex>* { float:left; clear:none; }
|
||||
fieldset.auto, fieldset.full, fieldset.float, div.float { position:fixed; z-index:100; }
|
||||
fieldset.cmd fieldset.plug { position:fixed; bottom:32px; right:0; }
|
||||
fieldset.plug { position:absolute; bottom:0; right:0; }
|
||||
fieldset.full { position:fixed; left:0; top:0; }
|
||||
fieldset>div.output>div.code { position:sticky; left:0; }
|
||||
legend, select, input[type=button], th, table.content td, h1, h2, h3, div.item, div.tabs { cursor:pointer; }
|
||||
div.story[data-type=spark] { cursor:copy; }
|
||||
fieldset>div.status>legend { margin-left:2px; margin-right:0; height:31px; float:right; clear:none; }
|
||||
fieldset>div.status>legend { margin-left:2px; margin-right:0; float:right; clear:none; }
|
||||
fieldset>div.status>legend:not(:hover):not(.select) { background-color:unset; }
|
||||
/* hover */
|
||||
input:hover[type=button][name=create] { background-color:var(--create-bg-color); color:var(--create-fg-color); }
|
||||
@ -223,7 +225,7 @@ body { background-color:var(--body-bg-color); color:var(--body-fg-color); }
|
||||
legend { background-color:var(--legend-bg-color); border-radius:var(--input-radius); }
|
||||
select { border-radius:var(--input-radius); }
|
||||
input { background-color:var(--input-bg-color); color:var(--input-fg-color); border-radius:var(--input-radius); }
|
||||
input:hover { color:var(--hover-fg-color) }
|
||||
input[type=button]:hover { color:var(--hover-fg-color) }
|
||||
input:not([type=button]) { border-radius:0; }
|
||||
input:not([type=button]):hover { border:var(--input-border); }
|
||||
input:not([type=button]):focus { border:var(--input-border); outline:none; }
|
||||
@ -249,7 +251,9 @@ div.action div.tabs:hover { background-color:var(--hover-bg-color); color:var(--
|
||||
div.action div.tabs.select { background-color:var(--hover-bg-color); color:var(--hover-fg-color); }
|
||||
fieldset>div.output { background-color:var(--output-bg-color); }
|
||||
fieldset>div.status { border-top:var(--status-border); }
|
||||
fieldset:not(.panel):not(.cmd) { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); border-radius:var(--plugin-radius); }
|
||||
fieldset:not(.panel):not(.cmd) { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); }
|
||||
fieldset:not(.panel) { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); }
|
||||
fieldset:not(.panel):not(.full):not(.cmd) { border-radius:var(--plugin-radius); }
|
||||
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.input div.output { background-color:var(--plugin-bg-color); }
|
||||
|
@ -10,6 +10,7 @@ Volcanos("page", {
|
||||
},
|
||||
set: function(can, target, key, condition) { return (condition? this.add(can, target, key): this.del(can, target, key)).indexOf(key) > -1 },
|
||||
neg: function(can, target, key) { return (this.has(can, target, key)? this.del(can, target, key): this.add(can, target, key)).indexOf(key) > -1 },
|
||||
tag: function(can, target) { return [document.body.tagName.toLowerCase()].concat(document.body.classList).join(lex.PT) }
|
||||
},
|
||||
SelectArgs: function(can, target, key, cb) {
|
||||
if (can.base.isUndefined(target)) { return can.page.SelectArgs(can, can._option, "").concat(can.page.SelectArgs(can, can._action, "")) }
|
||||
|
@ -77,6 +77,7 @@ Volcanos("user", {
|
||||
code.XTERM, "终端", code.INNER, "源码", chat.IFRAME, "浏览", chat.LOCATION, "地图",
|
||||
html.PLUGIN, "插件", html.LABEL, "标签", html.HEIGHT, "高度", html.WIDTH, "宽度", ice.SHOW, "显示", ice.HIDE, "隐藏", chat.PROJECT, "项目", chat.PROFILE, "详情", chat.ACTIONS, "参数",
|
||||
"full", "全屏", "Close", "关闭", "Close Other", "关闭其它",
|
||||
"add", "添加",
|
||||
"confirm", "确定",
|
||||
"today", "今天",
|
||||
)[text]||text
|
||||
|
@ -1,5 +1,5 @@
|
||||
fieldset.Action { min-width:160px; }
|
||||
fieldset.Action>div.action { width:100%; display:none; }
|
||||
fieldset.Action>div.action { width:100%; display:none; background-color:var(--plugin-bg-color); }
|
||||
fieldset.Action>div.action div.item { font-size:1.1rem; padding:10px 20px; }
|
||||
fieldset.Action.tabs>div.action { display:block; }
|
||||
fieldset.Action.tabs>div.output>fieldset>legend { display:none; }
|
||||
|
@ -8,6 +8,7 @@ fieldset.Footer>div.output div.cmd { padding:0; margin-left:10px; position:relat
|
||||
fieldset.Footer>div.output div.cmd>i { position:absolute; left:10px; top:8px; }
|
||||
fieldset.Footer>div.output div.cmd>input[name=cmd] { padding-left:30px; margin-right:0; width:120px; transition:all 1s; }
|
||||
fieldset.Footer>div.output div.cmd>input[name=cmd]:focus { width:320px; transition:all 0.5s; }
|
||||
fieldset.Footer>div.output div.cmd>span.delete { margin-top:5px; }
|
||||
|
||||
.picker { box-shadow:4px 4px 20px 4px #626bd0; }
|
||||
div.view span.keyword { color:#5cadd4; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
(function() { var NTIP = "ntip", NLOG = "nlog", NCMD = "ncmd", NKEY = "nkey"
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.core.Item(can.misc.localStorage(can)).length)
|
||||
can.ondaemon._init(can); if (can.user.mod.isCmd) { return }
|
||||
can.ondaemon._init(can); if (can.user.mod.isCmd) { return } can.Conf("version", can.base.trimPrefix(window._version, "?"))
|
||||
can.onimport._title(can, msg, target), can.onimport._command(can, msg, target)
|
||||
can.onimport._state(can, msg, target), can.onimport._toast(can, msg, target)
|
||||
},
|
||||
@ -8,7 +8,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.
|
||||
if (can.base.contains(item, ice.AT)) { item = '<a href="mailto:'+item+'">'+item+'</a>' }
|
||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE], "", item], title: "联系站长"}])
|
||||
}) },
|
||||
_state: function(can, msg, target) { can.user.isMobile || can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [NTIP, NLOG, NCMD, NKEY]).reverse(), function(item) {
|
||||
_state: function(can, msg, target) { can.user.isMobile || can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [NTIP, NLOG, NCMD, NKEY, "version"]).reverse(), function(item) {
|
||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE]], list: [
|
||||
{text: [item, html.LABEL]}, {text: [": ", html.LABEL]}, {text: [can.Conf(item)||"", "", item]},
|
||||
], onclick: function(event) { can.onexport[item](can) }}])
|
||||
|
@ -8,4 +8,4 @@ fieldset.Header>div.output div.search.title { padding:8px 5px; margin-left:5px;
|
||||
fieldset.Header>div.output div.search>i { position:absolute; left:15px; top:15px; }
|
||||
fieldset.Header>div.output div.search>input { padding-left:30px; margin-right:0; transition:all 1s; }
|
||||
fieldset.Header>div.output div.search>input:focus { width:320px; transition:all 0.5s; }
|
||||
fieldset.Header>div.output div.search>span.delete { margin-left:-20px; }
|
||||
fieldset.Header>div.output div.search>span.delete { margin-left:-20px; margin-top:5px; }
|
@ -115,7 +115,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
function show(skip) { can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.db.tabview[key]
|
||||
can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.sessionStorage(can, SELECT_LINE+nfs.DF+path+file)||can._msg.Option(nfs.LINE)||1}))
|
||||
can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg; can.onexport.hash(can)
|
||||
can.isCmdMode() && can.onexport.title(can, path+file), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView()
|
||||
can.isCmdMode() && can.onexport.title(can, (isIndex()||isSpace()? "": path)+file), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView()
|
||||
if (isSpace()) { can.ui.path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)})) } else if (isIndex()) {
|
||||
can.onimport._tabPath(can, nfs.PT, ice.CMD, can.Option(nfs.FILE), function(p, pre) {
|
||||
can.onimport.tabview(can, "", can.core.Keys(can.base.trimSuffix(pre, nfs.PT), p), ctx.INDEX)
|
||||
|
@ -41,14 +41,14 @@ Volcanos(chat.ONFIGURE, {
|
||||
}, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action)
|
||||
can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) }) }), target)
|
||||
},
|
||||
repos: function(can, target, zone) { can.onimport._zone(can, zone, web.CODE_GIT_STATUS, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, item) { can.onimport.tabview(can, item.path, item.file) }
|
||||
zone._icon(kit.Dict(
|
||||
web.REFRESH, function(event) { sub.Update(event) },
|
||||
code.PULL, function(event) { sub.runAction(event, code.PULL) },
|
||||
code.PUSH, function(event) { sub.runAction(event, code.PUSH) },
|
||||
"=", function() { can.onimport.tabview(can, "", sub._index, ctx.INDEX) },
|
||||
))
|
||||
favor: function(can, target, zone) { can.onimport._zone(can, zone, web.CHAT_FAVOR, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, item, event) { switch (item.type) {
|
||||
case nfs.FILE: var ls = can.onexport.split(can, item.text); can.onimport.tabview(can, ls[0], ls[1]); break
|
||||
case mdb.LINK: can.onimport.tabview(can, "", item.text, web.SPACE); break
|
||||
case ctx.INDEX: can.onimport.tabview(can, "", item.text, ctx.INDEX); break
|
||||
case ssh.SHELL: can.onimport.tabview(can, "", [web.CODE_XTERM, item.text].join(mdb.FS), ctx.INDEX); break
|
||||
case cli.OPENS: can.runAction(event, cli.OPENS, [item.text]); break
|
||||
} }
|
||||
}) },
|
||||
xterm: function(can, target, zone) { can.onimport._zone(can, zone, web.CODE_XTERM, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, item) { can.onimport.tabview(can, "", [web.CODE_XTERM, item.hash, item.name||item.type].join(mdb.FS), ctx.INDEX) }
|
||||
@ -61,15 +61,6 @@ Volcanos(chat.ONFIGURE, {
|
||||
sub.onexport.record = function(sub, value, key) { can.onimport.tabview(can, "", value, web.SPACE) }
|
||||
can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) })
|
||||
}) },
|
||||
favor: function(can, target, zone) { can.onimport._zone(can, zone, web.CHAT_FAVOR, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, item, event) { switch (item.type) {
|
||||
case nfs.FILE: var ls = can.onexport.split(can, item.text); can.onimport.tabview(can, ls[0], ls[1]); break
|
||||
case mdb.LINK: can.onimport.tabview(can, "", item.text, web.SPACE); break
|
||||
case ctx.INDEX: can.onimport.tabview(can, "", item.text, ctx.INDEX); break
|
||||
case ssh.SHELL: can.onimport.tabview(can, "", [web.CODE_XTERM, item.text].join(mdb.FS), ctx.INDEX); break
|
||||
case cli.OPENS: can.runAction(event, cli.OPENS, [item.text]); break
|
||||
} }
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "计划", "桌面", "后台", "官网"],
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) {
|
||||
|
@ -17,6 +17,7 @@ fieldset.word>div.output svg.story[data-index] text { cursor:pointer; }
|
||||
fieldset.word>div.output input.story[type=button] { font-family:system-ui; font-weight:bold; padding:20px 40px; margin:10px; height:64px; }
|
||||
fieldset.word>div.output fieldset.web.code.inner.output div.output td.line { border-right:gray solid 1px; }
|
||||
fieldset.word>div.output fieldset.story { margin:20px 0; }
|
||||
fieldset.word>div.output fieldset.story>form.option>div.icon.delete { display:none; }
|
||||
|
||||
fieldset.word>div.navmenu { background-color:inherit; overflow:auto; min-width:120px; clear:both; float:left; }
|
||||
fieldset.word>div.navmenu div.list { margin-left:20px; }
|
||||
|
@ -84,13 +84,10 @@ Volcanos(chat.ONACTION, {list: [
|
||||
ctx.STYLE, can.base.Copy({}, can._target.style, html.LEFT, html.TOP, html.RIGHT, html.BOTTOM), save(),
|
||||
)), can.onimport.size(can, can.ConfHeight()+can.onexport.actionHeight(can)+can.onexport.statusHeight(can), can.ConfWidth(), false, mode)
|
||||
} else { var back = (can._mode_list = can._mode_list||[]).pop(); if (!back) { return }
|
||||
can.ConfHeight(back.height), can.ConfWidth(back.width), can.Mode(back.mode),
|
||||
can.onmotion.toggle(can, can._action, back.action), can.onmotion.toggle(can, can._status, back.status)
|
||||
can.page.style(can, can._output, back.output), can.page.style(can, can._target, back.style), can.base.isFunc(load) && load(back)
|
||||
if (!sub) { return }
|
||||
sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.Mode(can.Mode()), sub.onlayout._init(sub)
|
||||
can._target.click()
|
||||
can.page.ClassList.del(can, can._target, "move")
|
||||
can.onimport.size(can, back.height+can.onexport.actionHeight(can)+can.onexport.statusHeight(can), back.width, false, mode)
|
||||
can.page.style(can, can._target, html.LEFT, back.style.left, html.TOP, back.style.top)
|
||||
can.base.isFunc(load) && load(back)
|
||||
}
|
||||
},
|
||||
"刷新界面": function(event, can) { var sub = can._outputs[0]; sub.onlayout._init(sub), can.user.toastSuccess(can) },
|
||||
@ -103,7 +100,7 @@ Volcanos(chat.ONACTION, {list: [
|
||||
can.ConfHeight(can.page.height()/2-can.onexport.actionHeight(can)-can.onexport.statusHeight(can)), can.ConfWidth(can.page.width()/(can.user.isMobile? 1: 2))
|
||||
}) },
|
||||
"切换全屏": function(event, can, button, sub) { can.onaction._switch(can, sub, chat.FULL, function() { can.page.style(can, can._target, html.LEFT, "", html.TOP, can.onexport.marginTop(), html.BOTTOM, "")
|
||||
can.ConfHeight(can.page.height()-can.onexport.marginTop()-can.onexport.actionHeight(can)-can.onexport.statusHeight(can)), can.ConfWidth(can.page.width())
|
||||
can.ConfHeight(can.page.height()-can.onexport.marginTop()-can.onexport.actionHeight(can)-can.onexport.statusHeight(can)-can.onexport.marginBottom(can)), can.ConfWidth(can.page.width())
|
||||
}) },
|
||||
"远程控制": function(event, can) { can.onaction.keyboard(event, can) },
|
||||
"共享工具": function(event, can) { var meta = can.Conf(); can.onmotion.share(event, can, [
|
||||
@ -197,10 +194,8 @@ Volcanos(chat.ONACTION, {list: [
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
args: function(can) { return can.page.SelectArgs(can, can._option, "", function(target) { return target.value }) },
|
||||
output: function(can, msg) {},
|
||||
action: function(can, button, line) {},
|
||||
record: function(can, value, key, line) {},
|
||||
marginTop: function() { return 0 },
|
||||
output: function(can, msg) {}, action: function(can, button, line) {}, record: function(can, value, key, line) {},
|
||||
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 },
|
||||
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 },
|
||||
title: function(can, title) { can.isCmdMode() && can.user.title(title) },
|
||||
|
@ -2,7 +2,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
if (can.Mode() == html.ZONE) { return can.onimport._vimer_zone(can, msg, target) }
|
||||
var cbs = can.onimport[can.Conf(ctx.STYLE)||msg.Option(ctx.STYLE)]; if (can.base.isFunc(cbs)) {
|
||||
can.onappend.style(can, can._args[ctx.STYLE], target), can.core.CallFunc(cbs, {can: can, msg: msg, target: target})
|
||||
} else { can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target), can.onmotion.story.auto(can, target) }
|
||||
} else {
|
||||
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target), can.onmotion.story.auto(can, target)
|
||||
}
|
||||
},
|
||||
_vimer_zone: function(can, msg, target) { msg.Table(function(value) { var action = []
|
||||
can.page.Select(can, can.page.Create(can, html.DIV, value.action), html.INPUT, function(target) {
|
||||
|
13
proto.js
13
proto.js
@ -393,18 +393,17 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
|
||||
})
|
||||
try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta
|
||||
meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth
|
||||
meta.version = window._version
|
||||
var debug = location.search.indexOf("debug=true") > 0 && (window.parent.outerWidth-window.parent.innerWidth < 100)
|
||||
if (window.parent.outerWidth - window.parent.innerWidth > 100) { meta.version = "", debug = false }
|
||||
meta._load = function(url, cb) { var v = (meta.version||"")+(debug? "&_tt="+(new Date()).getTime(): "")
|
||||
meta.version = window._version+(debug? "&_tt="+(new Date()).getTime(): "")
|
||||
meta._load = function(url, cb) {
|
||||
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
|
||||
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+v, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
|
||||
default: var item = document.createElement(nfs.SCRIPT); item.src = url+v, item.onerror = cb, item.onload = cb, document.body.appendChild(item)
|
||||
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
|
||||
default: var item = document.createElement(nfs.SCRIPT); item.src = url+meta.version, item.onerror = cb, item.onload = cb, document.body.appendChild(item)
|
||||
}
|
||||
}
|
||||
meta._init = function(can) {
|
||||
window.onmousemove = function(event) { window._mousemove && (window._mousemove(event)) }
|
||||
window.onmouseup = function(event) { delete(window._mousemove) }
|
||||
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 == lang.ESCAPE && !can.page.tagis(event.target, html.INPUT)) { can.onkeymap.prevent(event) } }
|
||||
window.onerror = function(message, source, lineno, colno, error) { meta.version? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user