Use Custom Chat Button

Status
Not open for further replies.

AndyThe327st

SOHO User
Joined
Mar 13, 2023
Messages
21
Reaction score
0
Hi,

Is it possible to use a custom button instead of the existing ones?

Reason is, we already have a button on our web site that we would like to use. It should then, when clicked upon open the chat window floating around, while leaving the button in its original location. Similar to a popup but not a popup.

Don't know if that is possible.

What I did for now, to make this possible, I had to resort to a popup window. My existing button now links to a HTML page (using javascript to open it as popup without menu, correct size, ...). Inside of that HTML page I have the chat HTML code embedded using static parameters.

Finally I copied the JavaScript the chat uses (the last line) to our own server and added this to the style of the button to hide it: visibility:hidden;max-height:0;

A bit hacky, but working. ;) Saw this as being asked multiple times. But without any guarantees. If the script could have the ability to hide the button entirely would be cool too. However, it would still be a popup.

Andy
 
Last edited:
I did some research and a floating window is possible. Found this nice example which additionally blurs the background of the main window: https://www.encodedna.com/javascript/practice-ground/default.htm?pg=floating_centered_div_using_css

Would be cool if this would be possible with a static button, then showing the chat while (optionally) blurring the background window.

Then there would be no more popup at all and no more pop-up browser warnings.

So if the following two button styles could be added, more integration types would be possible:
1) No button at all (hiding the button entirely or like I did set visibility and height to prevent showing it), enforcing the chat startup type to box (to prevent showing the hidden button only and no chat). Then one can use a classic popup.
2) Custom button with custom dimensions that opens the chat as floating (maybe even with background blur). Then one can use a more modern floating chat without popup.

We are happy for now as we had a popup before so it is not worse than how it was before. If there was an option, we would not have to patch the callus.js file. We currently made a static version on our server, but would then have to update it ourselves if it changes. Changing it on the 3CX server would be possible as well, but I guess updates will overwrite it eventually.

Andy
 
The class name for the chat button is "minimized-button_EkBzy"

To find the location in the JS file you can search for "minimized-button_EkBzy" and then change the styles from "{box-shadow:0" to "{visibility:hidden;max-height:0;box-shadow:0" to let it disappear.

Just for the sake of completeness if someone wants to try it.

Andy
 
Status
Not open for further replies.

Forum statistics

Threads
112,148
Messages
590,963
Members
165,168
Latest member
Stephan Eusebe