Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0f336ca67 | ||
|
|
f8b5eb71e0 | ||
|
|
7c70ba27cb | ||
|
|
683b7a5f2d | ||
|
|
a77f28fbcf | ||
|
|
6291742690 |
@@ -14,7 +14,6 @@ var (
|
||||
StoreUser string
|
||||
StorePass string
|
||||
Root string
|
||||
MyTinyTodo string
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -32,7 +31,6 @@ func Refresh() {
|
||||
as.Append(args.STRING, "storeaddr", "addr of store", "")
|
||||
as.Append(args.STRING, "storeuser", "user of store", "")
|
||||
as.Append(args.STRING, "storepass", "pass of store", "")
|
||||
as.Append(args.STRING, "mtt", "url of php server", "http://localhost:38808")
|
||||
as.Append(args.STRING, "root", "root of static files", "./public")
|
||||
if err := as.Parse(); err != nil {
|
||||
panic(err)
|
||||
@@ -44,5 +42,4 @@ func Refresh() {
|
||||
StoreUser = as.Get("storeuser").GetString()
|
||||
StorePass = as.Get("storepass").GetString()
|
||||
Root = as.Get("root").GetString()
|
||||
MyTinyTodo = as.Get("mtt").GetString()
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<title>todo breel</title>
|
||||
<link rel="stylesheet" type="text/css" href="/themes/default/style.css?v=1.4.3" media="all"/>
|
||||
<link rel="stylesheet" type="text/css" href="/themes/default/print.css?v=1.4.3" media="print"/>
|
||||
<link rel="stylesheet" type="text/css" href="/themes/default/pda.css?v=1.4.3" media="only screen and (max-device-width: 720px)"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -188,3 +188,77 @@ h3 {
|
||||
.mtt-notes-showhide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: maroon;
|
||||
}
|
||||
|
||||
.mtt-tab {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mtt-tabs-selected {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#taskview ,
|
||||
#bar ,
|
||||
br[clear="all"] ,
|
||||
#task_placeholder > span ,
|
||||
#mtt_body > h2:first-child {
|
||||
display: none !important;
|
||||
}
|
||||
#toolbar ,
|
||||
#taskcontainer {
|
||||
z-index: 15;
|
||||
}
|
||||
#taskcontainer {
|
||||
position: fixed;
|
||||
top: 6em;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
@media
|
||||
(min-resolution: 192dpi) and (min-device-width: 350px) {
|
||||
body {
|
||||
font-size: 320%;
|
||||
background-color: navy;
|
||||
overflow: hidden;
|
||||
}
|
||||
input[type="checkbox"] ,
|
||||
input[type="button"] ,
|
||||
.taskactionbtn ,
|
||||
input[type="submit"] {
|
||||
transform: scale(6.4);
|
||||
z-index: 999;
|
||||
}
|
||||
.taskactionbtn {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.form-row > input {
|
||||
transform: none;
|
||||
}
|
||||
.list-action ,
|
||||
.mtt-tabs-add-button > span ,
|
||||
.mtt-img-button ,
|
||||
.mtt-searchbox-icon ,
|
||||
.mtt-taskbox-icon {
|
||||
transform: scale(2.1);
|
||||
}
|
||||
#tabs_buttons ,
|
||||
#tabs_buttons > .mtt-tabs-select-button {
|
||||
transform: scale(2.5);
|
||||
}
|
||||
#taskcontainer {
|
||||
top: 3.7em;
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
margin-left: .7em;
|
||||
}
|
||||
.task-date {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
@@ -1366,3 +1368,8 @@ li.mtt-item-hidden {
|
||||
min-width: 350px;
|
||||
}
|
||||
body { filter: invert(80%); background-color: #222; }
|
||||
#newtask_adv ,
|
||||
#tagcloudbtn ,
|
||||
#settings {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
@@ -91,7 +96,7 @@ func (s *Server) phpProxy(w http.ResponseWriter, r *http.Request) {
|
||||
s.static(w, r)
|
||||
return
|
||||
}
|
||||
url, err := url.Parse(config.MyTinyTodo)
|
||||
url, err := url.Parse("http://127.0.0.1:64123")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
@@ -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