forked from x/ContextOS
add plugin mind
This commit is contained in:
parent
8826185bc6
commit
6b6d1f3b8c
@ -4,5 +4,5 @@ var version = struct {
|
||||
host string
|
||||
self int
|
||||
}{
|
||||
"2019-09-10 21:10:24", "centos", 509,
|
||||
"2019-09-10 22:40:18", "com.mac", 491,
|
||||
}
|
||||
|
@ -16,8 +16,8 @@ kit macro "脚本宏" "macro.js" public \
|
||||
|
||||
kit sys "命令行" public "ssh._route" _ "nfs.source" \
|
||||
text "" name pod imports plugin_pod \
|
||||
textarea "" view long \
|
||||
button "运行" \
|
||||
textarea "" view long \
|
||||
exports mac name
|
||||
|
||||
fun salary "工资单" public \
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
{init: function(run, field, option, output) {
|
||||
var stop = false
|
||||
return {
|
||||
ondaemon: {
|
||||
table: function(msg, cb) {
|
||||
if (stop) {return}
|
||||
if (msg.event.type == "blur") {return}
|
||||
var plugin = field.Plugin
|
||||
output.innerHTML = "", msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), "", function(event, value, name, line, index) {
|
||||
if (name == "id") {
|
||||
@ -14,10 +12,8 @@
|
||||
function submit(event) {
|
||||
td.innerText = event.target.value
|
||||
if (event.target.value != value) {
|
||||
stop = true
|
||||
plugin.Run(event, [option.title.value, name, index-1, event.target.value], function() {
|
||||
plugin.Check()
|
||||
stop = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ ctx = context = {
|
||||
for (var k in dataset) {
|
||||
option[k] = dataset[k].split(",")
|
||||
}
|
||||
var event = window.event
|
||||
kit.History.add("cmd", option)
|
||||
this.GET("", option, function(msg) {
|
||||
msg[0] && (msg = msg[0])
|
||||
@ -16,6 +17,7 @@ ctx = context = {
|
||||
s = kit.Color(s)
|
||||
return s
|
||||
}
|
||||
msg.event = event
|
||||
typeof cb == "function" && cb(msg || {})
|
||||
})
|
||||
},
|
||||
|
@ -703,7 +703,7 @@ function Plugin(page, pane, field, runs) {
|
||||
var exports = JSON.parse(meta.exports||'["",""]')
|
||||
var deal = (feature && feature.display) || "table"
|
||||
var history = []
|
||||
output.className = feature.style || "item"
|
||||
output.className = (feature.style || "") + " output"
|
||||
|
||||
var plugin = Meta(field, (field.Script && field.Script.init || function() {
|
||||
})(run, field, option, output)||{}, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user