4 Commits
v0.5 ... 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
bel
a77f28fbcf fix moving item to new list and keeping old ordering 2020-02-02 04:12:37 +00:00
bel
6291742690 more whitespace on the right of tasks 2020-02-02 04:03:11 +00:00
3 changed files with 29 additions and 0 deletions

View File

@@ -605,6 +605,7 @@ li.task-expanded .task-toggle {
.task-middle { .task-middle {
margin-left: 40px; margin-left: 40px;
margin-right: 20px; margin-right: 20px;
padding-right: 2.5em;
} }
#tasklist { #tasklist {
@@ -793,6 +794,7 @@ li:hover a.taskactionbtn, a.taskactionbtn.mtt-menu-button-active {
min-height: 16px; min-height: 16px;
display: none; display: none;
margin: .7em .5em 0 0; margin: .7em .5em 0 0;
white-space: pre;
} }
li.task-expanded .task-note-block { li.task-expanded .task-note-block {

View File

@@ -160,16 +160,27 @@ func (a *Ajax) setPrio(w http.ResponseWriter, r *http.Request) error {
func (a *Ajax) moveTask(w http.ResponseWriter, r *http.Request) error { func (a *Ajax) moveTask(w http.ResponseWriter, r *http.Request) error {
_, taskID, _ := a.Cur(r) _, taskID, _ := a.Cur(r)
toList := form.Get(r, "to") toList := form.Get(r, "to")
list, err := a.storageGetList(toList)
if err != nil {
return err
}
movedTask, err := a.storageGetTask(taskID) movedTask, err := a.storageGetTask(taskID)
if err != nil { if err != nil {
return err return err
} }
if err := a.storageDelTask(taskID); err != nil { if err := a.storageDelTask(taskID); err != nil {
return err return err
} }
movedTask.Index = list.NextIndex()
if err := a.storageSetTask(toList, movedTask); err != nil { if err := a.storageSetTask(toList, movedTask); err != nil {
return err return err
} }
if err := a.storageSetList(list); err != nil {
return err
}
return json.NewEncoder(w).Encode(map[string]interface{}{"total": 1, "list": []*task.Task{movedTask}}) return json.NewEncoder(w).Encode(map[string]interface{}{"total": 1, "list": []*task.Task{movedTask}})
} }

View File

@@ -12,6 +12,7 @@ import (
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"strings"
) )
func (s *Server) Routes() error { func (s *Server) Routes() error {
@@ -27,6 +28,10 @@ func (s *Server) Routes() error {
path: "/mytinytodo_lang.php", path: "/mytinytodo_lang.php",
handler: s.gzip(s.lang), 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), path: fmt.Sprintf("%s%s", router.Wildcard, router.Wildcard),
handler: s.gzip(s.phpProxy), handler: s.gzip(s.phpProxy),
@@ -119,3 +124,14 @@ func (s *Server) gzip(h http.HandlerFunc) http.HandlerFunc {
h(w, r) 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)
}