mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
ac34cf236d
commit
51317b26d8
34
frame.js
34
frame.js
@ -523,47 +523,37 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
|||||||
table: function(can, target, type, msg, cb) {
|
table: function(can, target, type, msg, cb) {
|
||||||
var table = can.page.AppendTable(can, target, msg, msg.append, cb || function(value, key, index, line) {
|
var table = can.page.AppendTable(can, target, msg, msg.append, cb || function(value, key, index, line) {
|
||||||
function run(event, item, value) {
|
function run(event, item, value) {
|
||||||
var msg = can.request(event)
|
var msg = can.request(event); msg.Option(can.Option()), msg.Option(line)
|
||||||
msg.Option(can.Option()), msg.Option(line)
|
|
||||||
var cb = can.onaction[item] || can.onaction["运行"]
|
|
||||||
var toast = can.user.toast(can, item+"中...", item, 1000000)
|
var toast = can.user.toast(can, item+"中...", item, 1000000)
|
||||||
|
|
||||||
|
var cb = can.onaction[item] || can.onaction["运行"]
|
||||||
cb? cb(event, can, item): can.run(event, ["action", item, key=="value"? line.key: key, value.trim()], function(res) {
|
cb? cb(event, can, item): can.run(event, ["action", item, key=="value"? line.key: key, value.trim()], function(res) {
|
||||||
toast.Close(), can.user.toast(can, item+"成功")
|
toast.Close(), can.user.toast(can, item+"成功"), can.run({})
|
||||||
can.run({})
|
|
||||||
}, true)
|
}, true)
|
||||||
}
|
}
|
||||||
return {type: "td", inner: value, click: function(event) {
|
return {type: "td", inner: value, click: function(event) {
|
||||||
var target = event.target; if (target.tagName == "INPUT" && target.type == "button") {
|
var target = event.target; if (target.tagName == "INPUT" && target.type == "button") {
|
||||||
if (can.Conf("feature")[target.value]) {
|
if (can.Conf("feature")[target.value]) {
|
||||||
|
// 输入参数
|
||||||
can.user.input(event, can, can.Conf("feature")[target.value], function(event, button, data, list) {
|
can.user.input(event, can, can.Conf("feature")[target.value], function(event, button, data, list) {
|
||||||
var msg = can.request(event); can.core.Item(can.Option(), msg.Option)
|
var msg = can.request(event); msg.Option(can.Option()), msg.Option(line)
|
||||||
can.core.Item(line, msg.Option)
|
|
||||||
can.run(event, ["action", target.value].concat(list), function(msg) {
|
can.run(event, ["action", target.value].concat(list), function(msg) {
|
||||||
can.user.toast(can, target.value+"成功", "paste")
|
can.user.toast(can, target.value+"成功"), can.run({})
|
||||||
can.run({})
|
|
||||||
}, true)
|
}, true)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (target.value) {
|
|
||||||
case "复制":
|
|
||||||
navigator.clipboard.writeText(line.text).then(function() {
|
|
||||||
can.user.toast(can, "复制成功", "paste")
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return run(event, event.target.value, value)
|
return run(event, event.target.value, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
can.page.Select(can, can._option, "input.args", function(input) { if (input.name == key) { var data = input.dataset || {}
|
can.page.Select(can, can._option, "input.args", function(input) { if (input.name == key) { var data = input.dataset || {}
|
||||||
|
// 补全参数
|
||||||
input.value = value, typeof cb == "function" && cb(event, value); if (data.action == "auto") {
|
input.value = value, typeof cb == "function" && cb(event, value); if (data.action == "auto") {
|
||||||
var sub = can.request(event)
|
var msg = can.request(event); msg.Option(can.Option()), msg.Option(line)
|
||||||
can.core.Item(can.Option(), sub.Option)
|
|
||||||
sub.Option("_action", msg.Option("_action"))
|
sub.Option("_action", msg.Option("_action"))
|
||||||
can.run(event, can.page.Select(can, can._option, "input.args", function(item) {
|
can.run(event)
|
||||||
return item.name && item.value || ""
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
} })
|
} })
|
||||||
}, ondblclick: function(event) {
|
}, ondblclick: function(event) {
|
||||||
|
@ -269,7 +269,7 @@ var page = Volcanos("page", {help: "网页模块",
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
Display: function(text) {
|
Display: function(text) {
|
||||||
if (text.startsWith("http")) {
|
if (text.startsWith("http") || text.startsWith("ftp")) {
|
||||||
var ls = text.split(" ")
|
var ls = text.split(" ")
|
||||||
return "<a href='"+ls[0]+"' target='_blank'>"+ls[0]+"</a>"+ls.slice(1).join(" ")
|
return "<a href='"+ls[0]+"' target='_blank'>"+ls[0]+"</a>"+ls.slice(1).join(" ")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user