diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-05-20 01:50:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 01:50:03 +0200 |
commit | 5115cf0e23e9abf2860161794a10e3a40055af4d (patch) | |
tree | 47c2a9f631c0ff4e47d8f34906705771164920b2 /g4f/gui/client/static/js | |
parent | Update DeepInfra.py (diff) | |
parent | Add some options to messages in gui, saves generated images local (diff) | |
download | gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.gz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.bz2 gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.lz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.xz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.zst gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.zip |
Diffstat (limited to 'g4f/gui/client/static/js')
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 24 |
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> |