From ade3870ab4ad56774ac7e81e00bfc70a9e3c000c Mon Sep 17 00:00:00 2001 From: biglyderv Date: Tue, 4 Mar 2025 20:30:22 -0500 Subject: [PATCH] fail --- views/comment.ejs | 23 +---------------------- views/formatted.ejs | 20 ++++++++++++++++++++ views/user.ejs | 4 ++-- 3 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 views/formatted.ejs diff --git a/views/comment.ejs b/views/comment.ejs index a5ecbbf..5115454 100644 --- a/views/comment.ejs +++ b/views/comment.ejs @@ -7,28 +7,7 @@ Context <% } %> -
- <% for (let contentN of content) { %> - <% if (contentN[0] == 'file') { %> - - <% if (['gif','png','jpg'].indexOf(contentN[2]) != -1) { %> - - <% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %> - <%= contentN[1] %> - <% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %> - - <% } %> - - <% } else if (contentN[0] == 'link') { %> - <%= contentN[1] %> - <% } else if (contentN[0] == 'curl') { %> - <%= contentN[1] %> - <% } else if (contentN[0].replaceAll(' ','').length > 0) { %> - <%= contentN[0] %> - <% } } %> -
+
<%- include ('formatted.ejs', {content}) %>
<% if (!isNaN(date * 1)) { %>
Posted on <%= new Date(date).toISOString() %>
<% } %> diff --git a/views/formatted.ejs b/views/formatted.ejs new file mode 100644 index 0000000..ada9ec3 --- /dev/null +++ b/views/formatted.ejs @@ -0,0 +1,20 @@ +<% for (let contentN of content) { %> +<% if (contentN[0] == 'file') { %> + + <% if (['gif','png','jpg'].indexOf(contentN[2]) != -1) { %> + + <% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %> + <%= contentN[1] %> + <% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %> + + <% } %> + +<% } else if (contentN[0] == 'link') { %> +<%= contentN[1] %> +<% } else if (contentN[0] == 'curl') { %> +<%= contentN[1] %> +<% } else if (contentN[0].replaceAll(' ','').length > 0) { %> +<%= contentN[0] %> +<% } } %> \ No newline at end of file diff --git a/views/user.ejs b/views/user.ejs index 25f6671..aad92ee 100644 --- a/views/user.ejs +++ b/views/user.ejs @@ -3,12 +3,12 @@ <%= username %> -
<%= desc || "A very cool person!" %>
+
<%- include ('formatted.ejs', {content: desc || [['A very cool user!']]}) %>
<%- include ('vblock.ejs', {link: `/walls/get/users/${username}/0`, icon: '/icon.svg', name: 'Replies'}) %> <% if (isYou) { %> - <%- include('form.ejs', { +<%- include('form.ejs', { title: "Your Settings", message: 'Configure your profile.', action: "/api/file/you/settings",