embedding fixes and cleanup

This commit is contained in:
biglyderv 2025-05-26 23:37:14 -04:00
parent 9732d9aef0
commit fe9e3ce840
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
3 changed files with 40 additions and 39 deletions

View file

@ -1,30 +1,28 @@
<% 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 (['!neoboxels'].indexOf(contentN[2]) != -1) { %>
<% if (contentN.type == 'file') { %>
<a class='link' href='<%= contentN.path %>'>
<% if (['gif','png','jpg'].indexOf(contentN.ext) != -1) { %>
<img class='art' src='<%= contentN.path %>'>
<% } else if (contentN.ext == '!neoboxels') { %>
</a>
<a class='link' href='https://sand.dervland.net/?embed=https://com.dervland.net<%= contentN[1] %>'>
https://sand.dervland.net/?embed=https://com.dervland.net<%= contentN[1] %>
<a class='link' href='https://sand.dervland.net/?embed=https://com.dervland.net<%= contentN.path %>'>
https://sand.dervland.net/?embed=https://com.dervland.net<%= contentN.path %>
</a>
<iframe src="https://sand.dervland.net/?only=true&embed=https://com.dervland.net<%= contentN[1] %>"></iframe>
<iframe width="<%= contentN.width %>" height="<%= contentN.height %>" src="https://sand.dervland.net/?only=true&embed=https://com.dervland.net<%= contentN.path %>"></iframe>
<a>
<% } else if (['txt','json'].indexOf(contentN[2]) != -1) { %>
<%= contentN[1] %>
<% } else if (['txt','json'].indexOf(contentN.ext) != -1) { %>
<%= contentN.href %>
</a>
<textarea class="form-input big-text"> <%= contentN[3] %> </textarea>
<textarea class="form-input big-text"> <%= contentN.content %> </textarea>
<a>
<% } else if (['mp4','mp3','webm','wav'].indexOf(contentN[2]) != -1) { %>
<% } else if (['mp4','mp3','webm','wav'].indexOf(contentN.ext) != -1) { %>
<video class='art' controls>
<source src='<%= contentN[1] %>'>
<source src='<%= contentN.ext %>'>
</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>
<% } else if (contentN.type == 'link') { %>
<a class='link' href='<%= contentN.href %>'><%= contentN.name %></a>
<% } else if (contentN.type.replaceAll(' ','').length > 0) { %>
<span class='commentbox'><%= contentN.data %></span>
<% } } %>