Forum Support

 
Advanced Search


[1]

Offline trendstar
Free Member
Posts: 17
Posted on: August 10, 2009, 03:19:25 PM

I downloaded this module, signed up with olark(habla), etc but got an Operation Aborted every time when using IE7. This absolutley did my head in! Anyway I came up with a solution and I thought I would share. Now I'm new to Joomla, Javascript etc so there may be a better way to do it!

In the past I have used JQuery to pre-cache images after a page had loaded. It seemed to me that the problem with habla was being caused by JS and IE bug due to JS call before the DOM was ready (excuse my simplistic explanation!).

To use JQuery I created a js directory below my webroot and installed jquery.js into it.

I then changed the code in the modules/mod_s5_habla_chat/mod_s5_habla_chat.php.

1) I inserted:

<script type="text/javascript" src="http://www.littlebabyboutique.co.uk/js/jquery.js"></script> My URL obviously

before line:

<script type="text/javascript" src="http://static.hab.la/js/wc.js"></script>

2) I inserted:

$(document).ready(function(){

before line:

config = wc_config();

3) I inserted:

});

after line:

window.setTimeout('s5_enable_habla_close()',3000);

4) And indented the line in between.

This gave me the following:

Code:
<?php

defined
('_JEXEC') or die('Direct Access to this location is not allowed.');

$hablaid $params->get'hablaid''' );
$pretext_s5_hc $params->get'pretext'"" );
$posttext_s5_hc $params->get'posttext'"" );
$height $params->get'height''' );
$width $params->get'width''' );

$LiveSite  JURI::base();

?>


<?php if ($pretext_s5_hc != "") { ?>
<?php echo $pretext_s5_hc ?>
<br /><br />
<?php ?>

<div id="habla_available_div" onclick="javascript:habla_window.show();javascript:habla_window.expand();" style="display:none; background-image:url(<?php echo $LiveSite ?>/modules/mod_s5_habla_chat/s5_habla_chat/online.png); background-repeat:no-repeat; background-position:top left; cursor:pointer; height:<?php echo $height ?>px; width:<?php echo $width ?>px"></div>

<div id="habla_unavailable_div" style="background-image:url(<?php echo $LiveSite ?>/modules/mod_s5_habla_chat/s5_habla_chat/offline.png); background-repeat:no-repeat; background-position:top left; cursor:pointer; height:<?php echo $height ?>px; width:<?php echo $width ?>px"></div>

<?php if ($posttext_s5_hc != "") { ?>
<br />
<?php echo $posttext_s5_hc ?>
<?php ?>

<script type="text/javascript" src="http://www.littlebabyboutique.co.uk/js/jquery.js"></script>

<script type="text/javascript" src="http://static.hab.la/js/wc.js"></script>
<script type="text/javascript">

function s5_close_habla_timer() {
window.setTimeout('s5_close_habla()',300);
}
function s5_close_habla() {
document.getElementById("habla_window_div").style.display = "none";
}
function s5_enable_habla_close() {
document.getElementById("habla_closebutton_a").onclick = s5_close_habla_timer;
}

$(document).ready(function(){
  config = wc_config();
  config.vars["start_hidden"] = 1;
  config.vars["expandOnMessageReceived"] = 1;
  wc_init("<?php echo $hablaid ?>",config);

  window.setTimeout('s5_enable_habla_close()',3000);
});

</script>


This cause the call to the habla wc.js code to be delayed until the DOM was ready and my problem was solved.

Cheers

Glen
Logged
[1]

Jump to:  


Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Page created in 0.018 seconds with 21 queries.
Need some help getting your site up and running? Be sure to check out our tutorials area, post on the forum or hire us
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.