Better scroll and better category page

This commit is contained in:
Akif9748 2022-09-16 23:38:06 +03:00
parent daa5c36281
commit 7ecf0a51de
7 changed files with 7 additions and 10 deletions

View File

@ -39,13 +39,14 @@ Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn
| Better Auth | ⚪ | MEDIUM |
- mod role, permissions
- Fix footer, theme, category pages
- Fix footer's location.
- upload other photos, model for it
- category system bloat.
- preview for send messages in markdown format.
- Limits for thread title, message content, username, user about
- desp => description
- threads title and desp black theme, center
- scroll
## Major Version History
- V4: Caching
- V3: New Theme

View File

@ -9,7 +9,7 @@ app.get("/:id", async (req, res) => {
if (!message || (message.deleted && !req.user?.admin)) return res.error( 404,
`We don't have any message with id ${req.params.id}.`);
res.redirect(`/threads/${message.threadID}?scroll=${message.id}`);
res.redirect(`/threads/${message.threadID}#message-${message.id}`);
});

View File

@ -31,7 +31,7 @@ app.get("/:id/", async (req, res) => {
const messages = await Promise.all(await MessageModel.find(query).sort({ time: 1 }).limit(10).skip(page * 10)
.then(messages => messages.map(message => message.get_author())));
res.reply("thread", { page, thread, messages, scroll: req.query.scroll || messages[0]?.id });
res.reply("thread", { page, thread, messages });
thread.save();

View File

@ -31,6 +31,7 @@
<a class="btn-primary" onclick="ban();">IP BAN</a>
<a class="btn-outline-primary" onclick="unban();">REMOVE IP BAN</a>
<a href="/categories/create" class="btn-primary">Create Category</a>
<h2 style="color: var(--second);">Banned users:</h2>

View File

@ -10,9 +10,6 @@
<%- include("extra/navbar") %>
<div class="threads">
<%if(user?.admin) {%>
<a href="/categories/create" class="btn-primary">Create Category</a>
<% }; %>
<% categories.forEach(category=>{ %>
<a href="<%= category.getLink() %>" >
<div class="threads-box">

View File

@ -20,10 +20,9 @@
<a href="https://github.com/Akif9748/akf-forum" style="color: white;"> This website is powered by
<span style="color: #ffbf00;">akf-forum</span> </a>
<div>
<span style="color:white">Coders</span> <br>
<div style="text-align:center;">
By <a href="https://github.com/Akif9748/" style="color: #ffbf00;">Akif</a> <br> By <a href="#" style="color:#ffbf00;">Tokmak</a>
<a href="https://github.com/Akif9748/" style="color: #ffbf00;">Akif</a><br><a href="#" style="color:#ffbf00;">Tokmak</a>
</div>
</div>
</div>

View File

@ -98,7 +98,6 @@
const content = message.querySelector(".content");
content.innerHTML = converter.makeHtml(content.rawText = content.innerHTML);
}
document.getElementById("message-<%= scroll %>").scrollIntoView();
function dots(id) {
document.getElementById('message-' + id).querySelector(".dots-menu").classList.toggle('active')