mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Use monospace when editing a file
Files are determined if they have a period in the name.
Former-commit-id: 8ae103ccf40f20a2c0a385021fad70caf614ca51 [formerly 23e44beb2ececa617280feb256a94900342cbdc4] [formerly 4872f2c5eaa25e32514c01aabd63355e6cb1d5d4 [formerly 518ee34f5615b9c9a6e3b5b68322df2c8a221ae8]]
Former-commit-id: c646c3b38b5cf7d2552f9aac8d1802ef98e9170b [formerly 71bb4f2d64a0c87f9b881e612091ec98253721fa]
Former-commit-id: a60d4c8180b584dea243391a7a41abc175524afb
Former-commit-id: 5f42c319a2
This commit is contained in:
@@ -89,11 +89,10 @@ func handlePageRequest(c *gin.Context) {
|
|||||||
if !p.IsLocked && !p.IsEncrypted {
|
if !p.IsLocked && !p.IsEncrypted {
|
||||||
p.Erase()
|
p.Erase()
|
||||||
c.Redirect(302, "/"+page+"/edit")
|
c.Redirect(302, "/"+page+"/edit")
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
c.Redirect(302, "/"+page+"/view")
|
c.Redirect(302, "/"+page+"/view")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
rawText := p.Text.GetCurrent()
|
rawText := p.Text.GetCurrent()
|
||||||
rawHTML := p.RenderedPage
|
rawHTML := p.RenderedPage
|
||||||
@@ -146,6 +145,7 @@ func handlePageRequest(c *gin.Context) {
|
|||||||
"IsEncrypted": p.IsEncrypted,
|
"IsEncrypted": p.IsEncrypted,
|
||||||
"ListItems": renderList(rawText),
|
"ListItems": renderList(rawText),
|
||||||
"Route": "/" + page + command,
|
"Route": "/" + page + command,
|
||||||
|
"HasDotInName": strings.Contains(page, "."),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,6 +82,7 @@
|
|||||||
-moz-box-shadow: none;
|
-moz-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
resize: none;
|
resize: none;
|
||||||
|
{{ if .HasDotInName }}font-family: "Lucida Console", Monaco, monospace{{ end }}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user