From 4ea60fc18eee37eac68b4c270831593a021c1dad Mon Sep 17 00:00:00 2001 From: harveyshao Date: Fri, 5 Nov 2021 21:23:10 +0800 Subject: [PATCH] opt vim --- plugin/state.js | 18 ++++++++++++++++++ proto.js | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugin/state.js b/plugin/state.js index cd343b27..7ed6fdd3 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -170,6 +170,24 @@ Volcanos("onaction", {help: "交互操作", list: [ can.Update(event, [ctx.ACTION, "prev", can.Status("total")||0, can.Option("limit"), can.Option("offend")]) }, + listTags: function(event, can, button) { + var list = [] + can.core.List([ + can.base, can.core, can.misc, can.page, can.user, + can.onengine, can.ondaemon, + can.onappend, can.onlayout, + can.onmotion, can.onkeypop, + ], function(lib) { + can.core.Item(lib, function(key, value) { if (!lib.hasOwnProperty(key)) { return } + if (key.indexOf("_") == 0) { return } + list.push({zone: lib._name, type: typeof value, name: key, text: can.base.isObject(value)? "": (value+"").split(ice.NL)[0], file: lib._path}) + }) + }) + var msg = can.request(event, {_handle: true, content: can.base.Format(list)}) + can.run(event, [button], function() { + can.user.toast(can, "添加成功") + }) + }, getClipboardData: function(event, can, button) { function add(text) { can.run(event, can.base.Simple(ctx.ACTION, button, can.base.parseJSON(text)), function(msg) { diff --git a/proto.js b/proto.js index 6272771c..2fa46e65 100644 --- a/proto.js +++ b/proto.js @@ -173,7 +173,7 @@ var Volcanos = shy("火山架", {iceberg: "/chat/", volcano: "/frame.js", args: } can = can||{} - var proto = {__proto__: meta, _name: name, _load: function(name, cb) { // 加载缓存 + var proto = {__proto__: meta, _path: _can_path, _name: name, _load: function(name, cb) { // 加载缓存 var cache = meta.cache[name]||[]; for (list.reverse(); list.length > 0; list) { var sub = list.pop(); sub != can && cache.push(sub) }; meta.cache[name] = cache