General > Support
Persistent Chat Windows w/o Need to Click Button
faf:
--- Quote from: stryker1 on October 14, 2018, 01:50:39 PM ---Changing the default .gif image to look like the blue Mibew chat buttom, place this gif also in the bottom-right corner and set "visibility: hidden" of the class "mibew-chat-frame-toggle" could be an option.
--- End quote ---
Read this to find out how to theme the chat button in a right way: https://docs.mibew.org/theming.html#-a-name-chat-button-a-theming-chat-button
--- Quote from: stryker1 on October 14, 2018, 01:50:39 PM ---BUT: If the visitor already started the chat and hides it, a new click on the gif does not open the chatwindow.
--- End quote ---
If the visitor already started the chat and hides it there should not be the aforementioned gif on the page. It is impossible to have a chat button and a chat iframe (expanded or minimized) on the same page at the same time.
stryker1:
Of cause I already read the documentation about theming the chat button. The styling of the button is not my problem here :)
If I understood you right, you wrote that the chat button (to be precise: I am talking about the button that can be "generated" in the admin area not the blue chat button that appears in the bottom-right when the user has started and minimised the chat window), is not on the page, when the chat is started. But this is the case here:
1. I have got the generated button on my page.
2. If the user clicks on it the chat window is shown (and the generated button stays where it was)
3. If the user closes the chat window, the generated button is shown as before and a new button (the blue button with the smiley bubble) is shown in the bottom-right
4. If the user clicks on the generated button, the chat window does not open anymore. He hast to click on the blue button to open it again.
So what I want to achieve:
a) The blue button is shown directly on page load and not the generated button
OR
b) the generated button opens the chat window again, also when the chat window was closed/minised before
What I did so far is styling the generated button to look like the blue button and placed it in the bottom-right.
I also hided the "original" blue button.
My problem with this solution is now only point 4) above.
faf:
Well... Looks like I've understood what you're talking about...
The answer is pretty standard. The right way to do the job is to write a plugin. So, here it is:
* distro: https://mibew.org/plugins#mibew-advanced-button
* repo: https://github.com/Mibew/advanced-button-plugin
And if you will still want to do something on the low level, take a look at the js part of the code of that plugin.
stryker1:
I was amazed that you easily made a plugin for this, thank you!
I already installed it and also activated the tracking of the visitors, but I see no difference in the behaviour of the gif button and/or the blue bubble button.
What should this new plugin exactly do?
You wrote in the description of the plugin:
"A plugin for Mibew Messenger to automatically refresh the button (to represent an actual availability of operators) and set its visibility (depending on existence of an active chat)."
If I understand it right it should hide the gif button when the user clicks on it, so that the chat openes (or the contact form).
So it is not a solution for the point no. 4 which I described, or should it be a solution for this?
If the plugin would work the way I understand your description, I would only need to style the gif button to look like the blue bubble button and place it on the same position as the bubble button, so that the visitors thinks, that the two buttons are the same :) Right?
faf:
--- Quote from: stryker1 on October 16, 2018, 06:58:53 PM ---I was amazed that you easily made a plugin for this, thank you!
--- End quote ---
You're welcome. Actually it's really easy to make a plugin once one understand the basic principles.
--- Quote from: stryker1 on October 16, 2018, 06:58:53 PM ---I already installed it and also activated the tracking of the visitors, but I see no difference in the behaviour of the gif button and/or the blue bubble button.
--- End quote ---
You should regenerate the button after enabling the aforementioned feature. The code of the button will become more complicated, and the button will start "talking" with the server every "n" seconds where "n" is defined in Settings -> Performance -> Tracking refresh time.
--- Quote from: stryker1 on October 16, 2018, 06:58:53 PM ---What should this new plugin exactly do?
You wrote in the description of the plugin:
"A plugin for Mibew Messenger to automatically refresh the button (to represent an actual availability of operators) and set its visibility (depending on existence of an active chat)."
If I understand it right it should hide the gif button when the user clicks on it, so that the chat openes (or the contact form).
--- End quote ---
Yes. The button will become invisible after the creation of the chat iframe. However there could be a short time lag, because button cloaking is not bound to the iframe creation, but related to interaction between the Widget and the Server: https://docs.mibew.org/development/core-architecture.html#widget-server-interaction
--- Quote from: stryker1 on October 16, 2018, 06:58:53 PM ---So it is not a solution for the point no. 4 which I described, or should it be a solution for this?
--- End quote ---
No, it shouldn't. It's a kind of solution for the whole task you've described.
--- Quote from: stryker1 on October 16, 2018, 06:58:53 PM ---If the plugin would work the way I understand your description, I would only need to style the gif button to look like the blue bubble button and place it on the same position as the bubble button, so that the visitors thinks, that the two buttons are the same :) Right?
--- End quote ---
Yes, that's correct.
However, if you'll find the time lag between iframe creation and button dissapearing is too long for you, you can try to somehow utilize the js code of the plugin. At least the code provides you an example of how to check whether the chat iframe is opened or not.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version