Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Hi
I'm not referring to customisation within lhc.
On www.donbur.co.uk, I use lhc and have been for some time - It's great!!
In the footer (right side) of our new page design *** http://www.donbur.co.uk/test I have a section with a graphic that I would like to change depending on whether someone is online or not.
The widget does this, but is there a javascript method to detect online status and change the content of a div?
For instance, I could have
[== HTML ==]
<div id="lhcstatusgraphic"></div>
Then a piece of js to put "online" or "offline" into the div.
I'm sure this is possible but I'm not sure how to go about it.
Any help would be appreciated.
Thanks, Richard
Last edited by RichardO (2017-11-29 15:33:04)
Offline
Hi RichardO ,
welcome back on the forum!
Please try to read the documentation.
I hope the below link can help you.
https://livehelperchat.com/documentation-6c.html
https://livehelperchat.com/how-to-chang … -332a.html
https://livehelperchat.com/article/view/59
https://livehelperchat.com/i-m-planning … -262a.html
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline
Hi RichardO ,
welcome back on the forum!Please try to read the documentation.
I hope the below link can help you.https://livehelperchat.com/documentation-6c.html
https://livehelperchat.com/how-to-chang … -332a.html
https://livehelperchat.com/article/view/59
https://livehelperchat.com/i-m-planning … -262a.html
Thank you for these links.
Unfortunately, most of these are very general links to various help topics but it doesn't answer my question.
If you read the question, you'll see I'm not trying to alter templates or modify lhc in any way. I simply want to detect if lhc users are online or offline.
Offline
Sorry,
I cannot help more with that.
You can find some suggestions here:
https://forum.livehelperchat.com/viewtopic.php?id=2255
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline
What you should is see what html elements lhc renders and add CSS to your stylesheet
Offline
What you should is see what html elements lhc renders and add CSS to your stylesheet
Thanks Remdex.
Not a bad idea although I want to add additional content rather than changing existing css. I'll look at element.cloneNode() to see if I can copy/append the html elements and add alternative css.
Thanks for trying.
Kind regards
Richard
Offline
This works so I'm implementing now...
[== Undefined ==]
<span class="lhc-text-status">Offline</span>
<div id="lhcStatusDuplicate"></div>
<script>
var lhcStatus = document.getElementsByClassName("lhc-text-status");
var lhcStatusClone = lhcStatus[0].cloneNode(true);
document.getElementById("lhcStatusDuplicate").appendChild(lhcStatusClone);
</script>
lhc renders a span with the class "lhc-text-status" which is either Offline or Online - great starting point.
The javascript above takes that content and duplicates into the div with id "lhcStatusDuplicate", which I can use .
Thought I'd post to help anyone else asking.
Thanks
Richard
_____________
*edit* - no it doesn't work - I'm getting an "Uncaught TypeError: Cannot read property 'cloneNode' of undefined..." shame...
Last edited by RichardO (2017-11-30 10:02:53)
Offline
You can use one of the callbacks to lhc object then status widget is rendered.
https://livehelperchat.com/integration- … -273a.html
See in this URL for
show_widget_cb
Offline
You can use one of the callbacks to lhc object then status widget is rendered.
https://livehelperchat.com/integration- … -273a.htmlSee in this URL for
show_widget_cb
Great!! Thank you.
Offline
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline