mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-09 08:32:21 +00:00
add missing handlers. fixes #31
This commit is contained in:
parent
7ca1e23acf
commit
919a114f99
|
@ -74,6 +74,7 @@ summary {
|
||||||
color: #646464;
|
color: #646464;
|
||||||
}
|
}
|
||||||
.comment .score {
|
.comment .score {
|
||||||
|
clear:left;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
|
@ -82,6 +83,9 @@ summary {
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
max-width: 840px;
|
max-width: 840px;
|
||||||
}
|
}
|
||||||
|
.comment.hidden {
|
||||||
|
padding-bottom:5px;
|
||||||
|
}
|
||||||
.comment.hidden .score {
|
.comment.hidden .score {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
@ -266,9 +270,6 @@ form.savecomment {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
.comment.hidden {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.comment.hidden .meta a {
|
.comment.hidden .meta a {
|
||||||
color: gray;
|
color: gray;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -283,6 +284,7 @@ form.savecomment {
|
||||||
.children .morecomments {
|
.children .morecomments {
|
||||||
}
|
}
|
||||||
.morecomments {
|
.morecomments {
|
||||||
|
clear: left;
|
||||||
margin: 0px 0px 10px 0px;
|
margin: 0px 0px 10px 0px;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ function commentClick(e) {
|
||||||
request(targ.target || "", params,
|
request(targ.target || "", params,
|
||||||
function(res){
|
function(res){
|
||||||
targ.outerHTML = res
|
targ.outerHTML = res
|
||||||
|
setup()
|
||||||
},
|
},
|
||||||
function(res){
|
function(res){
|
||||||
e.target.disabled = ""
|
e.target.disabled = ""
|
||||||
|
@ -99,6 +100,7 @@ function commentClick(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
request(e.target.href+"&xhr",false, function(res){
|
request(e.target.href+"&xhr",false, function(res){
|
||||||
targ.outerHTML = res
|
targ.outerHTML = res
|
||||||
|
setup()
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -172,6 +174,7 @@ function formSubmit(e) {
|
||||||
request(targ.target, params,
|
request(targ.target, params,
|
||||||
function(res){
|
function(res){
|
||||||
targ.outerHTML = res
|
targ.outerHTML = res
|
||||||
|
setup()
|
||||||
},
|
},
|
||||||
function(res){
|
function(res){
|
||||||
e.submitter.disabled = ""
|
e.submitter.disabled = ""
|
||||||
|
|
|
@ -643,10 +643,14 @@ func SignUpOrLogin(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
|
||||||
q.Add("alert", alert)
|
q.Add("alert", alert)
|
||||||
r.URL.RawQuery = q.Encode()
|
r.URL.RawQuery = q.Encode()
|
||||||
http.Redirect(w, r, r.URL.String(), 301)
|
http.Redirect(w, r, r.URL.String(), 301)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if token != "" {
|
if token != "" {
|
||||||
state.GetUser(username)
|
state.GetUser(username)
|
||||||
|
if state.User == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
setCookie(w, state.Host, "jwt", token)
|
setCookie(w, state.Host, "jwt", token)
|
||||||
userid := strconv.Itoa(state.User.PersonView.Person.ID)
|
userid := strconv.Itoa(state.User.PersonView.Person.ID)
|
||||||
setCookie(w, state.Host, "user", state.User.PersonView.Person.Name+":"+userid)
|
setCookie(w, state.Host, "user", state.User.PersonView.Person.Name+":"+userid)
|
||||||
|
@ -663,7 +667,7 @@ func GetLogin(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
state.GetSite()
|
state.GetSite()
|
||||||
if state.Site.SiteView.LocalSite.CaptchaEnabled {
|
if state.Site != nil && state.Site.SiteView.LocalSite.CaptchaEnabled {
|
||||||
state.GetCaptcha()
|
state.GetCaptcha()
|
||||||
}
|
}
|
||||||
m, _ := url.ParseQuery(r.URL.RawQuery)
|
m, _ := url.ParseQuery(r.URL.RawQuery)
|
||||||
|
|
3
state.go
3
state.go
|
@ -219,7 +219,8 @@ func (state *State) GetSite() {
|
||||||
resp, err := state.Client.Site(context.Background(), types.GetSite{})
|
resp, err := state.Client.Site(context.Background(), types.GetSite{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
state.Status = http.StatusInternalServerError
|
state.Status = http.StatusInternalServerError
|
||||||
state.Host = ""
|
state.Host = "."
|
||||||
|
state.Error = errors.New("site unreachable")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
state.Client.Token = token
|
state.Client.Token = token
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<head>
|
<head>
|
||||||
<title>{{ if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ host .Host }}{{end}}</title>
|
<title>{{ if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ host .Host }}{{end}}</title>
|
||||||
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
|
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
|
||||||
<link rel="stylesheet" href="/_/static/style.css?v=17">
|
<link rel="stylesheet" href="/_/static/style.css?v=18">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
</head>
|
</head>
|
||||||
<body {{ if .Dark }}class="dark"{{end}}>
|
<body {{ if .Dark }}class="dark"{{end}}>
|
||||||
|
@ -56,6 +56,6 @@
|
||||||
{{ template "sidebar.html" . }}
|
{{ template "sidebar.html" . }}
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script src="/_/static/utils.js?v=12"></script>
|
<script src="/_/static/utils.js?v=13"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<title>{{if and .Posts .PostID }}{{ (index .Posts 0).Post.Name}} : {{.CommunityName}}{{else if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ host .Host }}{{end}}</title>
|
<title>{{if and .Posts .PostID }}{{ (index .Posts 0).Post.Name}} : {{.CommunityName}}{{else if and .Community (ne .Community.CommunityView.Community.Title "")}}{{.Community.CommunityView.Community.Title}}{{else if ne .CommunityName ""}}/c/{{.CommunityName}}{{ else if .User}}overview for {{.User.PersonView.Person.Name}}{{else}}{{ host .Host }}{{end}}</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
|
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
|
||||||
<link rel="stylesheet" href="/_/static/style.css?v=17">
|
<link rel="stylesheet" href="/_/static/style.css?v=18">
|
||||||
</head>
|
</head>
|
||||||
<body{{ if .Dark }} class="dark"{{end}}>
|
<body{{ if .Dark }} class="dark"{{end}}>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
<input id="loadmore" type="submit" value="load more" data-page="2">
|
<input id="loadmore" type="submit" value="load more" data-page="2">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<script src="/_/static/utils.js?v=12"></script>
|
<script src="/_/static/utils.js?v=13"></script>
|
||||||
{{ template "sidebar.html" . }}
|
{{ template "sidebar.html" . }}
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue