Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c70ba27cb | ||
|
|
683b7a5f2d | ||
|
|
a77f28fbcf | ||
|
|
6291742690 |
@@ -605,6 +605,7 @@ li.task-expanded .task-toggle {
|
||||
.task-middle {
|
||||
margin-left: 40px;
|
||||
margin-right: 20px;
|
||||
padding-right: 2.5em;
|
||||
}
|
||||
|
||||
#tasklist {
|
||||
@@ -793,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 {
|
||||
|
||||
@@ -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 {
|
||||
_, taskID, _ := a.Cur(r)
|
||||
toList := form.Get(r, "to")
|
||||
|
||||
list, err := a.storageGetList(toList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
movedTask, err := a.storageGetTask(taskID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := a.storageDelTask(taskID); err != nil {
|
||||
return err
|
||||
}
|
||||
movedTask.Index = list.NextIndex()
|
||||
if err := a.storageSetTask(toList, movedTask); err != nil {
|
||||
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}})
|
||||
}
|
||||
|
||||
|
||||
@@ -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