summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/gui/client/static/js')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index 47bfdd3b..9790b261 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -192,6 +192,26 @@ const register_message_buttons = async () => {
})
}
});
+ document.querySelectorAll(".message .fa-whatsapp").forEach(async (el) => {
+ if (!el.parentElement.href) {
+ const text = el.parentElement.parentElement.parentElement.innerText;
+ el.parentElement.href = `https://wa.me/?text=${encodeURIComponent(text)}`;
+ }
+ });
+ document.querySelectorAll(".message .fa-print").forEach(async (el) => {
+ if (!("click" in el.dataset)) {
+ el.dataset.click = "true";
+ el.addEventListener("click", async () => {
+ const message_el = el.parentElement.parentElement.parentElement;
+ el.classList.add("clicked");
+ message_box.scrollTop = 0;
+ message_el.classList.add("print");
+ setTimeout(() => el.classList.remove("clicked"), 1000);
+ setTimeout(() => message_el.classList.remove("print"), 1000);
+ window.print()
+ })
+ }
+ });
}
const delete_conversations = async () => {
@@ -253,6 +273,8 @@ const handle_ask = async () => {
${count_words_and_tokens(message, get_selected_model())}
<i class="fa-solid fa-volume-high"></i>
<i class="fa-regular fa-clipboard"></i>
+ <a><i class="fa-brands fa-whatsapp"></i></a>
+ <i class="fa-solid fa-print"></i>
</div>
</div>
</div>
@@ -625,6 +647,8 @@ const load_conversation = async (conversation_id, scroll=true) => {
${count_words_and_tokens(item.content, next_provider?.model)}
<i class="fa-solid fa-volume-high"></i>
<i class="fa-regular fa-clipboard"></i>
+ <a><i class="fa-brands fa-whatsapp"></i></a>
+ <i class="fa-solid fa-print"></i>
</div>
</div>
</div>