2 Commits
v0.6 ... v0.8

Author SHA1 Message Date
bel
7c70ba27cb fix multi-line task note preview 2020-02-02 06:13:27 +00:00
bel
683b7a5f2d Fix pda technically 2020-02-02 05:49:17 +00:00
2 changed files with 17 additions and 0 deletions

View File

@@ -794,6 +794,7 @@ li:hover a.taskactionbtn, a.taskactionbtn.mtt-menu-button-active {
min-height: 16px;
display: none;
margin: .7em .5em 0 0;
white-space: pre;
}
li.task-expanded .task-note-block {

View File

@@ -12,6 +12,7 @@ import (
"os"
"path"
"path/filepath"
"strings"
)
func (s *Server) Routes() error {
@@ -27,6 +28,10 @@ func (s *Server) Routes() error {
path: "/mytinytodo_lang.php",
handler: s.gzip(s.lang),
},
{
path: fmt.Sprintf("/themes/%s%s", router.Wildcard, router.Wildcard),
handler: s.gzip(s.handleDeviceCSS),
},
{
path: fmt.Sprintf("%s%s", router.Wildcard, router.Wildcard),
handler: s.gzip(s.phpProxy),
@@ -119,3 +124,14 @@ func (s *Server) gzip(h http.HandlerFunc) http.HandlerFunc {
h(w, r)
}
}
func (s *Server) handleDeviceCSS(w http.ResponseWriter, r *http.Request) {
if _, ok := r.URL.Query()["pda"]; ok || strings.Contains(r.Header.Get("User-Agent"), "Android") || strings.Contains(r.Header.Get("User-Agent"), "Mobile") {
if path.Base(r.URL.Path) == "print.css" {
r.URL.Path = path.Join(path.Dir(r.URL.Path), "pda.css")
http.Redirect(w, r, r.URL.String(), http.StatusSeeOther)
return
}
}
s.static(w, r)
}