forked from x/ContextOS
add favor.note
This commit is contained in:
parent
b39fc0a342
commit
4eb290d72c
@ -4,5 +4,5 @@ var version = struct {
|
|||||||
host string
|
host string
|
||||||
self int
|
self int
|
||||||
}{
|
}{
|
||||||
"2019-08-24 17:10:37", "ZYB-20190522USI.centos", 402,
|
"2019-08-25 17:36:48", "mac", 429,
|
||||||
}
|
}
|
||||||
|
@ -619,6 +619,7 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
return sed(m, arg[0], args)
|
return sed(m, arg[0], args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip, find := false, false
|
||||||
m.Confm("pwd", func(index int, value string) bool {
|
m.Confm("pwd", func(index int, value string) bool {
|
||||||
// p := path.Join(value, m.Option("dir_root"), arg[0])
|
// p := path.Join(value, m.Option("dir_root"), arg[0])
|
||||||
p := path.Join(value, arg[0])
|
p := path.Join(value, arg[0])
|
||||||
@ -650,12 +651,25 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
m.Append("file", p)
|
m.Append("file", p)
|
||||||
m.Append("size", s.Size())
|
m.Append("size", s.Size())
|
||||||
m.Append("time", s.ModTime().Format(m.Conf("time", "format")))
|
m.Append("time", s.ModTime().Format(m.Conf("time", "format")))
|
||||||
|
skip = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
find = true
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if !find && arg[0] != "" {
|
||||||
|
if strings.HasSuffix(arg[0], "/") {
|
||||||
|
m.Assert(os.MkdirAll(arg[0], 0777))
|
||||||
|
m.Echo(arg[0])
|
||||||
|
} else if f, p, e := kit.Create(arg[0]); m.Assert(e) {
|
||||||
|
f.Close()
|
||||||
|
m.Echo(p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if m.Has("dir_sort") {
|
if m.Has("dir_sort") {
|
||||||
m.Sort(m.Meta["dir_sort"][0], m.Meta["dir_sort"][1:]...)
|
m.Sort(m.Meta["dir_sort"][0], m.Meta["dir_sort"][1:]...)
|
||||||
}
|
}
|
||||||
@ -664,7 +678,7 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
for _, v := range m.Meta[m.Meta["append"][0]] {
|
for _, v := range m.Meta[m.Meta["append"][0]] {
|
||||||
m.Echo(v).Echo(" ")
|
m.Echo(v).Echo(" ")
|
||||||
}
|
}
|
||||||
} else {
|
} else if !skip {
|
||||||
m.Table()
|
m.Table()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -408,6 +408,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
|||||||
m.Push("init", "")
|
m.Push("init", "")
|
||||||
}
|
}
|
||||||
m.Push("inputs", kit.Format(value["inputs"]))
|
m.Push("inputs", kit.Format(value["inputs"]))
|
||||||
|
m.Push("feature", kit.Format(value["feature"]))
|
||||||
m.Push("exports", kit.Format(value["exports"]))
|
m.Push("exports", kit.Format(value["exports"]))
|
||||||
m.Push("display", kit.Format(value["display"]))
|
m.Push("display", kit.Format(value["display"]))
|
||||||
})
|
})
|
||||||
|
@ -318,6 +318,7 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
|
|
||||||
// 表达式语句
|
// 表达式语句
|
||||||
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-", "+", "}"}},
|
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-", "+", "}"}},
|
||||||
|
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "~", "!~", "}"}},
|
||||||
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "+", "-", "*", "/", "%", "}"}},
|
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "+", "-", "*", "/", "%", "}"}},
|
||||||
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "<", "<=", ">", ">=", "==", "!=", "}"}},
|
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "<", "<=", ">", ">=", "==", "!=", "}"}},
|
||||||
map[string]interface{}{"page": "val", "hash": "val", "word": []interface{}{"opt{", "op1", "}", "mul{", "num", "key", "str", "exe", "}"}},
|
map[string]interface{}{"page": "val", "hash": "val", "word": []interface{}{"opt{", "op1", "}", "mul{", "num", "key", "str", "exe", "}"}},
|
||||||
@ -354,7 +355,6 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-z", "-n", "}"}},
|
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-z", "-n", "}"}},
|
||||||
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-e", "-f", "-d", "}"}},
|
map[string]interface{}{"page": "op1", "hash": "op1", "word": []interface{}{"mul{", "-e", "-f", "-d", "}"}},
|
||||||
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", ":=", "=", "+=", "}"}},
|
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", ":=", "=", "+=", "}"}},
|
||||||
map[string]interface{}{"page": "op2", "hash": "op2", "word": []interface{}{"mul{", "~", "!~", "}"}},
|
|
||||||
|
|
||||||
map[string]interface{}{"page": "exp", "hash": "exp", "word": []interface{}{"\\{", "rep{", "map", "}", "\\}"}},
|
map[string]interface{}{"page": "exp", "hash": "exp", "word": []interface{}{"\\{", "rep{", "map", "}", "\\}"}},
|
||||||
map[string]interface{}{"page": "val", "hash": "val", "word": []interface{}{"opt{", "op1", "}", "(", "exp", ")"}},
|
map[string]interface{}{"page": "val", "hash": "val", "word": []interface{}{"opt{", "op1", "}", "(", "exp", ")"}},
|
||||||
@ -374,6 +374,7 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
"button": true,
|
"button": true,
|
||||||
"select": true,
|
"select": true,
|
||||||
"textarea": true,
|
"textarea": true,
|
||||||
|
"feature": true,
|
||||||
"exports": true,
|
"exports": true,
|
||||||
}, Help: "控件类型"},
|
}, Help: "控件类型"},
|
||||||
"exec": &ctx.Config{Name: "info", Value: map[string]interface{}{
|
"exec": &ctx.Config{Name: "info", Value: map[string]interface{}{
|
||||||
@ -770,7 +771,9 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre := map[string]int{
|
pre := map[string]int{
|
||||||
"=": -1,
|
"=": -1,
|
||||||
|
"||": 0,
|
||||||
|
"==": 1, "~": 1,
|
||||||
"+": 2, "-": 2,
|
"+": 2, "-": 2,
|
||||||
"*": 3, "/": 3, "%": 3,
|
"*": 3, "/": 3, "%": 3,
|
||||||
}
|
}
|
||||||
@ -1094,6 +1097,7 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
m.Log("info", "_index: %v", arg)
|
m.Log("info", "_index: %v", arg)
|
||||||
args := []interface{}{}
|
args := []interface{}{}
|
||||||
inputs := []interface{}{}
|
inputs := []interface{}{}
|
||||||
|
feature := map[string]interface{}{}
|
||||||
exports := []interface{}{}
|
exports := []interface{}{}
|
||||||
for i := 7; i < len(arg); i++ {
|
for i := 7; i < len(arg); i++ {
|
||||||
if !m.Confs("input", arg[i]) {
|
if !m.Confs("input", arg[i]) {
|
||||||
@ -1106,7 +1110,10 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
args := arg[i : j+1]
|
args := arg[i : j+1]
|
||||||
if arg[i] == "exports" {
|
if arg[i] == "feature" {
|
||||||
|
feature[arg[i+1]] = arg[i+2]
|
||||||
|
|
||||||
|
} else if arg[i] == "exports" {
|
||||||
for k := 1; k < len(args); k += 1 {
|
for k := 1; k < len(args); k += 1 {
|
||||||
exports = append(exports, args[k])
|
exports = append(exports, args[k])
|
||||||
}
|
}
|
||||||
@ -1150,6 +1157,7 @@ var Index = &ctx.Context{Name: "yac", Help: "语法中心",
|
|||||||
"componet_cmd": kit.Select("", arg, 6),
|
"componet_cmd": kit.Select("", arg, 6),
|
||||||
"componet_args": args,
|
"componet_args": args,
|
||||||
"inputs": inputs,
|
"inputs": inputs,
|
||||||
|
"feature": feature,
|
||||||
"exports": exports,
|
"exports": exports,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
@ -317,6 +317,7 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
|
|||||||
m.Push("inputs", msg.Append("inputs"))
|
m.Push("inputs", msg.Append("inputs"))
|
||||||
m.Push("exports", msg.Append("exports"))
|
m.Push("exports", msg.Append("exports"))
|
||||||
m.Push("display", msg.Append("display"))
|
m.Push("display", msg.Append("display"))
|
||||||
|
m.Push("feature", msg.Append("feature"))
|
||||||
})
|
})
|
||||||
m.Table()
|
m.Table()
|
||||||
break
|
break
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"contexts/ctx"
|
"contexts/ctx"
|
||||||
"contexts/web"
|
"contexts/web"
|
||||||
"toolkit"
|
|
||||||
|
|
||||||
"bytes"
|
"bytes"
|
||||||
"html/template"
|
"html/template"
|
||||||
@ -47,16 +46,17 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心",
|
|||||||
}, Help: "组件列表"},
|
}, Help: "组件列表"},
|
||||||
|
|
||||||
"level": &ctx.Config{Name: "level", Value: "local/wiki/自然/编程", Help: "路由数量"},
|
"level": &ctx.Config{Name: "level", Value: "local/wiki/自然/编程", Help: "路由数量"},
|
||||||
|
"class": &ctx.Config{Name: "class", Value: "", Help: "路由数量"},
|
||||||
"favor": &ctx.Config{Name: "favor", Value: "index.md", Help: "路由数量"},
|
"favor": &ctx.Config{Name: "favor", Value: "index.md", Help: "路由数量"},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ctx.Command{
|
Commands: map[string]*ctx.Command{
|
||||||
"tree": &ctx.Command{Name: "tree", Help: "目录", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"tree": &ctx.Command{Name: "tree", Help: "目录", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
m.Cmdy("nfs.dir", path.Join(m.Confx("level"), kit.Select(m.Option("class"), arg, 0)),
|
m.Cmdy("nfs.dir", path.Join(m.Confx("level"), m.Confx("class", arg, 0)),
|
||||||
"time", "size", "line", "file", "dir_sort", "time", "time_r")
|
"time", "size", "line", "file", "dir_sort", "time", "time_r")
|
||||||
return
|
return
|
||||||
}},
|
}},
|
||||||
"text": &ctx.Command{Name: "text", Help: "文章", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
"text": &ctx.Command{Name: "text", Help: "文章", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||||
which := m.Cmdx("nfs.path", path.Join(m.Confx("level"), m.Option("class"), m.Confx("favor", arg, 0)))
|
which := m.Cmdx("nfs.path", path.Join(m.Confx("level"), m.Confx("class", arg, 1), m.Confx("favor", arg, 0)))
|
||||||
|
|
||||||
buffer := bytes.NewBuffer([]byte{})
|
buffer := bytes.NewBuffer([]byte{})
|
||||||
template.Must(template.ParseFiles(which)).Funcs(ctx.CGI).Execute(buffer, m)
|
template.Must(template.ParseFiles(which)).Funcs(ctx.CGI).Execute(buffer, m)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
fun project "项目" "" "" \
|
fun project "项目" "" "" \
|
||||||
private \
|
private \
|
||||||
select "" values plugin values submit values review values trend values stat values init action auto \
|
select "" values plugin values submit values review values trend values stat values init action auto \
|
||||||
text "" imports plugin_see action auto \
|
text "" name see imports plugin_see action auto \
|
||||||
button "执行" \
|
button "执行" \
|
||||||
exports see name see
|
exports see name see
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ end
|
|||||||
|
|
||||||
fun compile "编译" "" "" \
|
fun compile "编译" "" "" \
|
||||||
private \
|
private \
|
||||||
select "" values plugin values restart values windows values darwin values linux values self values all \
|
select "" values plugin values restart values windows values darwin values linux values self values all action auto \
|
||||||
text "" name see imports plugin_see \
|
text "" name see imports plugin_see \
|
||||||
button "编译"
|
button "编译"
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ end
|
|||||||
fun upgrade "升级" "" "" \
|
fun upgrade "升级" "" "" \
|
||||||
private \
|
private \
|
||||||
text "" name pod imports plugin_pod \
|
text "" name pod imports plugin_pod \
|
||||||
select "" values script values restart values plugin values bench values portal values system \
|
select "" values script values restart values plugin values bench values portal values system action auto \
|
||||||
text "" name see imports plugin_see \
|
text "" name see imports plugin_see \
|
||||||
button "升级"
|
button "升级"
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ end
|
|||||||
|
|
||||||
fun missyou "任务" "" "" \
|
fun missyou "任务" "" "" \
|
||||||
private \
|
private \
|
||||||
text "" imports plugin_see \
|
text "" name see imports plugin_see \
|
||||||
text "" view long \
|
text "" name you view long \
|
||||||
button "行动" action auto \
|
button "行动" action auto \
|
||||||
exports you "" you
|
exports you "" you
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ end
|
|||||||
|
|
||||||
fun pod "设备" "" "" \
|
fun pod "设备" "" "" \
|
||||||
private \
|
private \
|
||||||
text "" view long \
|
text "" name pod view long \
|
||||||
button "行动" action auto \
|
button "行动" action auto \
|
||||||
exports pod pod
|
exports pod pod
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ fun cmd "命令" "" "" \
|
|||||||
private \
|
private \
|
||||||
text "" name pod imports plugin_pod \
|
text "" name pod imports plugin_pod \
|
||||||
text "nfs" name ctx imports plugin_ctx \
|
text "nfs" name ctx imports plugin_ctx \
|
||||||
text "pwd" \
|
text "pwd" name cmd \
|
||||||
button "执行"
|
button "执行"
|
||||||
|
|
||||||
copy ssh._route _ context _ command __
|
copy ssh._route _ context _ command __
|
||||||
@ -79,8 +79,8 @@ fun dir "目录" "" "" \
|
|||||||
private \
|
private \
|
||||||
text "" name pod imports plugin_pod action auto \
|
text "" name pod imports plugin_pod action auto \
|
||||||
text "usr/script" name dir imports plugin_dir action auto view long \
|
text "usr/script" name dir imports plugin_dir action auto view long \
|
||||||
button "查看" action auto \
|
button "浏览" action auto \
|
||||||
button "回退" click Back \
|
feature display "editor" \
|
||||||
exports dir "" dir
|
exports dir "" dir
|
||||||
|
|
||||||
copy ssh._route _ nfs.dir _ time size line path
|
copy ssh._route _ nfs.dir _ time size line path
|
||||||
@ -89,7 +89,7 @@ end
|
|||||||
fun git "版本" "" "" \
|
fun git "版本" "" "" \
|
||||||
private \
|
private \
|
||||||
text "" name pod imports plugin_pod action auto \
|
text "" name pod imports plugin_pod action auto \
|
||||||
select "" values diff values status commit values values log values init action auto \
|
select "" values status values diff commit values values log values init action auto \
|
||||||
text "" name txt action auto \
|
text "" name txt action auto \
|
||||||
button "查看" action auto
|
button "查看" action auto
|
||||||
|
|
||||||
|
@ -71,6 +71,20 @@ fun sys "命令行" "" "" \
|
|||||||
copy nfs.source system __
|
copy nfs.source system __
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fun note "记事本" "" "" \
|
||||||
|
public \
|
||||||
|
text "" name tip imports plugin_tip view long action auto \
|
||||||
|
button "创建" action auto \
|
||||||
|
feature display inner \
|
||||||
|
exports tip file tip
|
||||||
|
|
||||||
|
if $1 == "" || $1 ~ ".*/$"
|
||||||
|
copy context wiki tree __
|
||||||
|
else
|
||||||
|
copy context wiki text __
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
fun hello world "" "" \
|
fun hello world "" "" \
|
||||||
public \
|
public \
|
||||||
textarea "" \
|
textarea "" \
|
||||||
|
@ -684,7 +684,11 @@ function Pane(page, field) {
|
|||||||
};
|
};
|
||||||
return page[name] = field, pane.Field = field, field.Pane = pane
|
return page[name] = field, pane.Field = field, field.Pane = pane
|
||||||
}
|
}
|
||||||
function Plugin(page, pane, field, run) {
|
function Plugin(page, pane, field, runs) {
|
||||||
|
var run = function(event, cmds, cbs) {
|
||||||
|
event.Plugin = plugin, runs(event, cmds, cbs)
|
||||||
|
}
|
||||||
|
|
||||||
var option = field.querySelector("form.option")
|
var option = field.querySelector("form.option")
|
||||||
var action = field.querySelector("div.action")
|
var action = field.querySelector("div.action")
|
||||||
var output = field.querySelector("div.output")
|
var output = field.querySelector("div.output")
|
||||||
@ -693,7 +697,9 @@ function Plugin(page, pane, field, run) {
|
|||||||
var name = meta.name
|
var name = meta.name
|
||||||
var args = meta.args || []
|
var args = meta.args || []
|
||||||
var display = JSON.parse(meta.display||'{}')
|
var display = JSON.parse(meta.display||'{}')
|
||||||
|
var feature = JSON.parse(meta.feature||'{}')
|
||||||
var exports = JSON.parse(meta.exports||'["",""]')
|
var exports = JSON.parse(meta.exports||'["",""]')
|
||||||
|
var deal = (feature && feature.display) || "table"
|
||||||
|
|
||||||
var plugin = Meta(field, (field.Script && field.Script.init || function() {
|
var plugin = Meta(field, (field.Script && field.Script.init || function() {
|
||||||
})(run, field, option, output)||{}, {
|
})(run, field, option, output)||{}, {
|
||||||
@ -707,6 +713,8 @@ function Plugin(page, pane, field, run) {
|
|||||||
var count = kit.Selector(option, "args").length
|
var count = kit.Selector(option, "args").length
|
||||||
args && count < args.length && (item.value = value||args[count++]||item.value||"")
|
args && count < args.length && (item.value = value||args[count++]||item.value||"")
|
||||||
|
|
||||||
|
item.title = item.title || item.name || ""
|
||||||
|
item.placeholder = item.title
|
||||||
name = item.name || "input"
|
name = item.name || "input"
|
||||||
var input = {type: "input", name: name, data: item}
|
var input = {type: "input", name: name, data: item}
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
@ -725,7 +733,7 @@ function Plugin(page, pane, field, run) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
var ui = kit.AppendChild(option, [{view: [item.view||""], list: [{type: "label", inner: item.label||""}, input]}])
|
var ui = kit.AppendChild(option, [{view: [item.view||""], data: {title: item.title}, list: [{type: "label", inner: item.label||""}, input]}])
|
||||||
var action = Meta(ui[name] || {}, item, plugin.onaction, plugin);
|
var action = Meta(ui[name] || {}, item, plugin.onaction, plugin);
|
||||||
|
|
||||||
(typeof item.imports == "object"? item.imports: typeof item.imports == "string"? [item.imports]: []).forEach(function(imports) {
|
(typeof item.imports == "object"? item.imports: typeof item.imports == "string"? [item.imports]: []).forEach(function(imports) {
|
||||||
@ -812,7 +820,7 @@ function Plugin(page, pane, field, run) {
|
|||||||
}, time)
|
}, time)
|
||||||
},
|
},
|
||||||
Check: function(target, cb) {
|
Check: function(target, cb) {
|
||||||
option.querySelectorAll(".args").forEach(function(item, index, list) {
|
plugin.Select(true), option.querySelectorAll(".args").forEach(function(item, index, list) {
|
||||||
target == undefined && index == list.length-1 && plugin.Runs(window.event, cb)
|
target == undefined && index == list.length-1 && plugin.Runs(window.event, cb)
|
||||||
item == target && (index == list.length-1? plugin.Runs(window.event, cb): page.plugin == field && list[index+1].focus())
|
item == target && (index == list.length-1? plugin.Runs(window.event, cb): page.plugin == field && list[index+1].focus())
|
||||||
})
|
})
|
||||||
@ -828,7 +836,7 @@ function Plugin(page, pane, field, run) {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
event.Plugin = plugin, run(event, args, function(msg) {
|
event.Plugin = plugin, run(event, args, function(msg) {
|
||||||
page.footer.Pane.State("ncmd", kit.History.get("cmd").length)
|
page.footer.Pane.State("ncmd", kit.History.get("cmd").length)
|
||||||
plugin.msg = msg, plugin.display(display.deal, cb)
|
plugin.msg = msg, plugin.display(deal, cb)
|
||||||
show = false, page.ontoast("")
|
show = false, page.ontoast("")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -837,9 +845,17 @@ function Plugin(page, pane, field, run) {
|
|||||||
output.innerHTML = ""
|
output.innerHTML = ""
|
||||||
},
|
},
|
||||||
display: function(arg, cb) {
|
display: function(arg, cb) {
|
||||||
display.deal = arg, plugin.ondaemon[display.deal||"table"](plugin.msg, cb)
|
deal = arg, plugin.ondaemon[deal||"table"](plugin.msg, cb)
|
||||||
},
|
},
|
||||||
ondaemon: {
|
ondaemon: {
|
||||||
|
inner: function(msg, cb) {
|
||||||
|
output.style.maxWidth = pane.target.clientWidth-20+"px"
|
||||||
|
output.style.maxHeight = pane.target.clientHeight-60+"px"
|
||||||
|
output.innerHTML = "", msg.append? kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
||||||
|
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
||||||
|
}): (output.innerHTML = msg.result.join(""))
|
||||||
|
typeof cb == "function" && cb(msg)
|
||||||
|
},
|
||||||
table: function(msg, cb) {
|
table: function(msg, cb) {
|
||||||
output.innerHTML = ""
|
output.innerHTML = ""
|
||||||
!display.hide_append && msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
!display.hide_append && msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
||||||
@ -849,7 +865,7 @@ function Plugin(page, pane, field, run) {
|
|||||||
typeof cb == "function" && cb(msg)
|
typeof cb == "function" && cb(msg)
|
||||||
},
|
},
|
||||||
editor: function(msg, cb) {
|
editor: function(msg, cb) {
|
||||||
(output.innerHTML = "", Editor(plugin, option, output, output.clientWidth-40, 400, 10, msg))
|
(output.innerHTML = "", Editor(run, plugin, option, output, output.clientWidth-40, 400, 10, msg))
|
||||||
},
|
},
|
||||||
canvas: function(msg, cb) {
|
canvas: function(msg, cb) {
|
||||||
typeof cb == "function" && !cb(msg) || (output.innerHTML = "", Canvas(plugin, option, output, pane.target.clientWidth-45, pane.target.clientHeight-175, 10, msg))
|
typeof cb == "function" && !cb(msg) || (output.innerHTML = "", Canvas(plugin, option, output, pane.target.clientWidth-45, pane.target.clientHeight-175, 10, msg))
|
||||||
@ -882,6 +898,9 @@ function Plugin(page, pane, field, run) {
|
|||||||
name != "path" && (value = line.path)
|
name != "path" && (value = line.path)
|
||||||
return value
|
return value
|
||||||
},
|
},
|
||||||
|
tip: function(value, name, line) {
|
||||||
|
return option.tip.value + value
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onaction: {
|
onaction: {
|
||||||
onfocus: function(event, action, type, name, item) {
|
onfocus: function(event, action, type, name, item) {
|
||||||
@ -893,9 +912,8 @@ function Plugin(page, pane, field, run) {
|
|||||||
onclick: function(event, action, type, name, item) {
|
onclick: function(event, action, type, name, item) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "button":
|
case "button":
|
||||||
plugin.Select(true)
|
|
||||||
action[item.click]? action[item.click](event, item, option, field):
|
action[item.click]? action[item.click](event, item, option, field):
|
||||||
plugin[item.click]? plugin[item.click](event, item, option, field): plugin.Runs(event)
|
plugin[item.click]? plugin[item.click](event, item, option, field): plugin.Check()
|
||||||
break
|
break
|
||||||
case "text":
|
case "text":
|
||||||
if (event.ctrlKey) {
|
if (event.ctrlKey) {
|
||||||
@ -908,7 +926,7 @@ function Plugin(page, pane, field, run) {
|
|||||||
action.target.value = kit.History.get("txt", -1).data.trim()
|
action.target.value = kit.History.get("txt", -1).data.trim()
|
||||||
},
|
},
|
||||||
onchange: function(event, action, type, name, item) {
|
onchange: function(event, action, type, name, item) {
|
||||||
plugin.Check(action)
|
plugin.Check(item.action == "auto"? undefined: action)
|
||||||
},
|
},
|
||||||
onkeyup: function(event, action, type, name, item) {
|
onkeyup: function(event, action, type, name, item) {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -733,7 +733,7 @@ kit = toolkit = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function Editor(plugin, option, output, width, height, space, msg) {
|
function Editor(run, plugin, option, output, width, height, space, msg) {
|
||||||
exports = ["dir", "path", "dir"]
|
exports = ["dir", "path", "dir"]
|
||||||
msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
msg.append && kit.OrderTable(kit.AppendTable(kit.AppendChild(output, "table"), ctx.Table(msg), msg.append), exports[1], function(event, value, name, line) {
|
||||||
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
page.Sync("plugin_"+exports[0]).set(plugin.onexport[exports[2]||""](value, name, line))
|
||||||
@ -747,10 +747,10 @@ function Editor(plugin, option, output, width, height, space, msg) {
|
|||||||
], function(value, event) {
|
], function(value, event) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "追加":
|
case "追加":
|
||||||
field.Run(event, args.concat(["dir_sed", "add"]))
|
run(event, args.concat(["dir_sed", "add"]))
|
||||||
break
|
break
|
||||||
case "提交":
|
case "提交":
|
||||||
field.Run(event, args.concat(["dir_sed", "put"]))
|
run(event, args.concat(["dir_sed", "put"]))
|
||||||
break
|
break
|
||||||
case "取消":
|
case "取消":
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user