Help Center Live Community

General => General Discussion => Topic started by: johnny_n on February 20, 2008, 05:53:42 PM



Title: Custom Links
Post by: johnny_n on February 20, 2008, 05:53:42 PM
Hi --

Just installed HCL and find it very impressive.

One thing I'm having trouble with -- I want to use my own links to initiate chat and I want two separate buttons on the page -- one for department one, another for department two.

I can't seem to get both the java functionality (chat-sized window, department selected) without the HCL image, even when I replace the image links.  What happens is my buttons work but the HCL images are behind them -- and no matter if an operator is online, the chat window says operators are busy.

This is what I have:

Code:
<div id="econtact2"><a href="javascript:Live.initiate_accept();" class="nb" onmouseover="MM_swapImage('Image4','','images/chat1_over.png',1)" onmouseout="MM_swapImgRestore()"><img src="images/chat1.png" name="Image4" width="62" height="21" border="0" id="Image4" /></a><script type="text/javascript" language="javascript" src="http://www.xxx.com/xxx/hcl/class/js/include.php?live&departmentid=1"></script></div>

<div id="econtact3"><a href="javascript:Live.initiate_accept();" class="nb" onmouseover="MM_swapImage('Image5','','images/chat2_over.png',1)" onmouseout="MM_swapImgRestore()"><img src="images/chat2.png" name="Image5" width="62" height="21" border="0" id="Image5" /></a><script type="text/javascript" language="javascript" src="http://www.xxx.com/xxx/hcl/class/js/include.php?live&departmentid=2"></script></div>

When I use the HTML links instead of the java links, I get a whole new window instead of the chat-sized window (
Code:
target=_blank"
) and even when I replace the "
Code:
?departmentid=
", I still get a prompt asking where the chat should be directed.

Surely others have encountered this -- what's the best fix?

Any ideas would be appreciated!

Best--
john

-- EDIT: I've got a fix, it's not pretty so if anyone has a better idea I'm all ears.  I replaced the two standard images /icons/offline.gif & online.gif with 1x1 transparent gifs.  I then replaced the java code with this:

Code:
javascript:Live.launch('chat', '1', '') and javascript:Live.launch('chat', '2', '')

Seems to work just fine.  Have I broken anything?