Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c70ba27cb | ||
|
|
683b7a5f2d |
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user