mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-24 18:38:40 +01:00
test a
This commit is contained in:
parent
1df1b8af2d
commit
4a821d700d
1 changed files with 75 additions and 29 deletions
104
html/search.ejs
104
html/search.ejs
|
@ -993,42 +993,88 @@ font-weight: 1000;">dont.</h1></a>
|
|||
</p>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<% invresults?.forEach (x => { %>
|
||||
<div class="video-list">
|
||||
<div class="video">
|
||||
<a href="/watch?v=<%= x.videoId %>"
|
||||
class="thumbnail"
|
||||
style="background-image: url('<%- media_proxy_url %>/proxy?url=https://i.ytimg.com/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBmAOZV7CM3NdDKlEFxGX7PpI5UWQ');border-radius: 10px;">
|
||||
<span class="hover-text">Watch :3</span>
|
||||
<span class="video-length"><%= turntomins(x.lengthSeconds) %></span>
|
||||
</a>
|
||||
<div class="info" style="color:#fff;text-align: left;font-weight: 1000;">
|
||||
<a style="font-family: 'PokeTube Flex';font-size: large;text-align: left;font-stretch: extra-expanded;
|
||||
font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2"><%= x.title %></a>
|
||||
<div style="display: flex; flex-direction: column; row-gap: 8px;font-weight:bold">
|
||||
<a href="/watch?v=<%= x.videoId %>"><span><%= x.viewCountText %></span> <span>•</span> <span><%= x.publishedText %></span></a>
|
||||
<a href="/channel?id=<%= x.authorId %>"><%= x.author %><% if (x?.authorVerified) { %>
|
||||
<i class="icon ion ion-md-checkmark-circle" title="verified channel"></i><% } %></a>
|
||||
<div style="display: inline-flex;flex-direction: row;min-width: 6em;gap: 4px;">
|
||||
<a href="/download?v=<%= x.videoId %>" style="background: #333;width: 7.6em;border-radius: 18px;">
|
||||
<div style="display: flex;">
|
||||
<i class="fa-light fa-download" style="display: flex;font-size: 16px;padding: 5px;border-radius: 18px;margin-left: 2px;"></i><span style="margin-top: 6px;">Download</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://youtube.com/watch?v=<%= x.videoId %>" style="background: #333;width: 7.6em;border-radius: 18px;height: 2em;width: 12.5em;">
|
||||
<div style="display: flex;">
|
||||
<i class="fa-brands fa-youtube" style="display: flex;font-size: 16px;padding: 5px;border-radius: 18px;margin-left: 2px;"></i><span style="margin-top: 6px;">Open on YouTube :/</span>
|
||||
<%
|
||||
const searchStrings = [
|
||||
"\\bsuicide\\b", "\\bself harm\\b", "\\bself-harm\\b", "\\bsupport\\b", "\\bmurder\\b",
|
||||
"\\bhow to murder\\b", "\\bkill myself\\b", "\\bend my life\\b", "\\bdepressed\\b",
|
||||
"\\bdepression\\b", "\\blonely\\b", "\\bhurt myself\\b", "\\bselfharm\\b", "\\bdying\\b",
|
||||
"\\bwant to die\\b", "\\bkill\\b", "\\bdie\\b", "\\bfamily problems\\b", "\\bfamily issues\\b",
|
||||
"\\babuse\\b", "\\bdomestic violence\\b", "\\babusive parents\\b", "\\bfamily conflict\\b",
|
||||
"\\bestranged\\b", "\\bdisowned\\b", "\\brun away\\b", "\\brunaway\\b", "\\b.full stop punctuation.\\b"
|
||||
];
|
||||
|
||||
|
||||
const isFlagged = searchStrings.some(str => new RegExp(str, 'i').test(q));
|
||||
|
||||
if (isFlagged) {
|
||||
invresults?.forEach(x => {
|
||||
%>
|
||||
<details>
|
||||
<summary style="color:#fff;">Might include self-harm</summary>
|
||||
<div class="video-list">
|
||||
<div class="video">
|
||||
<a href="/watch?v=<%= x.videoId %>"
|
||||
class="thumbnail"
|
||||
style="background-image: url('<%- media_proxy_url %>/proxy?url=https://i.ytimg.com/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBmAOZV7CM3NdDKlEFxGX7PpI5UWQ');border-radius: 10px;">
|
||||
<span class="hover-text">Watch :3</span>
|
||||
<span class="video-length"><%= turntomins(x.lengthSeconds) %></span>
|
||||
</a>
|
||||
<div class="info" style="color:#fff;text-align: left;font-weight: 1000;">
|
||||
<a style="font-family: 'PokeTube Flex';font-size: large;text-align: left;font-stretch: extra-expanded; font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2"><%= x.title %></a>
|
||||
<div style="display: flex; flex-direction: column; row-gap: 8px; font-weight:bold">
|
||||
<a href="/watch?v=<%= x.videoId %>"><span><%= x.viewCountText %></span> <span>•</span> <span><%= x.publishedText %></span></a>
|
||||
<a href="/channel?id=<%= x.authorId %>"><%= x.author %>
|
||||
<% if (x?.authorVerified) { %>
|
||||
<i class="icon ion ion-md-checkmark-circle" title="verified channel"></i>
|
||||
<% } %>
|
||||
</a>
|
||||
<div style="display: inline-flex;flex-direction: row;min-width: 6em;gap: 4px;">
|
||||
<a href="/download?v=<%= x.videoId %>" style="background: #333;width: 7.6em;border-radius: 18px;">
|
||||
<div style="display: flex;">
|
||||
<i class="fa-light fa-download" style="font-size: 16px;padding: 5px;margin-left: 2px;"></i><span style="margin-top: 6px;">Download</span>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://youtube.com/watch?v=<%= x.videoId %>" style="background: #333;width: 7.6em;border-radius: 18px;height: 2em;width: 12.5em;">
|
||||
<div style="display: flex;">
|
||||
<i class="fa-brands fa-youtube" style="font-size: 16px;padding: 5px;margin-left: 2px;"></i><span style="margin-top: 6px;">Open on YouTube :/</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
<%
|
||||
});
|
||||
} else {
|
||||
%>
|
||||
<% invresults?.forEach(x => { %>
|
||||
<div class="video-list">
|
||||
<div class="video">
|
||||
<a href="/watch?v=<%= x.videoId %>"
|
||||
class="thumbnail"
|
||||
style="background-image: url('<%- media_proxy_url %>/proxy?url=https://i.ytimg.com/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBmAOZV7CM3NdDKlEFxGX7PpI5UWQ');border-radius: 10px;">
|
||||
<span class="hover-text">Watch :3</span>
|
||||
<span class="video-length"><%= turntomins(x.lengthSeconds) %></span>
|
||||
</a>
|
||||
<div class="info" style="color:#fff;text-align: left;font-weight: 1000;">
|
||||
<a style="font-family: 'PokeTube Flex';font-size: large;text-align: left;font-stretch: extra-expanded; font-weight: 1000;" href="/watch?v=<%= x.videoId %>" class="title max-lines-2"><%= x.title %></a>
|
||||
<div style="display: flex; flex-direction: column; row-gap: 8px; font-weight:bold">
|
||||
<a href="/watch?v=<%= x.videoId %>"><span><%= x.viewCountText %></span> <span>•</span> <span><%= x.publishedText %></span></a>
|
||||
<a href="/channel?id=<%= x.authorId %>"><%= x.author %>
|
||||
<% if (x?.authorVerified) { %>
|
||||
<i class="icon ion ion-md-checkmark-circle" title="verified channel"></i>
|
||||
<% } %>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<audio id="audio" style="display:none;" loop autoplay></audio>
|
||||
|
|
Loading…
Reference in a new issue