This commit is contained in:
biglyderv 2025-03-04 20:30:22 -05:00
parent 091fba6910
commit ade3870ab4
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
3 changed files with 23 additions and 24 deletions

View file

@ -7,28 +7,7 @@
Context
<% } %>
</h1>
<div>
<% for (let contentN of content) { %>
<% if (contentN[0] == 'file') { %>
<a class='link' href='<%= contentN[1] %>'>
<% if (['gif','png','jpg'].indexOf(contentN[2]) != -1) { %>
<img class='art' src='<%= contentN[1] %>'>
<% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %>
<%= contentN[1] %>
<% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %>
<video class='art' controls>
<source src='<%= contentN[1] %>'>
</video>
<% } %>
</a>
<% } else if (contentN[0] == 'link') { %>
<a class='link' href='<%= contentN[1] %>'><%= contentN[1] %></a>
<% } else if (contentN[0] == 'curl') { %>
<a class='link' href='<%= contentN[2] %>'><%= contentN[1] %></a>
<% } else if (contentN[0].replaceAll(' ','').length > 0) { %>
<span class='commentbox'><%= contentN[0] %></span>
<% } } %>
</div>
<div><%- include ('formatted.ejs', {content}) %></div>
<% if (!isNaN(date * 1)) { %>
<div class='sub'><b>Posted on</b> <%= new Date(date).toISOString() %> </div>
<% } %>

20
views/formatted.ejs Normal file
View file

@ -0,0 +1,20 @@
<% for (let contentN of content) { %>
<% if (contentN[0] == 'file') { %>
<a class='link' href='<%= contentN[1] %>'>
<% if (['gif','png','jpg'].indexOf(contentN[2]) != -1) { %>
<img class='art' src='<%= contentN[1] %>'>
<% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %>
<%= contentN[1] %>
<% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %>
<video class='art' controls>
<source src='<%= contentN[1] %>'>
</video>
<% } %>
</a>
<% } else if (contentN[0] == 'link') { %>
<a class='link' href='<%= contentN[1] %>'><%= contentN[1] %></a>
<% } else if (contentN[0] == 'curl') { %>
<a class='link' href='<%= contentN[2] %>'><%= contentN[1] %></a>
<% } else if (contentN[0].replaceAll(' ','').length > 0) { %>
<span class='commentbox'><%= contentN[0] %></span>
<% } } %>

View file

@ -3,12 +3,12 @@
<img src="/uploads/pfp_<%= username %>.png" class="avatar-img">
<span><%= username %></span>
</h1>
<div class='commentbox'><%= desc || "A very cool person!" %></div>
<div><%- include ('formatted.ejs', {content: desc || [['A very cool user!']]}) %></div>
<%- include ('vblock.ejs', {link: `/walls/get/users/${username}/0`, icon: '/icon.svg', name: 'Replies'}) %>
</div>
<% if (isYou) { %>
<%- include('form.ejs', {
<%- include('form.ejs', {
title: "Your Settings",
message: 'Configure your profile.',
action: "/api/file/you/settings",