mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-16 09:04:11 +03:00
[2141253] Play sound when visitor appears in the queue
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@130 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
dc955f55b7
commit
9ca2afb981
@ -226,6 +226,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
if( haveMessage ) {
|
||||
FrameUtils.scrollDown(this._options.container);
|
||||
if( !this.focused ) {
|
||||
playSound(Chat.webimRoot+'/sounds/new_message.wav');
|
||||
window.focus();
|
||||
}
|
||||
}
|
||||
|
@ -519,3 +519,15 @@ var CommonUtils = {
|
||||
}
|
||||
};
|
||||
|
||||
function playSound(wav_file) {
|
||||
var player = document.getElementById("player");
|
||||
if (player) {
|
||||
player.parentNode.removeChild(player);
|
||||
}
|
||||
player = document.body.appendChild(document.createElement("div"));
|
||||
if(navigator.userAgent.indexOf('MSIE') != -1) {
|
||||
player.innerHTML = '<bgsound src="'+wav_file+'">';
|
||||
} else {
|
||||
player.innerHTML = '<div style="position: static; width: 0px; height: 0px"><embed type="audio/mpeg" src="'+wav_file+'" hidden="true" loop="false" autostart="true"></div>';
|
||||
}
|
||||
}
|
||||
|
@ -298,6 +298,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
this.updateTimers();
|
||||
this.setStatus( "Up to date" );
|
||||
if( newAdded ) {
|
||||
playSound(webimRoot+'/sounds/new_user.wav');
|
||||
window.focus();
|
||||
}
|
||||
} else if( root.tagName == 'error' ) {
|
||||
|
@ -1 +1 @@
|
||||
var myAgent="";var yj=0;var myRealAgent="";function zj(){var $j=["\u006f\u0070\145r\141","\155\u0073\u0069e","\u0073\141\146a\162i","fire\146\u006f\170","\u006eets\143\u0061\u0070\u0065","m\u006f\172illa"];var sj=navigator.userAgent.toLowerCase();for(var i=0;i<$j.length;i++){var _j=$j[i];if(sj.indexOf(_j)!=-1){myAgent=_j;if(!window.RegExp)break;var mk=new RegExp(_j+"\133\040\/\u005d?\050\1330\u002d9]+\u0028\.\1330-\u0039]+)?)");if(mk.exec(sj)!=null){yj=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="\107\145\u0063\153\u006f")myAgent="mo\u007a";} zj();function getEl(name){return document.getElementById(name);}
|
||||
var myAgent="";var _j=0;var myRealAgent="";function mk(){var nk=["\157\u0070e\u0072\u0061","msi\u0065","s\u0061\u0066\141\u0072\151","\u0066iref\157\u0078","\156et\u0073\143\141p\145","m\u006fz\u0069\u006cla"];var hj=navigator.userAgent.toLowerCase();for(var i=0;i<nk.length;i++){var qk=nk[i];if(hj.indexOf(qk)!=-1){myAgent=qk;if(!window.RegExp)break;var rk=new RegExp(qk+"[\040\/]?\u0028[0\0559\u005d\u002b\050\.\u005b\u0030\055\u0039\135+)\077\u0029");if(rk.exec(hj)!=null){_j=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="\107\145\u0063k\u006f")myAgent="\u006do\u007a";} mk();function getEl(name){return document.getElementById(name);}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
src/messenger/webim/sounds/new_message.wav
Normal file
BIN
src/messenger/webim/sounds/new_message.wav
Normal file
Binary file not shown.
BIN
src/messenger/webim/sounds/new_user.wav
Normal file
BIN
src/messenger/webim/sounds/new_user.wav
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user