From 7d4a0efa097a96ae2356a1b066458cf2651c90aa Mon Sep 17 00:00:00 2001 From: shaoying Date: Mon, 9 Dec 2019 20:49:05 +0800 Subject: [PATCH] add icebergs --- Makefile | 1 + src/contexts/ctx/type.go | 1 + src/plugin/story/index.shy | 11 +++++------ usr/librarys/example.js | 15 ++++++++++++--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 320d00d1..e47662e4 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ install:prepare @bin/boot.sh restart && date prepare: + @go get github.com/shylinux/icebergs @go get github.com/shylinux/toolkits @go get github.com/nsf/termbox-go @go get github.com/gorilla/websocket diff --git a/src/contexts/ctx/type.go b/src/contexts/ctx/type.go index 17f7f323..eece3e93 100644 --- a/src/contexts/ctx/type.go +++ b/src/contexts/ctx/type.go @@ -2,6 +2,7 @@ package ctx import ( "fmt" + _ "github.com/shylinux/icebergs" "strconv" "strings" "time" diff --git a/src/plugin/story/index.shy b/src/plugin/story/index.shy index 0c46169e..29af974f 100644 --- a/src/plugin/story/index.shy +++ b/src/plugin/story/index.shy @@ -1,7 +1,6 @@ kit share "共享" public "web.chat.share" \ - select "" name type values "wiki file" \ + select "" name kind values "wiki file" \ text "miss.md" name story imports plugin_story view long \ - feature display chart \ button "共享" kit note "记事本" public "_:web.wiki.note" "@you" \ @@ -43,10 +42,10 @@ kit xls "表格" "index.js" "index.css" private "web.wiki.xls" \ exports xls_id id kit chart "图表" public "web.wiki.chart" \ - select "" name type values "chain block" action auto \ + select "" name kind values "chain block" action auto \ textarea "" name happy half 4 height "200px" \ - select "" name type values "white red yellow green blue black" action auto \ - select "" name type values "black blue green yellow red white" action auto \ - feature display chart \ + select "" name kind values "white red yellow green blue black" action auto \ + select "" name kind values "black blue green yellow red white" action auto \ + feature display inner \ button "查看" diff --git a/usr/librarys/example.js b/usr/librarys/example.js index e8d37ee2..eb729341 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -684,9 +684,18 @@ function Pane(page, field) { if (type == "plugin" && line.name || type == "field") { page.Require(line.init? line.group+"/"+line.init: "", function(init) { page.Require(line.view? line.group+"/"+line.view: "", function(view) { - can.user.carte = page.carte.Pane.Show - can.user.toast = page.toast.Pane.Show - line.group == "favor" && can.Plugin(can, ui.item.Meta, function(event, cmds, cbs) { + can.user.carte = page.carte.Pane.Show; + can.user.toast = page.toast.Pane.Show; + ( + line.group == "docker" || + line.group == "story" || + line.group == "favor" + ) && can.Plugin(can, ui.item.Meta, function(event, cmds, cbs) { + var msg = ctx.Event(event) + kit.Selector(action, "input", function(item, index) { + item.value && msg.Option(item.name, item.value) + }) + ctx.Run(event, option.dataset, [line.river, line.storm, line.action].concat(cmds), cbs) }, ui.item) || pane.Plugin(page, pane, ui.item, init, function(event, cmds, cbs) {