Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions chatbees_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h2>Hello ChatBees</h2>
<div class="chatbees-popup" id="chatbeesPopup">
<div class="chatbees-header bg-black p-2.5">
<div class="chatbees-left-section">
<img src="chatbees_logo_favicon_white.svg" alt="Chat Logo" class="chatbees-logo mr-2">
<a href="https://www.chatbees.ai/pricing" target="_blank" style="color: white;"><strong>ChatBees</strong></a>
<img src="chatbees_logo_favicon_white.svg" alt="Chat Logo" class="chatbees-logo mr-2" id="chatbees-logo-img">
<a href="https://www.chatbees.ai/pricing" target="_blank" style="color: white;" id="chatbees-brand-name">ChatBees</a>
</div>
<div class="chatbees-right-section">
<button id="chatbeesClearBtn" aria-label="Clear ChatBees Chat Message" class="w-8 h-8">
Expand Down Expand Up @@ -98,6 +98,9 @@ <h2>Hello ChatBees</h2>
<input type="hidden" id="chatbeesAccountID" value="public">
<input type="hidden" id="chatbeesNamespaceName" value="public">
<input type="hidden" id="chatbeesCollectionName" value="collectionName">
<input type="hidden" id="chatbeesLogoUrl" value="https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/372_Weebly_logo-128.png">
<input type="hidden" id="chatbeesBrandName" value="Weebly">
<input type="hidden" id="chatbeesThinkingHint" value="Weebly is working">
<button
id="chatbeesSendMessageBtn"
class="flex h-16 w-16 items-center justify-center rounded-md bg-primary text-white hover:text-gray-900 bg-black"
Expand Down
17 changes: 14 additions & 3 deletions chatbees_script.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
(function () {
(function() {
const getElementById = (id) => document.getElementById(id);

const [aid, namespaceName, collectionName] = [
const [aid, namespaceName, collectionName, logoUrl, brandName, thinkingHint = "Bees are thinking..."] = [
"chatbeesAccountID",
"chatbeesNamespaceName",
"chatbeesCollectionName",
"chatbeesLogoUrl",
"chatbeesBrandName",
"chatbeesThinkingHint"
]
.map(getElementById)
.map((element) => element?.value?.trim());
Expand All @@ -17,6 +20,14 @@
return;
}

if (logoUrl) {
getElementById("chatbees-logo-img").src = logoUrl;
}

if (brandName) {
getElementById("chatbees-brand-name").text = brandName;
}

const [
chatButtonElement,
chatPopupElement,
Expand Down Expand Up @@ -290,7 +301,7 @@

const thinkMsg = document.createElement("div");
thinkMsg.classList.add("chatbees-message", "chatbees-bot");
thinkMsg.innerHTML = `<span class="inline-flex items-center">${spinner}<span class="ml-2">Bees are thinking...</span></span>`;
thinkMsg.innerHTML = `<span class="inline-flex items-center">${spinner}<span class="ml-2">${thinkingHint}</span></span>`;
chatAreaElement.appendChild(thinkMsg);
chatAreaElement.scrollTop = chatAreaElement.scrollHeight;

Expand Down
4 changes: 4 additions & 0 deletions chatbees_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
width: 40px; /* Adjust the width as needed */
height: 40px; /* Adjust the height as needed */
}

#chatbees-brand-name {
font-weight: bold;
}
.chatbees-right-section {
display: flex;
align-items: center;
Expand Down