From 6aeb3794ecf10b01f1682e3b61ba3d64215249f8 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Tue, 17 May 2022 10:15:43 +0800 Subject: [PATCH] opt some --- frame.js | 6 +++++- plugin/local/code/vimer.css | 2 +- plugin/local/code/vimer.js | 16 ++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frame.js b/frame.js index 41da991a..7552b64b 100644 --- a/frame.js +++ b/frame.js @@ -67,6 +67,10 @@ Volcanos("onengine", {help: "搜索引擎", list: [], _init: function(can, meta, return false }, _remote: function(event, can, msg, panel, cmds, cb) { + msg.option = can.core.List(msg.option, function(item) { + return {_toast: true, _handle: true}[item] && delete(msg[item])? undefined: item + }) + if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return } if (panel.onengine._plugin(event, can, msg, panel, cmds, cb)) { return } @@ -250,7 +254,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, if (can.base.isUndefined(msg._daemon)) { can.base.isUndefined(can._daemon) && can.ondaemon._list[0] && (can._daemon = can.ondaemon._list.push(can)-1) - if (can._daemon) { msg._daemon = can._daemon } + // if (can._daemon) { msg.Option(ice.MSG_DAEMON, can._daemon) } } if (meta && meta.index && meta.index.indexOf("can.") == 0) { can.onengine._plugin(event, can, msg, can, can.misc.concat(can, [meta.index], cmds), function(msg) { diff --git a/plugin/local/code/vimer.css b/plugin/local/code/vimer.css index c26c0727..71967e48 100644 --- a/plugin/local/code/vimer.css +++ b/plugin/local/code/vimer.css @@ -17,7 +17,7 @@ fieldset.vimer>div.output div.complete div.pre { font-size:1.1rem; color:#f0f8ff00; margin-left:5px; float:left; } fieldset.vimer>div.output div.complete table { - background:lightblue; max-height:400px; max-width:600px; overflow:auto; display:block; float:left; + background:lightblue; max-height:400px; max-width:800px; overflow:auto; display:block; float:left; } fieldset.vimer>div.output div.complete table.content th { display:none; diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 4814436b..6e0d0376 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -38,8 +38,9 @@ Volcanos("onkeymap", {help: "键盘交互", list: [], can.ui.current.focus() }, _insert: function(event, can) { can.onkeymap._model(can, "insert") - can.ui.current.focus(), can.onkeymap.prevent(event) - can._keylist = [] + can.ui.current.focus(), can.ui.content.scrollLeft -= 10000 + can.onkeymap.prevent(event) + // can._keylist = [] }, _mode: { @@ -233,12 +234,15 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, code.AUTOGEN, code. type = can.base.trimSuffix(type, ice.PT) const PRE = "pre" - function update(target) { can.request(event, {pre: pre, end: end, type: type, name: name, file: can.Option(nfs.FILE)}) + function update(target) { can.request(event, {type: type, name: name, text: pre, file: can.Option(nfs.FILE)}) can.runAction(event, "complete", [], function(msg) { can.ui.complete._msg = msg if (msg.Length() == 0 && can.base.Ext(can.Option(nfs.FILE)) == nfs.JS) { - can.core.Item(can.core.Value(window, type), function(k, v) { msg.Push(mdb.NAME, k) + msg.name = [], msg.type = [], msg.text = [] + can.core.Item(can.core.Value(window, type), function(k, v) { + msg.Push(mdb.NAME, k), msg.Push(mdb.TYPE, typeof v) try { msg.Push(mdb.TEXT, v) } catch (e) { msg.Push(mdb.TEXT, "") } }) + msg.append = [mdb.NAME, mdb.TYPE, mdb.TEXT] } msg.Length() == 0 && pre.trim() == "" && can.core.Item(can.core.Value(can.onsyntax[can.parse], code.KEYWORD), function(k) { msg.Push(mdb.NAME, k) @@ -288,9 +292,9 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, code.AUTOGEN, code. switch (event.key) { case html.ENTER: update(target); break - case ice.TB: update(target); break - case ice.PT: update(target); break + case html.TAB: update(target); break case ice.SP: update(target); break + case ice.PT: update(target); break default: filter() || update(target); break } can.ui.complete._index = -1 },