diff --git a/src/examples/wiki/wiki.go b/src/examples/wiki/wiki.go index 5aaaf5b1..f5c7bd36 100644 --- a/src/examples/wiki/wiki.go +++ b/src/examples/wiki/wiki.go @@ -66,6 +66,11 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心", 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) { switch len(arg) { case 0: diff --git a/src/plugin/favor/index.shy b/src/plugin/favor/index.shy index 945d6414..ef9463a4 100644 --- a/src/plugin/favor/index.shy +++ b/src/plugin/favor/index.shy @@ -53,3 +53,9 @@ fun salary "工资单" public \ append "结余" $rest end +kit svg "绘图" public "web.wiki.svg" \ + text "download/usr/script/teacherInfo.svg" name svg \ + feature display svg \ + button "查看" + + diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 3458bcc1..d1b8a577 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -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(""))) kit._call(cb, [msg]) }, + _svg: function(target, width, height, src) { + target.innerHTML = '' + }, + 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) { output.onimport.meta.table(msg, cb)