anchors dont hit top of page

merge-requests/208/head
fatchan 5 years ago
parent 65db7a1495
commit 1ead7e26c3
  1. 14
      gulp/res/css/style.css
  2. 197
      views/mixins/post.pug
  3. 9
      views/pages/board.pug
  4. 5
      views/pages/catalog.pug
  5. 9
      views/pages/thread.pug

@ -414,16 +414,22 @@ input textarea {
.post-container, .ban { .post-container, .ban {
box-sizing: border-box; box-sizing: border-box;
margin: 2px 0;
padding: 5px; padding: 5px;
max-width: 100%; max-width: 100%;
margin-bottom: -10px;
} }
.post-container:target { .pad-anchor:target .post-container {
background-color: #d6bad0 !important; background-color: #d6bad0 !important;
border: 1px solid #ba9dbf !important; border: 1px solid #ba9dbf !important;
} }
.pad-anchor:before {
content: "";
display: block;
height: 15px;
}
.post-container.op { .post-container.op {
background: none; background: none;
border: none; border: none;
@ -609,6 +615,10 @@ hr {
width:100%; width:100%;
} }
.pad-anchor {
width: 100%;
}
.post-container { .post-container {
box-shadow: none; box-shadow: none;
width: 100%; width: 100%;

@ -1,103 +1,104 @@
mixin post(post, truncate, manage=false, globalmanage=false) mixin post(post, truncate, manage=false, globalmanage=false)
article(id=post.postId class='post-container '+(post.thread ? '' : 'op')) .pad-anchor(id=post.postId)
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`; article(class='post-container '+(post.thread ? '' : 'op'))
header.post-info - const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`;
if globalmanage header.post-info
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id) if globalmanage
else input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id)
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId) else
| input.post-check(type='checkbox', name='checkedposts[]' value=post.postId)
if !post.thread |
if post.sticky if !post.thread
img(src='/img/sticky.svg' height='12' title='Stickied') if post.sticky
img(src='/img/sticky.svg' height='12' title='Stickied')
|
if post.saged
img(src='/img/saged.svg' height='12' title='Permasaged')
|
if post.locked
img(src='/img/locked.svg' height='12' title='Locked')
|
if post.subject
span.post-subject #{post.subject}
| |
if post.saged if post.email
img(src='/img/saged.svg' height='12' title='Permasaged') a(href=`mailto:${post.email}`)
| span.post-name #{post.name}
if post.locked
img(src='/img/locked.svg' height='12' title='Locked')
|
if post.subject
span.post-subject #{post.subject}
|
if post.email
a(href=`mailto:${post.email}`)
span.post-name #{post.name}
else
span.post-name #{post.name}
|
if post.tripcode
span.post-tripcode #{post.tripcode}
|
if post.capcode
span.post-capcode #{post.capcode}
|
span #{post.date.toLocaleString()}
|
if post.userId
span.user-id(style=`background: #${post.userId}`) #{post.userId}
|
span: a(href=postURL) No.#{post.postId}
if !post.thread
|
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply]
.post-data
if post.files.length > 0
.post-files
each file in post.files
.post-file
span.post-file-info
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename}
br
span
| (#{file.sizeString}, #{file.geometryString}
if file.durationString
| , #{file.durationString}
| )
.post-file-src
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
img.file-thumb(src='/img/spoiler.png' width='128' height='128')
else if file.hasThumb
object.file-thumb(data=`/img/thumb-${file.filename.split('.')[0]}.jpg`)
img(src='/img/deleted.png')
else
object.file-thumb(data=`/img/${file.filename}`)
img(src='/img/deleted.png')
if post.message
if truncate
-
const splitPost = post.message.split('\n');
const messageLines = splitPost.length;
let truncatedMessage = post.message;
if (messageLines > 10) {
truncatedMessage = splitPost.slice(0, 10).join('\n');
} else if (post.message.length > 1000) {
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, '');
}
pre.post-message !{truncatedMessage}
if truncatedMessage !== post.message
blockquote Message too long. #[a(href=postURL) View the full text]
else else
pre.post-message !{post.message} span.post-name #{post.name}
if post.banmessage
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage})
if post.omittedposts || post.omittedimages
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread]
if post.backlinks && post.backlinks.length > 0
.replies Replies:
each backlink in post.backlinks
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) &gt;&gt;#{backlink}
|
if manage === true
each report in post.reports
.reports.post-container
span Date: #{report.date.toLocaleString()}
| |
span Reason: #{report.reason} if post.tripcode
if globalmanage === true span.post-tripcode #{post.tripcode}
each report in post.globalreports |
.reports.post-container if post.capcode
span Date: #{report.date.toLocaleString()} span.post-capcode #{post.capcode}
|
span #{post.date.toLocaleString()}
| |
span Reason: #{report.reason} if post.userId
span.user-id(style=`background: #${post.userId}`) #{post.userId}
|
span: a(href=postURL) No.#{post.postId}
if !post.thread
|
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply]
.post-data
if post.files.length > 0
.post-files
each file in post.files
.post-file
span.post-file-info
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename}
br
span
| (#{file.sizeString}, #{file.geometryString}
if file.durationString
| , #{file.durationString}
| )
.post-file-src
a(target='_blank' href=`/img/${file.filename}`)
if post.spoiler
img.file-thumb(src='/img/spoiler.png' width='128' height='128')
else if file.hasThumb
object.file-thumb(data=`/img/thumb-${file.filename.split('.')[0]}.jpg`)
img(src='/img/deleted.png')
else
object.file-thumb(data=`/img/${file.filename}`)
img(src='/img/deleted.png')
if post.message
if truncate
-
const splitPost = post.message.split('\n');
const messageLines = splitPost.length;
let truncatedMessage = post.message;
if (messageLines > 10) {
truncatedMessage = splitPost.slice(0, 10).join('\n');
} else if (post.message.length > 1000) {
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, '');
}
pre.post-message !{truncatedMessage}
if truncatedMessage !== post.message
blockquote Message too long. #[a(href=postURL) View the full text]
else
pre.post-message !{post.message}
if post.banmessage
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage})
if post.omittedposts || post.omittedimages
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread]
if post.backlinks && post.backlinks.length > 0
.replies Replies:
each backlink in post.backlinks
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) &gt;&gt;#{backlink}
|
if manage === true
each report in post.reports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}
if globalmanage === true
each report in post.globalreports
.reports.post-container
span Date: #{report.date.toLocaleString()}
|
span Reason: #{report.reason}

@ -10,10 +10,11 @@ block content
include ../includes/postform.pug include ../includes/postform.pug
br br
include ../includes/stickynav.pug include ../includes/stickynav.pug
nav.pages#top .pad-anchor#top
include ../includes/pages.pug nav.pages
a(href=`/${board._id}/catalog.html`) [Catalog] include ../includes/pages.pug
| a(href=`/${board._id}/catalog.html`) [Catalog]
|
hr(size=1) hr(size=1)
form(action='/forms/board/'+board._id+'/actions' method='POST' enctype='application/x-www-form-urlencoded') form(action='/forms/board/'+board._id+'/actions' method='POST' enctype='application/x-www-form-urlencoded')
if threads.length === 0 if threads.length === 0

@ -10,8 +10,9 @@ block content
include ../includes/postform.pug include ../includes/postform.pug
br br
include ../includes/stickynav.pug include ../includes/stickynav.pug
nav.pages#top .pad-anchor#top
a(href=`/${board._id}/index.html`) [Return] nav.pages
a(href=`/${board._id}/index.html`) [Return]
hr(size=1) hr(size=1)
if threads.length === 0 if threads.length === 0
p No posts. p No posts.

@ -21,10 +21,11 @@ block content
include ../includes/postform.pug include ../includes/postform.pug
br br
include ../includes/stickynav.pug include ../includes/stickynav.pug
nav.pages#top .pad-anchor#top
a(href=`/${board._id}/index.html`) [Return] nav.pages
| a(href=`/${board._id}/index.html`) [Return]
a(href=`/${board._id}/catalog.html`) [Catalog] |
a(href=`/${board._id}/catalog.html`) [Catalog]
hr(size=1) hr(size=1)
form(action=`/forms/board/${board._id}/actions` method='POST' enctype='application/x-www-form-urlencoded') form(action=`/forms/board/${board._id}/actions` method='POST' enctype='application/x-www-form-urlencoded')
section.thread section.thread

Loading…
Cancel
Save