From ac34cf236d9dd3fc2c3496b4c537481745b19aa1 Mon Sep 17 00:00:00 2001 From: shaoying Date: Thu, 27 Aug 2020 19:51:00 +0800 Subject: [PATCH] opt some --- frame.js | 10 +++++----- lib/base.js | 6 ++++++ plugin/local/code/inner.js | 14 -------------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/frame.js b/frame.js index f3335cf9..937cad65 100644 --- a/frame.js +++ b/frame.js @@ -163,18 +163,18 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta, "web.wiki.data", "web.wiki.word", ]}, - "english": {name: "english", action: [ + "english": {name: "英汉 english", action: [ {name: "english", help: "英汉", index: "web.wiki.alpha.find", args: ["hi"]}, {name: "chinese", help: "汉英", index: "web.wiki.alpha.find", args: ["你好", "line"]}, {name: "wubi", help: "五笔", index: "web.code.input.find", args: ["wqvb"]}, {name: "wubi", help: "五笔", index: "web.code.input.find", args: ["你好", "line"]}, ]}, - "learning": {name: "learning", action: [ + "learning": {name: "学习 learning", action: [ {name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]}, {name: "tmux", help: "粘贴", index: "web.code.tmux.text"}, {name: "study", help: "学习", index: "web.wiki.word", args: ["usr/learning/study.shy"]}, ]}, - "chrome": {name: "chrome", action: [ + "chrome": {name: "爬虫 chrome", action: [ {name: "feel", help: "网页爬虫", index: "web.wiki.feel", args: ["spide/"], feature: { display: "/plugin/local/wiki/feel.js", height: 200, limit: 3, @@ -182,7 +182,7 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta, {name: "cached", help: "爬虫缓存", index: "web.code.chrome.cached", args: []}, {name: "spided", help: "网页爬虫", index: "web.code.chrome.spided", args: location && location.protocol && location.protocol=="chrome-extension:"? ["1", "", "spide"]: ["1"]}, ]}, - "context": {name: "context", action: [ + "context": {name: "理念 context", action: [ {name: "context", help: "编程", index: "web.wiki.word", args: ["usr/learning/社会/管理/context.shy"]}, ]}, }}, @@ -509,7 +509,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, can.onfigure && can.core.Item(can.onfigure[item.figure], function(key, value) { if (key.startsWith("on")) { target[key] = function(event) { value(event, can, item, target) } } }) - target.type != "button" && (target.value = "") + target.type != "button" && target.value.startsWith("@") && (target.value = "") }) item.type == "textarea" && can.page.Append(can, option, [{type: "br"}]) diff --git a/lib/base.js b/lib/base.js index 452f5076..1d752136 100644 --- a/lib/base.js +++ b/lib/base.js @@ -19,6 +19,12 @@ var base = Volcanos("base", {help: "基础模块", }, parseSize: function(size) { + if (size.endsWith("TB") || size.endsWith("tb") || size.endsWith("T") || size.endsWith("t")) { + return parseInt(size) * 1024 * 1024 * 1024 * 1024 + } + if (size.endsWith("GB") || size.endsWith("gb") || size.endsWith("G") || size.endsWith("g")) { + return parseInt(size) * 1024 * 1024 * 1024 + } if (size.endsWith("MB") || size.endsWith("mb") || size.endsWith("M") || size.endsWith("m")) { return parseInt(size) * 1024 * 1024 } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 9ba89cff..2ae22c9e 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -169,20 +169,6 @@ Volcanos("onaction", {help: "控件交互", list: [], last && can.onimport.tabview(can, last.path, last.file, last.line) }, "运行": function(event, can) { - if (can.ui.editor) { - var msg = can.request(event); msg.Option("content", can.onexport.content(can)) - can.run(event, ["action", "save", can.parse, can.Option("file"), can.Option("path")], function(msg) { - can.user.toast(can, "保存成功") - can.run({}, ["action", "engine", can.parse, can.Option("file"), can.Option("path")], function(msg) { - (msg.Result() || msg.append && msg.append.length > 0) && can.page.Modify(can, can.ui.display, {innerHTML: "", style: {display: "block"}}) - can.onappend.table(can, can.ui.display, "table", msg) - can.onappend.board(can, can.ui.display, "board", msg) - can.user.toast(can, "运行成功") - }, true) - }, true) - return - } - can.page.Modify(can, can.ui.display, {innerHTML: "", style: {display: "none"}}) can.run(event, ["action", "engine", can.parse, can.Option("file"), can.Option("path")], function(msg) { (msg.Result() || msg.append && msg.append.length > 0) && can.page.Modify(can, can.ui.display, {innerHTML: "", style: {display: "block"}})