diff --git a/const.js b/const.js index 6e2ce989..9e28efdd 100644 --- a/const.js +++ b/const.js @@ -35,6 +35,7 @@ var ice = { PROCESS_REWRITE: "_rewrite", PROCESS_AGAIN: "_again", PROCESS_FIELD: "_field", + PROCESS_HOLD: "_hold", MSG_PREFIX: "_prefix", MSG_METHOD: "_method", diff --git a/frame.js b/frame.js index a468474b..5ae94a49 100644 --- a/frame.js +++ b/frame.js @@ -485,8 +485,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { function calc(item, size, total) { return !ui.size[item]? can.base.isString(size)? parseInt(can.base.trimSuffix(size, "px")): size: ui.size[item] < 1? total*ui.size[item]: ui.size[item] } var defer = [], content_height, content_width; function layout(type, list, height, width) { var _width = width, _height = height; can.core.List(list, function(item) { if (can.base.isArray(item)) { return } if (can.base.isObject(item)) { var meta = item; item = item._index } - var target = ui[item] - if (!can.page.isDisplay(target)) { return } + var target = ui[item]; if (!can.page.isDisplay(target)) { return } if (item == html.CONTENT || item == "main") { return defer.push(function() { can.page.style(can, target, html.HEIGHT, content_height = height, html.WIDTH, content_width = width) }) } if (type == FLOW) { var h = calc(item, target.offsetHeight, height) if (can.base.isObject(meta) && meta.layout) { meta.layout(h, width) } @@ -543,7 +542,10 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { function _cb(sub, value, old) { if (value == old) { return } target.value = value, can.base.isFunc(cb) && cb(sub, value, old) } target.onkeydown = function() { if (event.key == code.ESCAPE && target._can) { return target._can.close(), target.blur() } else if (event.key == code.ENTER) { can.base.isFunc(cb) && cb(event, target.value) } } can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function() { }; target[key] = function(event) { can.misc.Event(event, can, function(msg) { - function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) } + function show(sub, cb) { + can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) + sub.Status(html.HEIGHT, sub._output.offsetHeight), sub.Status(html.WIDTH, sub._output.offsetWidth) + } can.core.CallFunc(on, {event: event, can: can, meta: meta, cb: _cb, target: target, sub: target._can, last: last, cbs: function(cb) { target._can? show(target._can, cb): can.onappend._init(can, {type: html.INPUT, name: input, style: meta.name, mode: chat.FLOAT}, [path], function(sub) { sub.Conf(meta) can.page.Append(can, sub._target, [{text: [can.page.unicode.remove, "", "close"], onclick: function() { sub.close() }}]) diff --git a/index.css b/index.css index 08347b68..0fa1e77b 100644 --- a/index.css +++ b/index.css @@ -132,10 +132,10 @@ body>div.toast div.title { word-break:break-all; color:var(--notice-bg-color); f body>div.toast div.delete { color:var(--notice-bg-color); float:right; cursor:pointer; } body>div.toast div.delete:hover { background-color:var(--hover-bg-color); } body>div.toast div.duration { color:var(--disable-fg-color); float:right; } -body>div.toast div.content { color:var(--notice-bg-color); text-align:center; } +body>div.toast div.content { color:var(--notice-bg-color); text-align:center; min-height:48px; } body>div.toast div.progress { border:var(--box-notice); margin-left:0px; height:20px; clear:both; } body>div.toast div.progress div.current { background-color:var(--progress-bg-color); height:18px; } -body>div.toast div.action { width:100%; display:block; } +body>div.toast div.action:not(.hide) { width:100%; display:block; } body>div.toast div.action>div.item { float:right; } body>div.carte { padding:0; } body>div.carte input[name=filter] { margin:var(--input-margin); width:calc(100% - 10px); position:sticky; top:var(--input-margin); } @@ -235,6 +235,7 @@ div.item.text>input { width:var(--input-width); height:var(--action-height); } div.item.text.id>input { width:var(--button-width); } div.item.text.url>input { width:var(--river-width); } div.item.text.path>input { width:var(--project-width); } +fieldset.story>form.option>div.item.text.path>input { width:var(--input-width); } div.item.text.line>input { width:var(--button-width) !important; } div.item.text.limit>input { width:var(--button-width); } div.item.text.offend>input { width:var(--button-width); } @@ -533,9 +534,10 @@ fieldset.studio>div.output>fieldset>form.option div.icon:nth-child(2) { margin-l fieldset.studio>div.output>fieldset>div.output>table.content { width:100%; } fieldset.studio>div.output>fieldset:not(.select) { display:none; } fieldset.plan div.output div.content>table.content { height:100%; width:100%; } -fieldset.plan>div.output>div.layout>div.layout>div.profile:not(.toggle) { width:unset; } +fieldset.plan>div.output>div.layout>div.layout>div.profile:not(.toggle) { width:unset; flex:unset; } fieldset.plan>div.output>div.layout>div.layout>div.profile input { box-shadow:var(--box-shadow); } fieldset.plan>div.output>div.layout>div.layout>div.profile input:not(:last-child) { margin-right:var(--button-margin); } +fieldset.plan>div.output>div.layout>div.layout { align-items:flex-start; } fieldset.draw div.output svg { margin-bottom:-5px; } fieldset.draw>div.output>div.layout>div.layout>div.profile table { width:100%; } fieldset.draw>form.option>div.item.pid>input { width:var(--button-width) !important; } diff --git a/lib/user.js b/lib/user.js index fcc07ce0..efbe7fd4 100644 --- a/lib/user.js +++ b/lib/user.js @@ -91,7 +91,7 @@ Volcanos("user", { {text: [meta.title||"", html.DIV, html.TITLE], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }}, {view: ["delete", "", can.page.unicode.delete], title: "点击关闭", onclick: function() { action.close() }}, {view: "duration", title: "点击关闭", onclick: function() { action.close() }}, - can.base.isObject(meta.content)? meta.content: {text: [meta.content||"", html.DIV, nfs.CONTENT]}, + can.base.isObject(meta.content)? meta.content: {text: [meta.content||"", html.DIV, [nfs.CONTENT, html.FLEX]]}, html.ACTION, !can.base.isUndefined(meta.progress) && {view: "progress", style: {width: width-2*html.PLUGIN_PADDING}, list: [ {view: "current", style: {width: (meta.progress||0)*(width-2*html.PLUGIN_PADDING-2)/100}}, ]}, @@ -107,6 +107,11 @@ Volcanos("user", { if (index > 30) { ui.duration.innerHTML = index/10+(index%10==0?".0":"")+"s..." } }, function() { action.close() }), _target: ui._target, }); can.onmotion.story.auto(can, ui._target), meta.resize && can.onmotion.delayResize(can, ui._target, meta.resize) + if (meta.action && meta.action.length == 1 && meta.action[0] === "") { + can.page.Select(can, action._target, html.DIV_ACTION, function(target) { + can.onmotion.hidden(can, target) + }) + } return can._toast && (can._toast.close(), delete(can._toast)), can._toast = action }, space: function(can) { return can.Conf(web.SPACE)||can.Conf(ice.POD)||can.misc.Search(can, ice.POD) }, diff --git a/plugin/input/key.js b/plugin/input/key.js index e575b777..3cd4c63f 100644 --- a/plugin/input/key.js +++ b/plugin/input/key.js @@ -20,6 +20,7 @@ Volcanos(chat.ONFIGURE, {key: { can.page.style(can, can._output, html.MAX_HEIGHT, can.page.height()/2, html.MIN_WIDTH, target.offsetWidth, html.MAX_WIDTH, can.Conf("style.width")||can.page.width()/2) msg.append.length == 1 && can.page.ClassList.add(can, can._target, chat.SIMPLE), can.onlayout.figure({target: target}, can, can._target, false, 200) can.onmotion.toggle(can, can._target, can.Status("total") > 0) + can.Status("index", "-1") }, onclick: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return } meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 281615dc..00b31ed0 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -6,16 +6,15 @@ const PROFILE_ARGS = "profile:args:", DISPLAY_ARGS = "display:args:" const CURRENT_FILE = "web.code.inner:currentFile", SELECT_LINE = "selectLine" const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", LINE_SELECT = "tabview.line.select" Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Split(can.Option(nfs.PATH), mdb.FS); can.Option(nfs.PATH, paths[0]) - can.Mode(msg.Option("mode")||can.Mode()), can.Option(nfs.FILE) == " " && can.Option(nfs.FILE, "") + can.Mode(msg.Option("mode")||can.Mode()), can.Option(nfs.FILE) == lex.SP && can.Option(nfs.FILE, "") if (can.Mode() == ice.MSG_RESULT) { msg.result = msg.result||[can._output.innerHTML], can.Mode(chat.SIMPLE), can.sup.Mode(chat.SIMPLE) } can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.endWith(p, "-dict/") || can.base.isIn(p, - nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT, - nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_LEARNING, - // nfs.USR_INTSHELL, + nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT, nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_LEARNING, nfs.USR_INTSHELL, )) { return } if (p && paths.indexOf(p) == -1 && p[0] != nfs.PS) { paths.push(p) } }), can.onmotion.clear(can), can.onappend.style(can, code.INNER), can.sup.onimport._process = function(_can, msg) { + if (msg.OptionProcess() == ice.PROCESS_HOLD) { return true } if (msg.OptionProcess() == ice.PROCESS_REWRITE) { var args = {}, arg = msg._arg; for (var i = 0; i < arg.length; i += 2) { args[arg[i]] = arg[i+1] } can.onimport.tabview(can, args.path, args.file, args.line) @@ -186,7 +185,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp can.ui.profile = _msg._profile = can.page.Append(can, can.ui._profile.parentNode, [{view: [html.PROFILE, html.IFRAME], src: src, style: {height: height, width: width}}])._target can.onmotion.toggle(can, can.ui.profile, true), can.onmotion.delay(can, function() { can.onimport.layout(can)}) } else { - can.page.style(can, can.ui.profile, html.HEIGHT, height, html.WIDTH, width), can.ui.profile = _msg._profile = can.ui._profile + can.page.style(can, can.ui.profile, html.HEIGHT, height, html.WIDTH, width, html.FLEX, "0 0 "+width+"px"), can.ui.profile = _msg._profile = can.ui._profile if (can.ui.profile._plugin && can.base.isIn(msg.Append(ctx.INDEX), web.CODE_XTERM)) { if (can.onexport.session(can, PROFILE_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE))) { return can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can) @@ -276,7 +275,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp can.page.style(can, can.ui.tabs.parentNode, html.WIDTH, can.ui.path.offsetWidth) can.page.style(can, can.ui.display, html.WIDTH, can.ui.path.offsetWidth) can.page.style(can, can.ui.display.parentNode, html.WIDTH, can.ui.path.offsetWidth) - can.ui.zone.source._layout(), can.ui.zone[can.Option(nfs.PATH)] && can.ui.zone[can.Option(nfs.PATH)]._layout() } try { can.isCmdMode() && can._msg._tab.scrollIntoView() } catch (e) {} diff --git a/plugin/state.js b/plugin/state.js index 4b74a07c..01c9c013 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -68,6 +68,7 @@ Volcanos(chat.ONIMPORT, { auto || auto == undefined? (can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height, html.MAX_WIDTH, width), can.page.style(can, can._target, html.HEIGHT, "", html.WIDTH, "")): (can.page.style(can, can._output, html.HEIGHT, height, html.WIDTH, width, html.MAX_HEIGHT, "", html.MAX_WIDTH, ""), can.page.style(can, can._target, html.WIDTH, width)) if (can.misc.Search(can, log.DEBUG) == ice.TRUE) { can.Status(html.HEIGHT, can.base.Max(height, can._output.offsetHeight), html.WIDTH, width) } + can.page.style(can, can._status, html.MAX_WIDTH, width) var sub = can.sub; if (!sub) { return auto } sub.Mode(mode), sub.ConfHeight(height), sub.ConfWidth(width), can.onimport._size(can) mode? sub.onlayout[mode](sub, height, width): sub.onlayout._init(sub, height, width) return auto @@ -80,13 +81,14 @@ Volcanos(chat.ONIMPORT, { }) Volcanos(chat.ONACTION, {list: [ "刷新数据", "刷新界面", "切换浮动", "切换全屏", - // "远程控制", "共享工具", + // "远程控制", "共享工具", "打开链接", "生成链接", "生成脚本", // "生成图片", ["视图", "参数", "操作", "状态", "专注", "项目", "预览", "演示"], - ["数据", "保存参数", "清空参数", "复制数据", "下载数据", "清空数据", "添加工具"], + ["数据", "保存参数", "清空参数", "复制数据", "下载数据", "添加工具", "清空数据"], ["调试", "查看文档", "查看脚本", "查看源码", "查看配置", "删除工具"], + // ["调试", "打包页面", "查看文档", "查看脚本", "查看源码", "查看配置", "查看日志"], // ["调试", "打包页面", "查看文档", "查看脚本", "查看源码", "查看配置", "查看日志", "添加工具"], ], _engine: function(event, can, button) { can.Update(event, [ctx.ACTION, button].concat(can.Input())) }, diff --git a/plugin/table.js b/plugin/table.js index 30ac47ec..db71ab4e 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -188,8 +188,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( sub.onexport.output = function() { var width = can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0) var height = can.base.Max(can.ConfHeight()/2, can.ConfHeight()-html.ACTION_HEIGHT, 320) can.page.style(can, sub._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "") - sub.onimport.size(sub, height, can.base.Min(sub._target.offsetWidth, can.base.Min(width/2, 640), width/(can.base.isIn(sub.ConfIndex(), code.COMPILE, cli.RUNTIME)? 1: 2)), false) - can.onmotion.delay(can, function() { sub.onimport.size(sub, height, can.base.Min(sub._target.offsetWidth, can.base.Min(width/2, 640), width), false) }) + sub.onimport.size(sub, height, can.base.Max(sub._target.offsetWidth, width, 800), false) + can.onmotion.delay(can, function() { + sub.onimport.size(sub, height, can.base.Max(sub._target.offsetWidth, width, 800), false) + }) } can.onmotion.hidden(can, sub._target), sub._legend._target = sub._target, sub._legend._meta = {index: meta.index} can.page.Append(can, sub._legend,[{text: [can.page.unicode.remove, "", mdb.REMOVE], onclick: function(event) {