diff --git a/frame.js b/frame.js index 98c56aa7..d0303bf1 100644 --- a/frame.js +++ b/frame.js @@ -195,8 +195,9 @@ var can = Volcanos("chat", { return plugin._output = plugin[type] = can.Output(plugin, feature, type, msg, cb, output, option) }, Clone: function(event, cb) {meta.nick = meta.name + can.ID() - can.Plugin(can, meta.nick, meta, run, - can.page.AppendField(can, field.parentNode, "item "+meta.group+" "+meta.nick, meta), cb) + meta.args = can.page.Select(can, plugin.option, ".args", function(item) {return item.value}) + can._plugins.push(can.Plugin(can, meta.nick, meta, run, + can.page.AppendField(can, field.parentNode, "item "+meta.group+" "+meta.nick, meta), cb)) }, Delete: function(event) {field.parentNode.removeChild(field)}, }, Config.libs.concat(["plugin/"+(meta.type||feature.active||"state")]), function(plugin) {plugin.Conf(meta); @@ -257,4 +258,3 @@ var can = Volcanos("chat", { chat.Login.Import(event||{}, "", "login") }, document.body) }) - diff --git a/index.html b/index.html index 07e645fc..e7d68f22 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ + diff --git a/lib/page.js b/lib/page.js index 6ab578fc..b1bc4881 100644 --- a/lib/page.js +++ b/lib/page.js @@ -255,6 +255,10 @@ Volcanos("page", {help: "网页模块", Display: function(text) { if (text.startsWith("http")) {return ""+text+""} + text = text.replace(/\033\[31m/g, "") + text = text.replace(/\033\[32m/g, "") + text = text.replace(/\033\[0m/g, "") + text = text.replace(/\033\[m/g, "") return text; }, CopyText: function(can, text) { diff --git a/plugin/table.js b/plugin/table.js index b811c443..c50bbd3f 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -10,7 +10,7 @@ Volcanos("onimport", {help: "导入数据", list: [], case "TD": can.onimport.which(event, table, msg.append, function(index, key) { can.ondetail["复制"](event, can, msg, event.target.innerHTML, index, key, event.target); - can.Export(event, event.target.innerHTML, key, index) + can.Export(event, event.target.innerHTML.trim(), key, index) }) break case "TH": diff --git a/proto.js b/proto.js index a184991d..33028b48 100644 --- a/proto.js +++ b/proto.js @@ -208,9 +208,20 @@ function Volcanos(name, can, libs, cb, msg) { // 封装模块 can.load(libs[0]), next() } else { // 加载脚本 - can.Dream(document.body, libs[0]+".js", function() { - can.load(libs[0]), next(); - }) + if (libs[0].indexOf(".") == -1) {libs[0] += ".js"} + if (libs[0].endsWith(".wasm")) {var go = new Go(); + WebAssembly.instantiateStreaming(fetch(libs[0]), go.importObject).then((result) => { + go.argv = [can]; + go.run(result.instance); + next(); + }).catch((err) => { + console.error(err); + }); + } else { + can.Dream(document.body, libs[0], function() { + can.load(libs[0]), next(); + }) + } } } else { // 独立模块