mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt some
This commit is contained in:
parent
52a02bef40
commit
8d4d047ca0
7
frame.js
7
frame.js
@ -202,6 +202,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.base.isUndefined(item) || can.onappend.input(can, item == ""? /* 1.空白 */ {type: html.BR}:
|
||||
can.base.isString(item)? /* 2.按键 */ {type: html.BUTTON, name: item, value: can.user.trans(can, item, meta._trans), onclick: function(event) {
|
||||
run(event, item)
|
||||
}, ondlbclick: function(event) {
|
||||
can.onkeymap.prevent(event)
|
||||
}}: item.length > 0? /* 3.列表 */ {type: html.SELECT, name: item[0], values: item.slice(1), onchange: function(event) { can.misc.Event(event, can, function(msg) {
|
||||
var button = event.target.value; meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button] && can.core.CallFunc(meta[button], [event, can, button])
|
||||
}) }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) {
|
||||
@ -465,8 +467,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}, target||can._output, field)
|
||||
},
|
||||
_float: function(can, index, args, cb) { can.onappend.plugin(can, {index: index, args: args, mode: chat.FLOAT}, function(sub) {
|
||||
can.getActionSize(function(left, top, width, height) { sub.onimport.size(sub, sub.ConfHeight(height*3/4)-html.ACTION_HEIGHT, sub.ConfWidth(width), true)
|
||||
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4}), can.base.isFunc(cb) && cb(sub)
|
||||
can.getActionSize(function(left, top, width, height) { var offset = can.user.isMobile? 0: height/4
|
||||
sub.onimport.size(sub, sub.ConfHeight(height-offset)-html.ACTION_HEIGHT, sub.ConfWidth(width), true)
|
||||
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+offset}), can.base.isFunc(cb) && cb(sub)
|
||||
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
|
||||
}, can._root._target) },
|
||||
figure: function(can, meta, target, cb) { if (meta.type == html.SELECT || meta.type == html.BUTTON) { return }
|
||||
|
58
index.css
58
index.css
@ -157,8 +157,6 @@ fieldset.story>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.float>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.full>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.cmd>form.option>div.button.icons>input { display:none; }
|
||||
body.mobile fieldset>form.option>div.button.icons>input { display:none; }
|
||||
body.mobile fieldset>form.option>div.button>span.icon { line-height:38px; font-size:38px; height:38px; }
|
||||
body.windows form.option>div.icon { font-size:21px; }
|
||||
body.windows fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.website.icon { line-height:36px; }
|
||||
/* svg */
|
||||
@ -240,6 +238,7 @@ fieldset>div.layout { clear:both; }
|
||||
fieldset>div.output>div.project>div.item.filter { padding:0; }
|
||||
fieldset>div.output>div.project { border-right:gray solid 1px; min-width:120px; max-width:240px; }
|
||||
fieldset>div.output div.profile { border-left:gray solid 1px; max-width:240px; }
|
||||
fieldset.Search>div.output>div.profile { border-left:none; }
|
||||
fieldset>div.output div.display { border-top:gray solid 1px; }
|
||||
/* hover */
|
||||
legend:hover { background-color:skyblue; }
|
||||
@ -318,34 +317,48 @@ body.print fieldset.draw div.output { background-color:lightgray; }
|
||||
body.print fieldset.draw div.output div.content svg { background-color:lightgray; }
|
||||
body.dark ::selection { background-color:#033a3a; }
|
||||
/* mobile */
|
||||
body.mobile legend { font-size:1.6rem; height:38px; }
|
||||
body.mobile select { font-size:1.4rem; height:38px; }
|
||||
body.mobile input { font-size:1.2rem; height:38px; }
|
||||
body.mobile textarea { font-size:1.2rem; }
|
||||
body.mobile form.option>div.item { margin:0; height:38px; }
|
||||
body.mobile form.option>div.item.icon { font-size:38px; padding:5px 10px; }
|
||||
body.mobile legend { font-size:1.4rem; height:32px; }
|
||||
body.mobile input:not([type=file]) { margin-right:0px; }
|
||||
body.mobile form.option>div.item { margin:0; height:32px; }
|
||||
body.mobile form.option>div.item.icon { font-size:32px; padding:2px 4px; }
|
||||
body.mobile form.option>div.item.icon.prev { font-size:26px; }
|
||||
body.mobile form.option>div.item.icon.next { font-size:26px; }
|
||||
body.mobile form.option>div.item.textarea { height:unset; }
|
||||
body.mobile div.action>div.item { margin:0; height:38px; }
|
||||
body.mobile div.carte div.item { font-size:1.6rem; }
|
||||
body.mobile form.option>div.item.button>input { display:none; }
|
||||
body.mobile form.option>div.button.icons>input { display:none; }
|
||||
body.mobile form.option>div.button>span.icon { line-height:32px; font-size:32px; height:32px; }
|
||||
body.mobile fieldset>div.status { max-height:32px; }
|
||||
body.mobile div.item.text>span.icon.delete { top:4px; }
|
||||
body.mobile div.action>div.item { margin:0; height:32px; }
|
||||
body.mobile div.carte div.item { padding:10px; }
|
||||
body.mobile table.content th { padding:6px; }
|
||||
body.mobile table.content { width:100%; }
|
||||
body.mobile fieldset:not(.panel):not(.input):not(.play)>div.action { display:none; }
|
||||
body.mobile fieldset.plugin>legend { padding:0 20px; border:none; }
|
||||
body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd) { margin:10px 0; }
|
||||
body.mobile fieldset.Action>div.output>fieldset.plugin:not(.float):not(.full):not(.cmd)>legend { margin:10px; }
|
||||
body.mobile fieldset.Header { padding:0; width:100%; position:fixed; top:0; }
|
||||
body.mobile fieldset.Header>div.output { font-size:1.6rem; line-height:3rem; height:3rem; }
|
||||
body.mobile fieldset.Header div.output div.search { padding:0; height:3rem; width:100%; margin:0; }
|
||||
body.mobile fieldset.Header>div.output { font-size:1.4rem; line-height:48px; height:48px; }
|
||||
body.mobile fieldset.Header div.output div.search { padding:0; height:48px; width:100%; margin:0; }
|
||||
body.mobile fieldset.Header div.output div.search>input { font-size:2.2rem; background-color:#21181838; color:white; height:53px; width:100%; }
|
||||
body.mobile fieldset.River { min-width:240px; position:fixed; top:3rem; z-index:10; }
|
||||
body.mobile fieldset.River>div.output { font-size:1.6rem; width:320px; }
|
||||
body.mobile fieldset.Action { margin-top:3rem; margin-bottom:3rem; }
|
||||
body.mobile fieldset.Action>div.output { overflow-x:hidden; }
|
||||
body.mobile fieldset.Header div.output div.item.text.title.search { display:none; }
|
||||
body.mobile fieldset.Header div.output div.item:not(.avatar) { padding:0px 10px; }
|
||||
body.mobile fieldset.Search>div.action>div.item.filter>input { width:100%; }
|
||||
body.mobile fieldset.River { min-width:240px; position:fixed; top:48px; z-index:10; }
|
||||
body.mobile fieldset.River>div.output { font-size:1.4rem; width:320px; }
|
||||
body.mobile fieldset.Action { margin-top:48px; }
|
||||
// body.mobile fieldset.Action { margin-top:3rem; margin-bottom:3rem; }
|
||||
body.mobile fieldset.Action.cmd { margin-top:0; margin-bottom:0; }
|
||||
body.mobile fieldset.Footer { font-size:1.6rem; height:3rem; width:100%; position:fixed; bottom:0; }
|
||||
body.mobile fieldset.Footer div.output { height:3rem; }
|
||||
body.mobile fieldset.Footer div.output div { height:3rem; }
|
||||
body.mobile fieldset.Footer input[name=cmd] { height:3rem; }
|
||||
body.mobile fieldset.Action>div.output { overflow-x:hidden; }
|
||||
body.mobile fieldset.Action>div.output>fieldset.plugin:not(.output):not(.float):not(.full):not(.cmd) { padding:0px; }
|
||||
body.mobile fieldset.Footer { font-size:1.4rem; height:48px; width:100%; position:fixed; bottom:0; }
|
||||
body.mobile fieldset.Footer div.output { height:48px; }
|
||||
body.mobile fieldset.Footer div.output div { height:48px; }
|
||||
body.mobile fieldset.Footer input[name=cmd] { height:48px; }
|
||||
body.mobile.landscape fieldset.Footer { display:none; }
|
||||
body.mobile fieldset.Footer { display:none; }
|
||||
body.mobile fieldset.input.date div.output td { padding:8px 20px; }
|
||||
body.mobile fieldset.word.float>div.output>div.project { top:38px; }
|
||||
body.mobile fieldset.word.float>div.output>div.project { top:32px; }
|
||||
body.mobile fieldset.word>div.output { overflow-x:hidden; }
|
||||
/* misc */
|
||||
fieldset.cmd>div.item.time { padding:5px 10px; line-height:22px; float:right; }
|
||||
@ -375,7 +388,6 @@ fieldset.web.chat.iframe>div.output { overflow:hidden; }
|
||||
fieldset.qrcode>div.output div.code { padding:0; }
|
||||
fieldset.can.view { font-size:14px; }
|
||||
fieldset.can.data { font-size:14px; }
|
||||
body.mobile fieldset.plugin>legend { border:none; }
|
||||
body.en fieldset.input.date.float>div.action>div.item.select { margin:0 5px; }
|
||||
body.en fieldset.input.date.float>div.action>div.item.select select { width:64px; }
|
||||
body.en fieldset.input.date.float>div.action>div.item.select.year select { width:114px; }
|
||||
@ -405,7 +417,7 @@ div.output.card>div.item>div.title { font-size:1.2rem; font-weight:bold; padding
|
||||
div.output.card>div.item>div.content { padding:10px; height:45px; }
|
||||
div.output.card>div.item>div.action { text-align:right; width:100%; }
|
||||
body.white div.output.card div.item input[type=button] { background-color:transparent; }
|
||||
body.mobile div.output.card div.item { height:160px; float:none; }
|
||||
body.mobile div.output.card div.item { height:160px; width:calc(100% - 20px); float:none; }
|
||||
body.mobile.simple div.output.card div.item { width:100%; }
|
||||
body.mobile.landscape div.output.card div.item { width:auto; float:left; }
|
||||
/* scrollbar */
|
||||
|
@ -30,7 +30,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
can.Conf(html.MARGIN_Y, 4*html.PLUGIN_MARGIN+html.ACTION_MARGIN), can.Conf(html.MARGIN_X, (can.user.isMobile? 2: 4)*html.PLUGIN_MARGIN)
|
||||
can.onengine.listen(can, "ontouchstart", function(msg) { can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }, target)
|
||||
},
|
||||
onsize: function(can, msg, height, width) { can.Conf({height: height-can.Conf(html.MARGIN_Y), width: width-can.Conf(html.MARGIN_X)}) },
|
||||
onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height-can.Conf(html.MARGIN_Y), 240), width: width-can.Conf(html.MARGIN_X)}) },
|
||||
onmain: function(can, msg) { can.onimport._share(can, can.misc.Search(can, web.SHARE)) },
|
||||
onlogin: function(can, msg) { can.onimport._menu(can, msg), can.onkeymap._build(can)
|
||||
can._root.River && can.onmotion.delay(can, function() { if (can.Mode()) { return } var gt = can.page.unicode.next, lt = can.page.unicode.prev, river = can._root.River._target
|
||||
@ -86,7 +86,7 @@ Volcanos(chat.ONLAYOUT, {
|
||||
can.core.List(can._plugins, function(sub) { sub._delay_refresh = true })
|
||||
can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_ITEM)||0, function(target) { target.click() }); return true
|
||||
},
|
||||
tabview: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height+html.ACTION_HEIGHT), can.ConfWidth(width) })
|
||||
tabview: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width) })
|
||||
can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }), can.onmotion.toggle(can, can._header_tabs, true)
|
||||
can.onmotion.select(can, can._action, html.DIV_ITEM, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return true
|
||||
},
|
||||
|
@ -4,10 +4,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
_title: function(can, msg, target) { can.user.isMobile || can.core.List(can.base.getValid(can.Conf(chat.TITLE)||msg.result, ["shylinux.com/x/contexts"]), function(item) {
|
||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE], "", item], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}])
|
||||
}) },
|
||||
_state: function(can, msg, target) { can.user.isMobile || can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) {
|
||||
_state: function(can, msg, target) { can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) {
|
||||
if (item == aaa.AVATAR ) { can.user.isLocalFile || can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE, item]], list: [{img: lex.SP}], onclick: function(event) {
|
||||
can.core.CallFunc([can.onaction, item], [event, can, item])
|
||||
}}]); return }
|
||||
if (can.user.isMobile && item == mdb.TIME) { return }
|
||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE, item], "", (can.Conf(item)||msg.Option(item)||"").split(ice.AT)[0].slice(0, 10)], onclick: function(event) {
|
||||
can.core.CallFunc([can.onaction, item], [event, can, item])
|
||||
}, _init: function(target) { item == mdb.TIME && can.onimport._time(can, target) }}])
|
||||
@ -18,7 +19,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
can._search = can.onappend.input(can, {type: html.TEXT, name: mdb.SEARCH, onkeydown: function(event) { can.onkeymap.input(event, can)
|
||||
event.key == lang.ENTER && can.onengine.signal(can, chat.ONOPENSEARCH, can.request(event, {type: mdb.FOREACH, word: event.target.value||""}))
|
||||
}}, "", target, [chat.TITLE])
|
||||
can.user.isMobile || can.onimport.menu(can, mdb.SEARCH, function() { can.onengine.signal(can, chat.ONOPENSEARCH, can.request(event, {type: mdb.FOREACH, word: can._search.value||""})) })
|
||||
can.onimport.menu(can, mdb.SEARCH, function() { can.onengine.signal(can, chat.ONOPENSEARCH, can.request(event, {type: mdb.FOREACH, word: can._search.value||""})) })
|
||||
},
|
||||
_time: function(can, target) { can.core.Timer({interval: 100}, function() { can.onimport.time(can, target) }), can.onappend.figure(can, {action: "date"}, target) },
|
||||
time: function(can, target) { can.onimport.theme(can), target.innerHTML = can.user.time(can, null, can.Conf(mdb.TIME)||"%H:%M:%S %w") },
|
||||
|
@ -46,7 +46,7 @@ Volcanos(chat.ONACTION, {_init: function(can) { can.onmotion.hidden(can) }, list
|
||||
},
|
||||
plugin: function(event, can, data) { if (can.base.isFunc(data.text)) { return can.onmotion.hidden(can), data.text(event) }
|
||||
var cmd = data.cmd == ctx.COMMAND? can.core.Keys(data.type, data.name.split(lex.SP)[0]): can.core.Keys(data.ctx, data.cmd)
|
||||
var meta = {type: html.PLUGIN, index: cmd||msg.Option(mdb.INDEX), args: cmd == web.WIKI_WORD? [data.name]: []}
|
||||
var meta = {type: chat.STORY, index: cmd||msg.Option(mdb.INDEX), args: cmd == web.WIKI_WORD? [data.name]: []}
|
||||
if (data.type == cli.OPENS) { return can.runAction(event, cli.OPENS, [data.text], null, true) }
|
||||
if (data.type == ssh.SHELL) { meta = {index: web.CODE_XTERM, args: [data.text]} }
|
||||
if (data.type == ctx.INDEX) { meta = {index: data.text.split(mdb.FS)[0], args: data.text.split(mdb.FS).slice(1) } }
|
||||
|
@ -58,13 +58,8 @@ Volcanos(chat.ONDETAIL, {
|
||||
if (tree.list.length > 0 || tree.name.endsWith(can.Conf(lex.SPLIT))) { return tree.hide = !tree.hide, can.onaction[can.Action(ice.VIEW)||"横向"](event, can) }
|
||||
for (var node = tree; node; node = node.last) { can.request(event, node.meta) }
|
||||
can.run(can.request(event, can.Option()), can.base.Obj(can.Conf(lex.PREFIX), []).concat([tree.file||"", tree.name]), function(msg) {
|
||||
if (msg.Length() == 0) { return can.ondetail.plugin(can, web.CODE_INNER, [can._msg.Option(nfs.DIR_ROOT), tree.file, tree.line], code.INNER) }
|
||||
if (msg.Append(mdb.INDEX)) { return msg.Table(function(value) { can.ondetail.plugin(can, value.index, value.args) }) }
|
||||
if (msg.Length() == 0) { return can.onappend._float(can, web.CODE_INNER, [can._msg.Option(nfs.DIR_ROOT), tree.file, tree.line], code.INNER) }
|
||||
if (msg.Append(mdb.INDEX)) { return msg.Table(function(value) { can.onappend._float(can, value.index, value.args) }) }
|
||||
}, true)
|
||||
},
|
||||
plugin: function(can, index, args, prefix) { can.onappend.plugin(can, {mode: chat.FLOAT, index: index, args: args}, function(sub) {
|
||||
can.getActionSize(function(left, top, width, height) { var margin = 100; left = left||0, top = top||0
|
||||
sub.onimport.size(sub, height-margin-html.ACTION_HEIGHT, width, true), can.onmotion.move(can, sub._target, {left: left, top: top+margin})
|
||||
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
|
||||
}) },
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user