1
0
forked from x/volcanos
This commit is contained in:
shaoying 2020-08-27 19:51:00 +08:00
parent cbab5cd365
commit ac34cf236d
3 changed files with 11 additions and 19 deletions

View File

@ -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"}])

View File

@ -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
}

View File

@ -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"}})