noscript pager fixes

This commit is contained in:
Ryan Stafford 2023-07-11 13:49:29 -04:00
parent b9cf0c4835
commit dcc3cd4d49
4 changed files with 14 additions and 8 deletions

View file

@ -377,7 +377,7 @@ form.nsfw div {
top: 1px;
}
.pager {
margin: 10px;
margin: 20px 0px;
}
.pager a {
padding: 1px 4px;
@ -471,7 +471,7 @@ form.nsfw div {
.expando-button:hover{
background-color: #466599;
}
.expando-button.hidden, .children.hidden {
.expando-button.hidden, .children.hidden .comment {
display: none;
}
.hidechildren .show {

View file

@ -304,6 +304,9 @@ function setup() {
hidechildren.addEventListener("click", hideAllChildComments)
}
if (lmc = document.getElementById("lmc")){
if (pager = document.getElementsByClassName("pager")){
pager[0].style.display = "none";
}
lmc.addEventListener("click", loadMoreComments)
}
var posts = document.getElementsByClassName("post")

View file

@ -2,7 +2,7 @@
<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>
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
<link rel="stylesheet" href="/_/static/style.css?v=20">
<link rel="stylesheet" href="/_/static/style.css?v=21">
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body {{ if .Dark }}class="dark"{{end}}>
@ -56,6 +56,6 @@
{{ template "sidebar.html" . }}
</main>
{{ end }}
<script src="/_/static/utils.js?v=14"></script>
<script src="/_/static/utils.js?v=15"></script>
</body>
</html>

View file

@ -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>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
<link rel="stylesheet" href="/_/static/style.css?v=20">
<link rel="stylesheet" href="/_/static/style.css?v=21">
</head>
<body{{ if .Dark }} class="dark"{{end}}>
<noscript>
@ -12,6 +12,7 @@
.expando-button,
.minimize,
#showimages,
#lmc,
.hidechildren {
display: none !important;
}
@ -81,7 +82,7 @@
</div>
{{ else }}
<div class="commentmenu">
{{if .Comments}}{{if gt .Page 1}}next{{else if or (lt .CommentCount 200) (lt (index .Posts 0).Counts.Comments .CommentCount) }}all{{else}}top{{end}} {{.CommentCount}} comments{{else}} no comments (yet){{end}}
{{if .Comments}}{{if gt .Page 1}}(page {{ .Page }}) {{else if lt (index .Posts 0).Counts.Comments .CommentCount }}all{{else}}top{{end}} {{.CommentCount}} comments{{else}} no comments (yet){{end}}
<div>
sorted by:
<a {{ if eq .Sort "Hot"}}class="selected"{{end}} href="{{ .SortBy "Hot"}}">hot</a>
@ -123,14 +124,16 @@
<div class="error">there doesn't seem to be anything here</div>
{{ end }}
{{ if or .Query (eq .SearchType "Communities") (eq (len .Posts) 25) (and .User (or (gt .User.PersonView.Counts.CommentCount 10) (gt .User.PersonView.Counts.PostCount 10))) }}
{{ if or .Query (eq .SearchType "Communities") (eq (len .Posts) 25) (and .Comments (gt (index .Posts 0).Counts.Comments .CommentCount) (not .CommentID)) (and .User (or (gt .User.PersonView.Counts.CommentCount 10) (gt .User.PersonView.Counts.PostCount 10))) }}
<div class="pager">
view more: {{if gt .Page 1 }}<a href="{{ .PrevPage }}"> prev</a>{{ end }} <a href="{{ .NextPage }}">next </a>
</div>
{{ if not .PostID }}
<input id="loadmore" type="submit" value="load more" data-page="2">
{{ end }}
{{ end }}
<script src="/_/static/utils.js?v=14"></script>
<script src="/_/static/utils.js?v=15"></script>
{{ template "sidebar.html" . }}
</main>
{{ end }}