1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
shaoying 2019-11-06 06:41:14 +08:00
parent e73ac8b419
commit f4ef781198
3 changed files with 19 additions and 0 deletions

View File

@ -66,6 +66,11 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心",
return return
}}, }},
"svg": {Name: "svg", Help: "绘图", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
m.Echo(arg[0])
return
}},
"xls": {Name: "xls", Help: "表格", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "xls": {Name: "xls", Help: "表格", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
switch len(arg) { switch len(arg) {
case 0: case 0:

View File

@ -53,3 +53,9 @@ fun salary "工资单" public \
append "结余" $rest append "结余" $rest
end end
kit svg "绘图" public "web.wiki.svg" \
text "download/usr/script/teacherInfo.svg" name svg \
feature display svg \
button "查看"

View File

@ -1510,6 +1510,14 @@ function Output(plugin, type, msg, cb, target, option) {
output.onimport.meta._table(msg, msg.append) || kit.OrderCode(kit.ModifyNode(target, msg.result.join(""))) output.onimport.meta._table(msg, msg.append) || kit.OrderCode(kit.ModifyNode(target, msg.result.join("")))
kit._call(cb, [msg]) kit._call(cb, [msg])
}, },
_svg: function(target, width, height, src) {
target.innerHTML = '<embed src="'+src+'" width="'+width+'" height="'+height+'" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />'
},
svg: function(msg, cb) {
plugin.onfigure.meta.size(function(width, height) {
output.onimport.meta._svg(output.target, width, height*1.6, msg.result.join(""))
})
},
editor: function(msg, cb) { editor: function(msg, cb) {
output.onimport.meta.table(msg, cb) output.onimport.meta.table(msg, cb)