This commit is contained in:
ashley 2025-04-22 23:48:28 +00:00
parent 3f66e88dae
commit ce5428eccb

View File

@ -975,9 +975,12 @@ function extractQueryFromUpsellMessage(message) {
style="
display: block;
font-size: 7em;
white-space: pre-wrap;
word-break: break-word;
margin-bottom: 1em;
"
><%= answer %></span>
<div style="display: flex; gap: 1em;">
<button
id="copy-btn"
style="
@ -990,28 +993,70 @@ function extractQueryFromUpsellMessage(message) {
border-radius: 0.25em;
"
>Copy</button>
<button
id="ask-btn"
style="font-size:1em;padding:0.5em 1em;"
>Ask ChatGPT</button>
</div>
</div>
<noscript>
<style>
#copy-btn,
#ask-btn {
display: none !important;
}
</style>
</noscript>
<style>
#ask-btn {
background: linear-gradient(45deg, #6a11cb, #2575fc);
color: #fff;
border: none;
border-radius: 0.5em;
padding: 0.6em 1.2em;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
transition: transform 0.1s ease, box-shadow 0.2s ease;
}
#ask-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
#ask-btn:active {
transform: translateY(0);
box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
</style>
<script>
;(function() {
const btn = document.getElementById('copy-btn');
const copyBtn = document.getElementById('copy-btn');
const askBtn = document.getElementById('ask-btn');
const textEl = document.getElementById('answer-text');
btn.addEventListener('click', () => {
copyBtn.addEventListener('click', () => {
const text = textEl.innerText || textEl.textContent;
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Copied!';
setTimeout(() => { btn.textContent = 'Copy'; }, 1500);
copyBtn.textContent = 'Copied!';
setTimeout(() => { copyBtn.textContent = 'Copy'; }, 1500);
});
});
askBtn.addEventListener('click', () => {
const userQuery = prompt('What would you like to ask ChatGPT?');
if (userQuery) {
window.location.href = `/chat?query=${encodeURIComponent(userQuery)}`;
}
});
})();
</script>
<% } else if (showUpsell) { %>
<% } %>
<!-- self harm -->
<%
const searchStrings = [