From 24403b72928137fc76b35c10c6a7f98dc683dd9e Mon Sep 17 00:00:00 2001 From: shylinux Date: Sun, 12 Mar 2023 10:11:08 +0800 Subject: [PATCH] opt some --- plugin/local/code/inner.js | 1 + plugin/state.js | 4 ++-- proto.js | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 89999be1..f841687d 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -171,6 +171,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl delete(can._cache_data[key]), delete(can.db.tabview[key]) }, can.ui.tabs) } + can.db._keylist = [] if (can.db.tabview[key]) { return !can._msg._tab && !can.isSimpleMode()? load(can.db.tabview[key]): show() } isIndex()||isSpace()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true) }, diff --git a/plugin/state.js b/plugin/state.js index 5fe9cfe4..a096b8ba 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -29,7 +29,7 @@ Volcanos(chat.ONIMPORT, { sub.onimport.size(sub, can.base.Max(height, can.page.height())-top-(can.user.isMobile&&!can.user.isLandscape()? 2*html.ACTION_HEIGHT: 0), width, true) }) }, document.body) }) }, - _hold: function(can, msg, arg) { arg && can.user.toast(can, arg) }, + _hold: function(can, msg, arg) { can.user.toast(can, arg||ice.SUCCESS) }, _back: function(can) { can._history.pop(); for (var index = 0, his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue } can.page.SelectArgs(can, can._option, "", function(item) { item.value = his[index++]||"" can.page.Select(can, item.parentNode, "span.value", function(target) { target.innerText = target.value||"" }) @@ -47,7 +47,7 @@ Volcanos(chat.ONIMPORT, { return can.page.style(can, div, html.MAX_HEIGHT, 400), can.page.Append(can, div, [{text: arg}]), div.scrollBy(0, 10000), true }).length == 0) { can.onappend.board(can, arg) } }, - _open: function(can, msg, arg) { return can.user.open(arg) }, + _open: function(can, msg, arg) { return can.Update(), can.user.open(arg) }, size: function(can, height, width, auto, mode) { height -= can.onexport.actionHeight(can)+can.onexport.statusHeight(can) auto? can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height? can.ConfHeight(height): "", html.MAX_WIDTH, can.ConfWidth(width)): can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "") diff --git a/proto.js b/proto.js index 79ce51c2..af6bdb3f 100644 --- a/proto.js +++ b/proto.js @@ -355,7 +355,9 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {} return can.require(can._follow? libs.concat(meta.libs, meta.volcano): libs, cb), can }) try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta - if (window._verstion && window.outerWidth-window.innerWidth < 100) { meta.version = window._version } + if (window._version && window.outerWidth-window.innerWidth < 100) { + meta.version = window._version + } meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth meta._load = function(url, cb) { var v = meta.version? meta.version+"&_tt="+(new Date()).getTime(): ""