diff --git a/etc/conf/auto.sh b/etc/conf/auto.sh index b5998c62..eb3e4c7b 100644 --- a/etc/conf/auto.sh +++ b/etc/conf/auto.sh @@ -104,9 +104,8 @@ ShyFavor() { ShyPost cmd favor arg "`history|tail -n2|head -n1`" tab "${ctx_tab}" note "${ctx_note}" } ShyFavors() { - [ "$READLINE_LINE" = "" ] && ShyPost cmd favor tab "$1" && return - ShyPost cmd favor tab "$1" >$READLINE_LINE - READLINE_LINE="" + [ "$READLINE_LINE" != "" ] && set $READLINE_LINE && READLINE_LINE="" + ShyPost cmd favor tab "$1" } ShySync() { [ "$ctx_sid" = "" ] && ShyLogin @@ -172,6 +171,8 @@ ShyInit() { *) PS1="\!-$$-\t[\u@\h]\W\$ " PS1="\e[32m\!\e[0m-$$-\e[31m$SPY_OWNER\e[0m@\e[33m$SPY_ROLE\e[0m[\e[32m\t\e[0m]\W\$ " + PS1="\!-$$-\t[\u@\h]\W\$ " + PS1="\!-$$-\u@\h[\t]\W\$ " ;; esac diff --git a/etc/conf/auto.vim b/etc/conf/auto.vim index 73439a5a..d09cc5a8 100644 --- a/etc/conf/auto.vim +++ b/etc/conf/auto.vim @@ -71,7 +71,14 @@ fun! ShyFavors() let msg = json_decode(ShyPost({"cmd": "favors"})) let i = 0 for i in range(len(msg["tab"])) - tabnew + if msg["tab"][i] == "" + continue + endif + if exists(":TabooOpen") + execute "TabooOpen " . msg["tab"][i] + else + tabnew + endif lexpr msg["fix"][i] lopen endfor @@ -91,7 +98,7 @@ endfun fun! ShyGrep(word) if !exists("g:grep_dir") | let g:grep_dir = "./" | endif let g:grep_dir = input("dir: ", g:grep_dir, "file") - execute "grep -rn --exclude tags --exclude '*.tags' " . a:word . " " . g:grep_dir + execute "grep -rn --exclude tags --exclude '\..*' --exclude '*.tags' " . a:word . " " . g:grep_dir endfun fun! ShyTag(word) execute "tag " . a:word diff --git a/etc/conf/vimrc b/etc/conf/vimrc index 0326daea..efd9ca7d 100644 --- a/etc/conf/vimrc +++ b/etc/conf/vimrc @@ -18,6 +18,7 @@ let g:ctrlp_cmd='CtrlPBuffer' Plug 'vim-scripts/tComment' Plug 'tpope/vim-fugitive' Plug 'gcmt/taboo.vim' +set sessionoptions+=tabpages,globals Plug 'fatih/vim-go' Plug 'fatih/vim-go' @@ -30,7 +31,6 @@ Plug 'plasticboy/vim-markdown' " Plug 'ntpeters/vim-better-whitespace' " Plug 'easymotion/vim-easymotion' " -" set sessionoptions+=tabpages,globals " " let g:Tlist_WinWidth=45 " let g:Tlist_Exit_OnlyWindow=1 diff --git a/src/examples/code/code.go b/src/examples/code/code.go index fe74d20e..1eff6ce5 100644 --- a/src/examples/code/code.go +++ b/src/examples/code/code.go @@ -893,7 +893,7 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心", case "logout": m.Cmd("login", "exit") case "tasklet": - m.Cmd("web.team.task", "create", "task", "3", "add", "action", m.Time(), m.Time("10m"), m.Option("arg"), m.Option("sub")) + m.Cmd("ssh._route", m.Option("dream"), "web.team.task", "create", "task", "3", "add", "action", m.Time(), m.Time("10m"), m.Option("arg"), m.Option("sub")) case "favors": data := map[string][]string{} diff --git a/src/examples/team/team.go b/src/examples/team/team.go index 96daa7ee..e20fb181 100644 --- a/src/examples/team/team.go +++ b/src/examples/team/team.go @@ -14,10 +14,10 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心", "task": {Name: "task create table level class status begin_time close_time target detail arg...", Help: "任务", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { switch arg[0] { case "progress": - // 任务进度 - if len(arg) > 2 { + if len(arg) > 2 && arg[1] != "" { switch arg[2] { case "prepare", "action", "cancel", "finish": + prefix := []string{"ssh._route", m.Option("dream"), "ssh.data", "update"} time := "close_time" switch arg[2] { case "prepare", "action": @@ -28,10 +28,12 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心", time = "update_time" } - m.Cmd("ssh.data", "update", m.Option("table"), arg[1], "status", arg[2], time, m.Time()) + // 更新任务 + m.Cmd(prefix, m.Option("table"), arg[1], "status", arg[2], time, m.Time()) arg = []string{arg[0], m.Option("table")} } } + // 任务进度 m.Option("cache.limit", kit.Select("30", arg, 2)) m.Option("cache.offset", kit.Select("0", arg, 3)) m.Meta["append"] = []string{"prepare", "action", "cancel", "finish"} @@ -55,7 +57,7 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心", arg = []string{arg[1]} fallthrough default: - // 修改任务 + // 更新任务 if len(arg) > 1 && arg[1] == "modify" { m.Cmdy("ssh.data", "update", m.Option("table"), m.Option("index"), arg[2], arg[3]) break diff --git a/src/examples/wiki/wiki.go b/src/examples/wiki/wiki.go index 8be0c753..400d8af9 100644 --- a/src/examples/wiki/wiki.go +++ b/src/examples/wiki/wiki.go @@ -80,8 +80,8 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心", tmpl := template.New("render").Funcs(*ctx.LocalCGI(m, c)) m.Confm("template", "list", func(index int, value string) { tmpl = template.Must(tmpl.Parse(value)) }) - tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Conf("route", "template_dir"), "/*.tmpl"))) - tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Conf("route", "template_dir"), m.Cap("route"), "/*.tmpl"))) + tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Cmdx("nfs.path", m.Conf("route", "template_dir")), "/*.tmpl"))) + tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Cmdx("nfs.path", m.Conf("route", "template_dir")), m.Cap("route"), "/*.tmpl"))) tmpl = template.Must(tmpl.ParseFiles(which)) for i, v := range tmpl.Templates() { m.Log("info", "%v, %v", i, v.Name()) diff --git a/src/plugin/feature/index.shy b/src/plugin/feature/index.shy index 6dd83516..6030c16b 100644 --- a/src/plugin/feature/index.shy +++ b/src/plugin/feature/index.shy @@ -14,14 +14,16 @@ fun date "每一天" "index.js" "index.css" protected \ end end -kit progress "任务进度" public "web.team.task" progress \ +kit progress "任务进度" public "ssh._route" _ "web.team.task" progress \ + text "" name dream imports plugin_you \ text "task" name table \ text "30" name limit \ text "0" name offset \ feature detail action finish cancel prepare \ button "查看" action auto -kit create "创建任务" public "web.team.task" create \ +kit create "创建任务" public "ssh._route" _ "web.team.task" create \ + text "" name dream imports plugin_you \ text "task" name table \ select "3" name level values 1 values 2 values 3 values 4 values 5 \ select "" name class values add values opt values fix \ @@ -32,7 +34,8 @@ kit create "创建任务" public "web.team.task" create \ textarea "" name detail half "4" \ button "添加" before br -kit select "查看任务" public "web.team.task" \ +kit select "查看任务" public "ssh._route" _ "web.team.task" \ + text "" name dream imports plugin_you \ text "task" name table imports pluing_table \ text "" name index imports plugin_task_id action auto \ button "查看" action auto \ diff --git a/src/plugin/story/index.shy b/src/plugin/story/index.shy index 25fc5613..7d97ceb6 100644 --- a/src/plugin/story/index.shy +++ b/src/plugin/story/index.shy @@ -1,5 +1,5 @@ kit note "记事本" public "ssh._route" _ "web.wiki.note" \ - text "" name dream imports plugin_dream action auto \ + text "" name dream imports plugin_you action auto \ text "miss.md" name story imports plugin_story view long action auto \ button "查看" action auto \ button "返回" cb Last \ @@ -16,7 +16,7 @@ kit favor "收藏夹" public "ssh._route" _ "web.wiki.story" favor \ button "返回" cb Last kit commit "记录" public "ssh._route" _ "web.wiki.story" commit \ - text "" name dream imports plugin_dream \ + text "" name dream imports plugin_you \ text "miss.md" name story imports plugin_story \ text "table" name sence \ text "hello" name enjoy \ @@ -24,11 +24,11 @@ kit commit "记录" public "ssh._route" _ "web.wiki.story" commit \ button "提交" kit branch "分支" public "ssh._route" _ "web.wiki.story" branch \ - text "" name dream imports plugin_dream \ + text "" name dream imports plugin_you \ button "查看" kit remote "仓库" public "ssh._route" _ "web.wiki.story" remote \ - text "" name dream imports plugin_dream \ + text "" name dream imports plugin_you \ button "查看" kit xls "表格" "index.js" "index.css" private "web.wiki.xls" \ diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 2a84911c..5965ab86 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -1072,6 +1072,9 @@ function Plugin(page, pane, field, inits, runs) { item.autocomplete = "off" break } + kit.List((item.clist||"").split(" "), function(value) { + kit.classList.add(item, value) + }) kit.classList.add(item, item.view) return Inputs(plugin, input, item, plugin.View(option, "input", input)[input.name], option).target }),