1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added /v /l to Fix #51

Former-commit-id: 32996f7efeb1924839ec83de15e72880a3a4c4da [formerly 73b08b487ebd036d83a97d62102b4fa043084dc1] [formerly 39ce9753f80d3aa08ef9e9db20d2455364b647ef [formerly 705cdf8b87]]
Former-commit-id: e2e0c4a0ebc2d817525f3a3e29147bf97e62bb14 [formerly 79e05aae99bab06a9b2f76dd8252cfced37a8242]
Former-commit-id: 50d9800b33eab7df7c74449952ebdaee8860b57c
This commit is contained in:
Zack Scholl 2016-06-29 19:55:59 -04:00
parent bd276c8ab4
commit d49f231f83

View File

@ -308,7 +308,7 @@ func editNote(c *gin.Context) {
func everythingElse(c *gin.Context) { func everythingElse(c *gin.Context) {
option := c.Param("option") option := c.Param("option")
title := c.Param("title") title := c.Param("title")
if option == "/view" { if option == "/view" || option == "/v" {
version := c.DefaultQuery("version", "-1") version := c.DefaultQuery("version", "-1")
noprompt := c.DefaultQuery("noprompt", "-1") noprompt := c.DefaultQuery("noprompt", "-1")
versionNum, _ := strconv.Atoi(version) versionNum, _ := strconv.Atoi(version)
@ -340,7 +340,7 @@ func everythingElse(c *gin.Context) {
c.Data(200, contentType(title), []byte(currentText)) c.Data(200, contentType(title), []byte(currentText))
} else if title == "ls" && option == "/"+RuntimeArgs.AdminKey && len(RuntimeArgs.AdminKey) > 1 { } else if title == "ls" && option == "/"+RuntimeArgs.AdminKey && len(RuntimeArgs.AdminKey) > 1 {
renderMarkdown(c, listEverything(), "ls", nil, RuntimeArgs.AdminKey, time.Now().Sub(time.Now()), false, false, false, []string{}) renderMarkdown(c, listEverything(), "ls", nil, RuntimeArgs.AdminKey, time.Now().Sub(time.Now()), false, false, false, []string{})
} else if option == "/list" { } else if option == "/list" || option == "/l" {
renderList(c, title) renderList(c, title)
} else if title == "static" { } else if title == "static" {
serveStaticFile(c, option) serveStaticFile(c, option)