fix stuff :3

This commit is contained in:
ashley 2024-08-04 20:34:11 +00:00
parent 653de060c5
commit 8da7fd6030

View file

@ -624,6 +624,17 @@ const upsellMessages = [
const showUpsell = !answer && Math.random() < 0.2; const showUpsell = !answer && Math.random() < 0.2;
const randomUpsellMessage = showUpsell ? upsellMessages[Math.floor(Math.random() * upsellMessages.length)] : ''; const randomUpsellMessage = showUpsell ? upsellMessages[Math.floor(Math.random() * upsellMessages.length)] : '';
function extractQueryFromUpsellMessage(message) {
return message.replace("[new] Try searching '", "")
.replace("[new] Try '", "")
.replace("[new] Ask '", "")
.replace("[new] Try ", "")
.replace("'", "")
.replace("?", "")
.trim();
}
%> %>
%> %>
<% if (answer) { %> <% if (answer) { %>
@ -636,10 +647,24 @@ const randomUpsellMessage = showUpsell ? upsellMessages[Math.floor(Math.random()
</span> </span>
</div> </div>
<% } else if (showUpsell) { %> <% } else if (showUpsell) { %>
<a href="/search?query=<%= encodeURIComponent(randomUpsellMessage.replace('[new] ', '')) %>" style="font-size: 1.5em; margin-bottom: 3em; text-align: left !important; margin-right: 7em; color: #007bff; text-decoration: none;"> <style>
.advertisements-upsell-instant-awnsers {
font-size: 22px;
margin-bottom: 3em;
text-decoration: none;
color: #fff;
margin-left: 11.4em;
font-family: "poketube flex";
font-weight: 1000;
font-stretch: extra-expanded;
}
</style>
<a href="/search?query=<%= encodeURIComponent(extractQueryFromUpsellMessage(randomUpsellMessage)) %>" class="advertisements-upsell-instant-awnsers">
<%= randomUpsellMessage %> <%= randomUpsellMessage %>
</a> </a>
<% } %> <% } %>
<!-- self harm -->
<% <%
const searchStrings = [ const searchStrings = [
"suicide", "self harm", "self-harm", "support", "murder", "how to murder", "kill myself", "suicide", "self harm", "self-harm", "support", "murder", "how to murder", "kill myself",