1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

fix wiki err

This commit is contained in:
shylinux 2019-07-27 05:59:27 +08:00
parent ab9ba1f46c
commit 28493d4ba5
5 changed files with 15 additions and 10 deletions

View File

@ -4,5 +4,5 @@ var version = struct {
host string host string
self int self int
}{ }{
"2019-07-26 20:50:41", "ZYB-20190522USI", 272, "2019-07-27 05:58:32", "com", 218,
} }

View File

@ -80,9 +80,9 @@ func dir(m *ctx.Message, root string, name string, level int, deep bool, dir_typ
} }
case "file": case "file":
if f.IsDir() { if f.IsDir() {
m.Add("append", "name", f.Name()+"/") m.Add("append", "file", f.Name()+"/")
} else { } else {
m.Add("append", "name", f.Name()) m.Add("append", "file", f.Name())
} }
case "name": case "name":
m.Add("append", "name", f.Name()) m.Add("append", "name", f.Name())

View File

@ -66,11 +66,13 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心",
}, },
Commands: map[string]*ctx.Command{ Commands: map[string]*ctx.Command{
"wiki_tree": &ctx.Command{Name: "wiki_tree", Help: "wiki_tree", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "wiki_tree": &ctx.Command{Name: "wiki_tree", Help: "wiki_tree", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
m.Cmdy("nfs.dir", path.Join(m.Confx("wiki_level"), kit.Select(m.Option("wiki_class"), arg, 0)), "dir_sort", "time", "time_r") m.Cmdy("nfs.dir", path.Join(m.Confx("wiki_level"), kit.Select(m.Option("wiki_class"), arg, 0)),
"time", "line", "size", "file", "dir_sort", "time", "time_r")
return return
}}, }},
"wiki_text": &ctx.Command{Name: "wiki_text", Help: "wiki_text", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "wiki_text": &ctx.Command{Name: "wiki_text", Help: "wiki_text", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
which := m.Cmdx("nfs.path", path.Join(m.Confx("wiki_level"), m.Option("wiki_class"), m.Confx("wiki_favor", arg, 0))) which := m.Cmdx("nfs.path", path.Join(m.Confx("wiki_level"), m.Option("wiki_class"), m.Confx("wiki_favor", arg, 0)),
"time", "line", "size", "file")
if ls, e := ioutil.ReadFile(which); e == nil { if ls, e := ioutil.ReadFile(which); e == nil {
m.Conf("wiki_visit", []string{which, m.Option("access")}, m.Conf("wiki_visit", []string{which, m.Option("access")},

View File

@ -49,7 +49,7 @@ fieldset>div.action>div.space {
} }
fieldset>div.output { fieldset>div.output {
clear:both; clear:both;
max-height:800px; /* max-height:800px; */
padding:6px; padding:6px;
} }
fieldset>div.output div.item:hover { fieldset>div.output div.item:hover {

View File

@ -64,13 +64,13 @@ var page = Page({
}))) })))
ui.tree.innerHTML = "", kit.AppendChild(ui.tree, ctx.Table(msg, function(value, index) { ui.tree.innerHTML = "", kit.AppendChild(ui.tree, ctx.Table(msg, function(value, index) {
return value.filename.endsWith("/") && {"text": [value.filename, "div"], click: function(event, target) { return value.file.endsWith("/") && {"text": [value.file, "div"], click: function(event, target) {
location.hash = "", ctx.Search({"wiki_class": ctx.Search("wiki_class")+value.filename, "wiki_favor": ""}) location.hash = "", ctx.Search({"wiki_class": ctx.Search("wiki_class")+value.file, "wiki_favor": ""})
}} }}
})) }))
ui.list.innerHTML = "", kit.AppendChild(ui.list, ctx.Table(msg, function(value, index) { ui.list.innerHTML = "", kit.AppendChild(ui.list, ctx.Table(msg, function(value, index) {
return !value.filename.endsWith("/") && {"text": [value.time.substr(5, 5)+" "+value.filename, "div"], click: function(event, target) { return !value.file.endsWith("/") && {"text": [value.time.substr(5, 5)+" "+value.file, "div"], click: function(event, target) {
location.hash = "", ctx.Search("wiki_favor", value.filename) location.hash = "", ctx.Search("wiki_favor", value.file)
}} }}
})) }))
}) })
@ -93,6 +93,9 @@ var page = Page({
page.Conf("menu.display", value || (page.Conf("menu.display")? "": "none")) page.Conf("menu.display", value || (page.Conf("menu.display")? "": "none"))
}, },
Size: function(width, height) { Size: function(width, height) {
if (kit.isMobile) {
return
}
if (page.Conf("menu.float")) { if (page.Conf("menu.float")) {
ui.menu.className = "menu left" ui.menu.className = "menu left"
} else { } else {