forked from x/icebergs
mix some
This commit is contained in:
commit
e9ca73ec7b
@ -1196,6 +1196,9 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
||||
// 收藏详情
|
||||
m.Grows(ice.WEB_FAVOR, kit.Keys(kit.MDB_HASH, key), "id", arg[1], func(index int, value map[string]interface{}) {
|
||||
m.Push("detail", value)
|
||||
m.Optionv("value", value)
|
||||
m.Push("key", "render")
|
||||
m.Push("value", m.Cmdx(m.Conf(ice.WEB_FAVOR, kit.Keys("meta.render", value["type"]))))
|
||||
})
|
||||
})
|
||||
return
|
||||
|
@ -1,9 +1,10 @@
|
||||
package wiki
|
||||
|
||||
import (
|
||||
"github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/toolkits"
|
||||
"strings"
|
||||
|
||||
ice "github.com/shylinux/icebergs"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
)
|
||||
|
||||
// 图形接口
|
||||
@ -260,12 +261,15 @@ func (b *Chain) draw(m *ice.Message, root map[string]interface{}, depth int, wid
|
||||
|
||||
// 当前节点
|
||||
item := &Block{
|
||||
BackGround: kit.Select(b.BackGround, kit.Select(p.BackGround, meta["bg"])),
|
||||
FontColor: kit.Select(b.FontColor, kit.Select(p.FontColor, meta["fg"])),
|
||||
BackGround: kit.Select(b.BackGround, kit.Select(p.BackGround)),
|
||||
FontColor: kit.Select(b.FontColor, kit.Select(p.FontColor)),
|
||||
FontSize: b.FontSize,
|
||||
Padding: b.Padding,
|
||||
Margin: b.Margin,
|
||||
}
|
||||
if m.Option("compact") != "true" {
|
||||
item.Width = b.max[depth]
|
||||
}
|
||||
item.Init(m, kit.Format(meta["text"])).Data(m, meta)
|
||||
item.Draw(m, x, y+(kit.Int(meta["height"])-1)*b.GetHeights()/2)
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package wiki
|
||||
|
||||
import (
|
||||
"github.com/shylinux/icebergs"
|
||||
ice "github.com/shylinux/icebergs"
|
||||
_ "github.com/shylinux/icebergs/base"
|
||||
"github.com/shylinux/icebergs/base/web"
|
||||
"github.com/shylinux/toolkits"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
|
||||
"fmt"
|
||||
"os"
|
||||
@ -212,8 +212,11 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
||||
data := kit.Dict()
|
||||
cmds := kit.Split(arg[1])
|
||||
m.Search(cmds[0], func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) {
|
||||
ls := strings.Split(cmds[0], ".")
|
||||
if ls := strings.Split(cmds[0], "."); len(ls) > 1 {
|
||||
m.Cmd(ice.CTX_COMMAND, strings.Join(ls[:len(ls)-1], "."), key)
|
||||
} else {
|
||||
m.Cmd(ice.CTX_COMMAND, key)
|
||||
}
|
||||
if data["feature"], data["inputs"] = cmd.Meta, cmd.List; len(cmd.List) == 0 {
|
||||
data["inputs"] = m.Confv("field", "meta.some.simple.inputs")
|
||||
}
|
||||
@ -312,7 +315,8 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
||||
m.Option("stroke-width", "2")
|
||||
m.Option("padding", "10")
|
||||
m.Option("margin", "10")
|
||||
m.Option("font-family", kit.Select("", "monospace", len(arg[2]) == len([]rune(arg[2]))))
|
||||
// m.Option("font-family", kit.Select("", "monospace", len(arg[2]) == len([]rune(arg[2]))))
|
||||
m.Option("font-family", "monospace")
|
||||
for i := 6; i < len(arg)-1; i++ {
|
||||
m.Option(arg[i], arg[i+1])
|
||||
}
|
||||
|
@ -94,11 +94,12 @@ highlight Comment ctermfg=cyan ctermbg=darkblue
|
||||
call ShyDefine("g:favor_tab", "")
|
||||
call ShyDefine("g:favor_note", "")
|
||||
let shyList=["启动流程", "请求响应", "服务集群", "数据结构", "系统架构", "编译原理"]
|
||||
let g:favor_prefix=""
|
||||
fun! ShyFavor()
|
||||
" let g:favor_tab = input("tab: ", g:favor_tab)
|
||||
let g:favor_tab = g:shyList[inputlist(g:shyList)-1]
|
||||
let g:favor_note = input("note: ", g:favor_note)
|
||||
call ShySend("favor", {"tab": g:favor_tab, "note": g:favor_note, "arg": getline("."), "row": getpos(".")[1], "col": getpos(".")[2]})
|
||||
call ShySend("favor", {"tab": g:favor_prefix . g:favor_tab, "note": g:favor_note, "arg": getline("."), "row": getpos(".")[1], "col": getpos(".")[2]})
|
||||
endfun
|
||||
fun! ShyFavors()
|
||||
" let res = split(ShySend("favor", {"tab": input("tab: ", g:favor_tab)}), "\n")
|
||||
|
@ -1,6 +1,8 @@
|
||||
package vim
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
ice "github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/icebergs/base/web"
|
||||
"github.com/shylinux/icebergs/core/code"
|
||||
@ -31,12 +33,18 @@ var Index = &ice.Context{Name: "vim", Help: "编辑器",
|
||||
switch value["name"] {
|
||||
case "read", "write", "exec":
|
||||
p := path.Join(kit.Format(kit.Value(value, "extra.pwd")), kit.Format(kit.Value(value, "extra.buf")))
|
||||
if strings.HasPrefix(kit.Format(kit.Value(value, "extra.buf")), "/") {
|
||||
p = path.Join(kit.Format(kit.Value(value, "extra.buf")))
|
||||
}
|
||||
|
||||
f, e := os.Open(p)
|
||||
m.Assert(e)
|
||||
defer f.Close()
|
||||
b, e := ioutil.ReadAll(f)
|
||||
m.Assert(e)
|
||||
m.Echo(string(b))
|
||||
default:
|
||||
m.Cmdy(ice.CLI_SYSTEM, "sed", "-n", fmt.Sprintf("/%s/,/^}$/p", value["text"]), kit.Value(value, "extra.buf"))
|
||||
}
|
||||
}}))
|
||||
}},
|
||||
@ -84,9 +92,11 @@ var Index = &ice.Context{Name: "vim", Help: "编辑器",
|
||||
}
|
||||
}
|
||||
|
||||
ls := strings.Split(m.Option("pwd"), "/")
|
||||
m.Option("you", ls[len(ls)-1])
|
||||
m.Richs("login", nil, m.Option("sid"), func(key string, value map[string]interface{}) {
|
||||
// 查找空间
|
||||
m.Option("you", value["you"])
|
||||
m.Option("you", kit.Select(m.Option("you"), value["you"]))
|
||||
})
|
||||
|
||||
m.Logs(ice.LOG_AUTH, "you", m.Option("you"), "url", m.Option(ice.MSG_USERURL), "cmd", m.Optionv("cmds"), "sub", m.Optionv("sub"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user