diff --git a/frame.js b/frame.js index ec69df8e..8bf94993 100644 --- a/frame.js +++ b/frame.js @@ -264,8 +264,6 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { {type: html.TEXTAREA, style: [INPUT_STYLE]}, {type: html.TEXTAREA, style: _b_r(0)}, {type: html.FORM_OPTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]}, {type: html.FORM_OPTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]}, - {type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]}, - {type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]}, {type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}, {type: html.DIV_STATUS, style: kit.Dict(_bg(color.plugin), _fg(color.label))}, {type: html.DIV_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.DIV_ITEM, style: [ITEM_HOVER_STYLE]}, {type: html.SPAN_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.SPAN_ITEM, style: [ITEM_HOVER_STYLE]}, @@ -274,7 +272,6 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { {type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: _fg(color.text)}]}, {type: html.DIV_TABS, list: [{type: html.DIV, name: [html.SELECT], style: [OUTPUT_STYLE]}]}, {type: html.DIV_PATH, style: [OUTPUT_STYLE]}, {type: html.DIV_PATH, list: [{type: html.SPAN, style: [ITEM_HOVER_STYLE]}]}, - // {type: html.DIV_CODE, style: {border: color.border+SOLID}}, {type: html.DIV_PLUG, list: [{type: html.LEGEND, style: [OUTPUT_STYLE]}]}, {type: html.DIV_PLUG, list: [{type: html.LEGEND, name: [html.SELECT], style: [PLUGIN_STYLE]}]}, {type: "div.zone>div.item", style: [TABLE_HEAD_STYLE]}, {type: "div.zone>div.item", style: [TABLE_HEAD_HOVER_STYLE]}, @@ -291,9 +288,6 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { {type: html.H1, style: [ITEM_HOVER_STYLE]}, {type: html.H2, style: [ITEM_HOVER_STYLE]}, {type: html.H3, style: [ITEM_HOVER_STYLE]}, {type: html.A, style: _fg(color.info)}, {type: html.LABEL, style: _fg(color.label)}, {type: html.FIELDSET_PANEL, style: [PANEL_STYLE]}, {type: html.FIELDSET_PANEL+ice.GT+html.DIV_OUTPUT, style: [PANEL_STYLE]}, - // {type: html.FIELDSET_PANEL, name: [chat.HEADER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]}, - {type: html.FIELDSET_PANEL, name: [chat.FOOTER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]}, - {type: html.FIELDSET_PANEL, name: [chat.FOOTER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV_TOAST, style: [TABLE_HEAD_STYLE]}], }]}, {type: html.FIELDSET_PANEL, name: [chat.ACTION], list: [{type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}]}, {type: html.FIELDSET_PLUGIN, style: [PLUGIN_STYLE]}, {type: html.FIELDSET_PLUGIN, list: [{type: ice.GT+html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, {type: html.FIELDSET_STORY, style: [PLUGIN_STYLE]}, {type: html.FIELDSET_STORY, list: [{type: ice.GT+html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, @@ -328,7 +322,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { }).length+" lines") } } icon.push({icon: mdb.DELETE, onclick: function(event) { _input.value = "", item.name == html.FILTER && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) }) }}) } 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 _input = can.page.Append(can, target, [{view: [[html.ITEM, item.type, item.name].concat(style)], list: [input].concat(icon), _init: function(target, _input) { + var _input = can.page.Append(can, target, [{view: [[html.ITEM].concat(style, [item.type, item.name])], list: [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) } }}])[item.name]; return _input }, diff --git a/index.css b/index.css index 888a6768..f4a95584 100644 --- a/index.css +++ b/index.css @@ -63,7 +63,8 @@ fieldset.simple>legend { display:none; } fieldset.simple>form.option { display:none; } fieldset.simple>div.status { display:none; } fieldset.simple div.toggle { display:none; } -fieldset.float { background-color:#061c3c9e; } +fieldset.float { background-color:#061c3ceb; } +fieldset.full { background-color:#061c3ceb; } fieldset.full { position:fixed; left:0; top:0; } /* input */ fieldset.input>legend { display:none; } @@ -85,7 +86,7 @@ fieldset.input.date div.output td span.lunar.term { color:green; } fieldset.input.date div.output td span.lunar.fest { color:red; } fieldset.input.date div.status { text-align:center; } /* float */ -body div.float { background-color:#0e3369b3; padding:5px; overflow:auto; } +body div.float { background-color:#061c3ceb; padding:5px; overflow:auto; } body>div.toast div.title { color:blue; float:left; } body>div.toast div.duration { color:gray; float:right; } body>div.toast div.content { color:blue; text-align:center; } @@ -171,6 +172,7 @@ div.item:hover, div.item.select, span.item:hover, table.content tr:hover, table. div.carte div.item:hover, table.content th:hover, table.content td:hover, table.content td.select { background-color:cornflowerblue; } div.story[data-type=spark] span:hover { background-color:deepskyblue; box-shadow:4px 4px 20px 4px #29318e; } select, input[type=text], textarea { box-shadow:4px 4px 20px 4px #626bd0; } +body.black input[type=text], body.black textarea { background-color:#243783bd; color:white; outline:none; } legend, select, input[type=button], div.tabs, div.item, span.item, th, td, h1, h2, h3 { cursor:pointer; } div.title, div.story[data-type=spark] { cursor:copy; } /* theme */ diff --git a/panel/action.css b/panel/action.css index 2785494e..be9537bf 100644 --- a/panel/action.css +++ b/panel/action.css @@ -1,17 +1,10 @@ fieldset.Action { min-width:160px; } -fieldset.Action>div.action { background-color:#4682b46b; width:100%; display:none; } -fieldset.Action>div.action div.tabs { font-size:1.1rem; padding:5px 20px; } -fieldset.Action>div.action div.tabs.select { background-color:#6495ed63; } -fieldset.Action>div.action div.tabs:hover { background-color:#6495ed63; } +fieldset.Action>div.action { width:100%; display:none; } +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; } fieldset.Action.tabs>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Header div.Action { display:contents; } -fieldset.Header div.Action>div.tabs:not(.hide) { margin-left:20px; display:contents; float:left; } -fieldset.Header div.Action>div.tabs:hover { background-color:unset; } -fieldset.Header div.tabs>div.tabs { background-color:unset; padding:14px; float:left; } -fieldset.Header div.tabs>div.tabs:hover { background-color:#6495ed63; color:white; } -fieldset.Header div.tabs>div.tabs.select { background-color:#6495ed63; color:white; } fieldset.Action.tabview>div.output>fieldset.plugin:not(.select) { display:none; } fieldset.Action.vertical>div.output>fieldset.plugin { float:left; } fieldset.Action.horizon>div.output>fieldset.plugin { float:left; } @@ -29,5 +22,5 @@ fieldset.Action>div.project.toggle { background-color:#4a566e6e; color:white; wi fieldset.Action.tabview>div.project.toggle { display:none; } fieldset.Action.vertical>div.project.toggle { display:none; } fieldset.Action.horizon>div.project.toggle { display:none; } -fieldset.Action.grid>div.project.toggle { display:none; } fieldset.Action.free>div.project.toggle { display:none; } +fieldset.Action.grid>div.project.toggle { display:none; } diff --git a/panel/action.js b/panel/action.js index c08e0941..aa5a9b39 100644 --- a/panel/action.js +++ b/panel/action.js @@ -14,8 +14,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R can.Conf(chat.RIVER, web.SHARE, chat.STORM, share), can.onimport._init(can, msg) }) }, _tabs: function(can, sub, meta) { - var tabs = [{view: [html.TABS, "", meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_TABS, sub._header_tabs) - can.onmotion.select(can, can._action, html.DIV_TABS, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) + var tabs = [{view: [html.ITEM, "", meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_ITEM, sub._header_tabs) + can.onmotion.select(can, can._action, html.DIV_ITEM, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target) if (sub._delay_refresh) { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), can.onexport.isauto(can)) } can.onexport.layout(can) == FREE || (can._output.scrollTop = sub._target.offsetTop-html.PLUGIN_MARGIN) can.onexport.layout(can) && can.misc.SearchHash(can, can.Conf(chat.RIVER), can.Conf(chat.STORM), meta.index) @@ -71,7 +71,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { if (arg[0] == ctx.COMMAND) { can.onexport.command(can, msg, arg, fields) } }, onkeydown: function(can, msg, model) { if (can.isCmdMode() && !msg._event.metaKey) { return } - if (can.onkeymap.selectCtrlN(msg._event, can, can._action, html.DIV_TABS)) { return } + if (can.onkeymap.selectCtrlN(msg._event, can, can._action, html.DIV_ITEM)) { return } can._keylist = can.onkeymap._parse(msg._event, can, model, can._keylist||[], can._output) }, onresize: function(can) { can.onaction.layout(can), window.setsize && window.setsize(can.page.width(), can.page.height()) }, @@ -89,11 +89,11 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { Volcanos(chat.ONLAYOUT, { tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)+html.ACTION_MARGIN), can.ConfWidth(width-can.Conf(html.MARGIN_X)) }) can.core.List(can._plugins, function(sub) { sub._delay_refresh = true }) - can.onmotion.select(can, can._action, html.DIV_TABS, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return 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) }) 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_TABS, can.onmotion.select(can, can._action, html.DIV_TABS)||0, function(target) { target.click() }); return 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 }, horizon: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }) }, vertical: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }) }, diff --git a/panel/footer.css b/panel/footer.css index 84267bf5..e02be23d 100644 --- a/panel/footer.css +++ b/panel/footer.css @@ -1,16 +1,12 @@ -fieldset.Footer>div.output { padding:0; height:32px; } -fieldset.Footer>div.output div { padding:5px; height:32px; cursor:pointer; } -fieldset.Footer>div.output div:hover { background-color:#2e515f; } +fieldset.Footer>div.output { height:32px; } +fieldset.Footer>div.output div.item { padding:7px; cursor:pointer; float:left; } fieldset.Footer>div.output div.title:first-child { text-align:center; margin-right:10px; width:230px; } -fieldset.Footer>div.output div.title { float:left; } fieldset.Footer>div.output div.state { float:right; } fieldset.Footer>div.output div.state label { font-size:12px; } -fieldset.Footer>div.output div.toast { background-color:darkcyan; float:right; } +fieldset.Footer>div.output div.toast { float:right; } fieldset.Footer>div.output div.cmd { padding:0; } -fieldset.Footer>div.output div.cmd>span.delete { top:1px; right:5px; } fieldset.Footer>div.output div.cmd>input[name=cmd] { 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:hover>input[name=cmd] { width:320px; transition:all 0.5s; } .picker { box-shadow:4px 4px 20px 4px #626bd0; } div.view span.keyword { color:#5cadd4; } diff --git a/panel/footer.js b/panel/footer.js index ed0d581e..51dab2de 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -4,17 +4,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can. can.onimport._state(can, msg, target), can.onimport._toast(can, msg, target) }, _title: function(can, msg, target) { can.user.isMobile || can.core.List(can.Conf(chat.TITLE)||msg.result, function(item) { - if (can.base.contains(item, ice.AT)) { - item = ''+item+'' - } - can.page.Append(can, target, [{view: [chat.TITLE, "", item], title: "联系站长"}]) + if (can.base.contains(item, ice.AT)) { item = ''+item+'' } + 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) { - can.page.Append(can, target, [{view: chat.STATE, list: [ + 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) }}]) }) }, - _toast: function(can, msg, target) { can.ui.toast = can.page.Append(can, target, [{view: chat.TOAST, onclick: function(event) { can.onexport[NTIP](can) }}])._target }, + _toast: function(can, msg, target) { can.ui.toast = can.page.Append(can, target, [{view: [[html.ITEM, chat.TOAST]], onclick: function(event) { can.onexport[NTIP](can) }}])._target }, _command: function(can, msg, target) { can.onappend.input(can, {type: html.TEXT, name: ice.CMD, onkeydown: function(event) { can.onkeymap.input(event, can) function close() { can.ui.cli && can.ui.cli.onaction.close() } if (event.key == lang.ESCAPE) { return close() } if (event.key != lang.ENTER) { return } close(); switch (event.target.value) { diff --git a/panel/header.css b/panel/header.css index eb8402ed..2caae0cf 100644 --- a/panel/header.css +++ b/panel/header.css @@ -1,17 +1,11 @@ -fieldset.Header>div.output { font-size:1.1rem; line-height:21px; padding:0; height:48px; overflow:hidden; } -// fieldset.Header>div.output { font-size:1.1rem; line-height:21px; padding:0; height:32px; overflow:hidden; } -fieldset.Header>div.output div { float:left; cursor:pointer; } -// fieldset.Header>div.output div { height:32px; float:left; cursor:pointer; } -fieldset.Header>div.output div:hover { background-color:#2e515f; } -fieldset.Header>div.output div.menu { padding:14px; } -fieldset.Header>div.output div.title { padding:14px; } -fieldset.Header>div.output div.title:first-child { font-style:italic; font-weight:bold; text-align:center; margin-right:5px; width:230px; } -fieldset.Header>div.output div.state { padding:14px; float:right; } +fieldset.Header>div.output { font-size:1.1rem; line-height:21px; height:48px; overflow:hidden; } +fieldset.Header>div.output div.item { font-family:unset; padding:13px; float:left; } +fieldset.Header>div.output div.title:first-child { font-style:italic; font-weight:bold; text-align:center; margin-right:5px; width:230px; cursor:pointer; } +fieldset.Header>div.output div.state { float:right; } fieldset.Header>div.output div.state.time { margin-left:10px; } -fieldset.Header>div.output div.state.avatar { padding:0; height:48px; } +fieldset.Header>div.output div.state.avatar { padding:0; } fieldset.Header>div.output div.state.avatar>img { height:48px; } fieldset.Header>div.output div.search.title { padding:8px 5px; } fieldset.Header>div.output div.search>span.delete { top:10px; right:10px; } fieldset.Header>div.output div.search>input { 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:hover>input { width:320px; transition:all 0.5s; } diff --git a/panel/header.js b/panel/header.js index 467f21a8..0c400f30 100644 --- a/panel/header.js +++ b/panel/header.js @@ -2,13 +2,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onimport._title(can, msg, target), can.onimport._state(can, msg, target), can.onimport._avatar(can, msg, target), can.onimport._background(can, msg, target), can.onimport._search(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: [chat.TITLE, "", item], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}]) + 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) { - if (item == aaa.AVATAR ) { can.user.isLocalFile || can.page.Append(can, target, [{view: [[chat.STATE, item]], list: [{img: ice.SP}], onclick: function(event) { + if (item == aaa.AVATAR ) { can.user.isLocalFile || can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE, item]], list: [{img: ice.SP}], onclick: function(event) { can.onaction.carte(event, can, [can.page.Format(html.IMG, can.onexport.avatar(can), can.page.height()/2)]) }}]); return } - can.page.Append(can, target, [{view: [[chat.STATE, item], "", (can.Conf(item)||msg.Option(item)||"").split(ice.AT)[0].slice(0, 10)], onclick: function(event) { + 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) }}]) }) }, @@ -34,8 +34,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { theme: function(can, theme) { theme && can.misc.localStorage(can, "can.theme", can._theme = theme == ice.AUTO? "": theme), can.user.theme(can, can.onexport.theme(can)) }, menu: function(can, cmds, cb, trans) { can.base.isString(cmds) && (cmds = [cmds]) return can.page.Append(can, can._output, [{view: cmds[0], list: can.core.List(can.base.getValid(cmds.slice(1), [cmds[0]]), function(item) { - return can.base.isString(item)? /* 1.string */ {view: [html.MENU, "", can.user.trans(can, item, trans)], onclick: function(event) { can.base.isFunc(cb) && cb(event, item, [item]) }}: - can.base.isArray(item)? /* 2.array */ {view: [html.MENU, "", can.user.trans(can, item[0], trans)], onclick: function(event) { can.onkeymap.prevent(event) + return can.base.isString(item)? /* 1.string */ {view: [[html.ITEM, html.MENU], "", can.user.trans(can, item, trans)], onclick: function(event) { can.base.isFunc(cb) && cb(event, item, [item]) }}: + can.base.isArray(item)? /* 2.array */ {view: [[html.ITEM, html.MENU], "", can.user.trans(can, item[0], trans)], onclick: function(event) { can.onkeymap.prevent(event) can.onaction.carte(event, can, item.slice(1), function(event, button, meta) { can.base.isFunc(cb) && cb(event, button, item) }, trans) }}: /* 3.others */ item }) }])._target diff --git a/panel/river.css b/panel/river.css index cb130083..d3d5caba 100644 --- a/panel/river.css +++ b/panel/river.css @@ -1,9 +1,5 @@ -fieldset.River { width:230px; float:left; margin-left:0; } -fieldset.River>div.action { padding:0 10px; width:100%; display:flex; justify-content:center; } -// fieldset.River>div.action>div.item { text-align:center; flex:2; } -fieldset.River>div.output { width:230px; } +fieldset.River { width:230px; float:left; } +fieldset.River>div.action { width:100%; display:flex; justify-content:center; } fieldset.River>div.output div.item { padding:10px 20px; border-left:solid 3px #00ffae; } -// fieldset.River>div.output div.item { padding:3px 16px; border-left:solid 3px #00ffae; } fieldset.River>div.output div.list div.item { border-left:solid 3px #ccdc4c; } -fieldset.River>div.output div.list { padding-left:5px; margin-left:8px; } -fieldset.River>div.output div.list.hide { height:0; display:block; overflow:hidden; } +fieldset.River>div.output div.list { margin-left:20px; } diff --git a/panel/search.css b/panel/search.css index 7ef1c506..18f408a2 100644 --- a/panel/search.css +++ b/panel/search.css @@ -1,4 +1,3 @@ -fieldset.Search { background-color:#041a25bd; padding:10px; position:fixed; left:230px; top:32px; } -fieldset.Search>div.action>div.item.filter>input { width:320px; } +fieldset.Search { background-color:#061c3ceb; padding:10px; position:fixed; left:230px; top:32px; } +fieldset.Search>div.action>div.item.filter>input { margin-right:0; width:320px; } fieldset.Search>div.output table.content { width:100%; } -fieldset.Search>div.status { display:block; } diff --git a/plugin/input/key.js b/plugin/input/key.js index e1e78ca3..6ae322e6 100644 --- a/plugin/input/key.js +++ b/plugin/input/key.js @@ -7,7 +7,8 @@ Volcanos(chat.ONFIGURE, {key: { if (can.base.isIn(msg.append[msg.append.length-1], ctx.ACTION, "cb")) { msg.append = msg.append.slice(0, -1) } can.onmotion.clear(can), can.onappend.table(can, msg, function(value, key, index, item) { value = item[key] return {text: [value, html.TD, value == ""? html.HR: ""], style: msg.append && msg.append.length == 1? kit.Dict(html.MIN_WIDTH, target.offsetWidth-16): {}, onclick: function(event) { - can.close(); if (msg.cb && msg.cb[index]) { return msg.cb[index](value) } cb(can, value, target.value) + can.close(); var cb = can.Conf("select"); if (cb) { return cb(target.value = value) } + if (msg.cb && msg.cb[index]) { return msg.cb[index](value) } cb(can, value, target.value) msg.Option(ice.MSG_PROCESS) == ice.PROCESS_AGAIN && can.onmotion.delay(can, function() { can._load(event, can, cb, target, name, value) }) }} }), can.onappend._status(can, [mdb.TOTAL, mdb.INDEX]), can.Status(mdb.TOTAL, msg.Length()) @@ -22,7 +23,7 @@ Volcanos(chat.ONFIGURE, {key: { onkeydown: function(event, can, meta, cb, target, sub, last) { if (event.key == lang.ENTER) { return meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event, target.value)? sub.close(): last(event) } if (!sub) { return } - sub.hidden() || can.onkeymap.selectCtrlN(event, can, sub._output, "tr:not(.hidden)>td:first-child", function(td) { return cb(sub, td.innerText, target.value), td }) || can.onmotion.delayOnce(can, function() { - can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target) }, target.value.length < 3? 500: 150) + sub.hidden() || can.onkeymap.selectCtrlN(event, can, sub._output, "tr:not(.hidden)>td:first-child", function(td) { return meta.select && (sub.close(), meta.select(target.value = td.innerText)), cb(sub, td.innerText, target.value), td }) + || can.onmotion.delayOnce(can, function() { can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target) }, target.value.length < 3? 500: 150) }, }}) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index b6a65491..02942580 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -29,7 +29,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl } } }) }) } var args = can.misc.SearchHash(can); can.db.tabview[can.onexport.keys(can)] = msg - can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() { if (!can.user.isWebview && args.length > 0) { + can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() { if (!can.user.isWebview && args.length > 0 && can.isCmdMode()) { can.onimport._tabview(can, args[args.length-3]||can.Option(nfs.PATH), args[args.length-2]||can.Option(nfs.FILE), args[args.length-1]) } }), can.base.isFunc(cb) && cb(msg) }, @@ -164,7 +164,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl can.onmotion.toggle(can, can.ui.profile, true), can.db.profile_size[can.onexport.keys(can)] = 0.8, can.onimport.layout(can) } else { can.ui.profile = _msg._profile = can.ui._profile var height = can.ui.profile.offsetHeight||can.ui.content.offsetHeight - var width = can.onexport.size(can, can.db.profile_size[can.onexport.keys(can)]||0.5, can.ConfWidth()-can.ui.project.offsetWidth) + var per = 0.5 + if (msg.Append(ctx.INDEX) == web.WIKI_WORD) { + per = 0.6 + } + var width = can.onexport.size(can, can.db.profile_size[can.onexport.keys(can)]||per, can.ConfWidth()-can.ui.project.offsetWidth) can.onimport.process(can, msg, can.ui.profile, height, width, function(sub) { var _width = can.base.Max(sub._target.offsetWidth, width) can.db.profile_size[can.onexport.keys(can)] = _width, can.onimport.layout(can), sub.onimport.size(sub, height, _width, true) can.ui.profile._plugin = can._msg._profile = sub @@ -429,14 +433,16 @@ Volcanos(chat.ONACTION, {list: ["调试", "首页", "官网", "源码", "百度" }, open: function(event, can) { var paths = can.core.List(can.db.paths, function(item) { if (can.base.endWith(item, "-story/", "-dict/")) { return } return item }).join(ice.FS) - // paths = "src/,usr/icebergs/,usr/volcanos/" - var input = can.user.input(can.request(event, {paths: paths}), can, [{name: nfs.FILE, style: {width: can.ui.content.offsetWidth/2}, run: function(event, cmds, cb) { + var input = can.user.input(can.request(event, {paths: paths}), can, [{name: nfs.FILE, style: {width: can.ui.content.offsetWidth/2}, select: function(item) { + input.submit(event, can, "submit") + }, run: function(event, cmds, cb) { can.run(can.request(event, {paths: paths}), cmds, function(msg) { if (cmds[0] == ctx.ACTION && cmds[1] == mdb.INPUTS) { var _msg = can.onengine.signal(can, "tabview.open.inputs"), func = can.onexport.func(can) can.core.Item(can.db.tabview, function(key) { var ls = can.core.Split(key, ice.DF); _msg.Push(nfs.PATH, ls[0]+ls[1]) }) - can.core.List(func.list, function(item) { var ls = can.core.Split(item, ice.DF, ice.DF); _msg.Push(nfs.PATH, "line:"+ls[1]+ice.DF+ls[0]) }) + _msg.Copy(msg) can.core.Item(can.onengine.plugin.meta, function(key, value) { _msg.Push(nfs.PATH, "index:can."+key) }) - _msg.Copy(msg), cb(_msg) + can.core.List(func.list, function(item) { var ls = can.core.Split(item, ice.DF, ice.DF); _msg.Push(nfs.PATH, "line:"+ls[1]+ice.DF+ls[0]) }) + cb(_msg) } else { cb(msg) } }, true) }}], function(list, input) { input.cancel(); var ls = can.core.Split(list[0], ice.DF, ice.DF); switch (ls[0]) { @@ -445,8 +451,8 @@ Volcanos(chat.ONACTION, {list: ["调试", "首页", "官网", "源码", "百度" case web.DREAM: return can.onimport.tabview(can, can.Option(nfs.PATH), ls[1], ls[0]) case nfs.LINE: return can.onaction.selectLine(can, parseInt(ls[1]), true) default: can.core.List(can.db.paths, function(path) { if (list[0].indexOf(path) == 0) { can.onimport.tabview(can, path, list[0].slice(path.length)) } }) - } })._target; can.page.Modify(can, input, {"className": "input vimer open float"}) - can.page.style(can, input, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/4-34, html.TOP, can.ui.content.offsetHeight/4, html.RIGHT, "") + } }); can.page.Modify(can, input._target, {"className": "input vimer open float"}) + can.page.style(can, input._target, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/4-34, html.TOP, can.ui.content.offsetHeight/4, html.RIGHT, "") }, find: function(event, can) { var ui = can.page.Append(can, can._output, [{view: "vimer find float", list: [html.ACTION, html.OUTPUT], diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 80ab1b21..5e9443c5 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -49,6 +49,7 @@ Volcanos(chat.ONFIGURE, { case nfs.FILE: var ls = can.onexport.split(can, item.text); can.onimport.tabview(can, ls[0], ls[1]); 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(","), ctx.INDEX); break + case "_open": can.runAction(event, "_open", [item.text]); break } } }) }, dream: function(can, target, zone) { can.onimport._zone(can, zone, web.DREAM, function(sub, msg) {