From 13b66860da1f26da14e1a1b03f40e09d7f42a653 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sat, 24 Dec 2022 15:13:34 +0800 Subject: [PATCH] opt some --- plugin/local/code/inner.js | 4 ++-- plugin/local/code/inner/search.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index fb1e6bbf..6d85d1d0 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -37,7 +37,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl }, _tabs: function(can) { if (!can.isCmdMode()) { return can.ui.tabs = can._action } can.page.Append(can, can.ui.tabs, [{view: [[mdb.TIME, html.SELECT]], _init: function(target) { - can.core.Timer({interval: 100}, function() { can.page.Modify(can, target, can.base.Time()) }) + can.core.Timer({interval: 100}, function() { can.page.Modify(can, target, can.user.time(can, null, "%y-%m-%d %H:%M:%S %w")) }) can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) {}) }}]) can.page.Append(can, can.ui.tabs, [{view: [aaa.AVATAR], list: [{img: can.user.info.avatar}]}]) @@ -387,7 +387,7 @@ Volcanos(chat.ONACTION, { {type: html.BUTTON, name: nfs.REPLACE}, {type: html.BUTTON, name: cli.CLOSE}, ], ui.action, {_trans: {find: "查找", grep: "搜索", replace: "替换"}, find: function() { find(last+1, from.value) }, - grep: function() { can.onimport.exts(can, "inner/search.js", function(sub) { sub.select(), meta.close(), sub.runAction(event, nfs.GREP, [from.value, can.Option(nfs.PATH)]) }) }, + grep: function() { can.onimport.exts(can, "inner/search.js", function(sub) { sub.select(), meta.close(), can.onmotion.delayLong(can, function() { sub.runAction(event, nfs.GREP, [from.value, can.Option(nfs.PATH)]) }) }) }, replace: function() { var text = can.current.text(), line = can.onaction._getLineno(can, can.current.line) can.db.undo.push(function() { can.onaction.selectLine(can, line), can.onaction.modifyLine(can, line, text) }) can.current.text(text.replace(from.value, to.value)), can.current.text().indexOf(from.value) == -1 && meta.find() diff --git a/plugin/local/code/inner/search.js b/plugin/local/code/inner/search.js index 630d9752..4688860e 100644 --- a/plugin/local/code/inner/search.js +++ b/plugin/local/code/inner/search.js @@ -1,4 +1,5 @@ Volcanos(chat.ONIMPORT, {list: ["main", "filter", "grep:button", "history", "last"], _init: function(can, msg) { + can.misc.Debug("what") can.onmotion.clear(can), can.onappend.table(can, msg) can.onmotion.delay(can, function() { can.page.Select(can, can._option, "input[name=filter]", function(target) {