Sound notification of incoming messages in chat

1.9.x
aragonc 11 years ago
parent 815a4f5bf5
commit cd7b428881
  1. 6
      main/chat/footer_frame.inc.php
  2. 9
      main/chat/header_frame.inc.php

@ -8,6 +8,10 @@
* @package chamilo.chat
*/
?>
<audio id="audio">
<source src="sound/sonido_notificacion.wav" type="audio/wav"></source>
<source src="sound/sonido_notificacion.ogg" type="audio/ogg"></source>
<source src="sound/sonido_notificacion.mp3" type="audio/mpeg"></source>
</audio>
</body>
</html>

@ -86,18 +86,20 @@ header('Content-Type: text/html; charset='.api_get_system_encoding());
</script>
<script type="text/javascript">
function play_notification() {
document.getElementById('audio').play();
}
function updateChat()
{
if ('<?php echo $chat_size_old; ?>' != '<?php echo $chat_size_new; ?>') {
parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size_new.'&'.api_get_cidreq(); ?>#bottom';
play_notification();
}
}
//$(window).load(function(updateChat){
// $("#audio")[0].play();
//});
function updateConnected()
{
if ('<?php echo $connected_old; ?>' != '<?php echo $connected_new; ?>')
{
parent.chat_whoisonline.location.href='chat_whoisonline.php?size=<?php echo $connected_new; ?>';
@ -116,6 +118,7 @@ function eventMessage()
parent.chat_chat.location.href='chat_chat.php?size=<?php echo $chat_size.'&'.api_get_cidreq(); ?>#bottom';
<?php endif; ?>
document.formMessage.message.focus();
}
function send_message(evenement) {

Loading…
Cancel
Save