To use this code, first go on your active bundle page, and open a JavaScript console. On Firefox, it's Ctrl-Shift-K, while on Chrome it's Ctrl-Shift-J. Then paste in this line:
ChatPinger=function(){var b=this,d,e=[];this.notifyMyOwn=this.muted=!1;this.notifyActiveTab=!0;this.notifyActions=!1;this.play=function(){this.muted||d.play()};this.setSound=function(a){d=new Howl({urls:[a]})};var f=function(a){a=$.parseJSON(a).message;!a||"action"==a.kind&&!b.notifyActions||!b.notifyActiveTab&&a.chat_id==chatBoxer.prevChatId||!b.notifyMyOwn&&"regular"==a.kind&&a.user&&parseInt($(chatBox).data("user"))==a.user.id||b.play()};this.setSound("https://dl.dropboxusercontent.com/u/29365870/ding.wav");$(".chat").each(function(a,b){var c=$(this).data("channel");if(-1!=$.inArray(c,e))return!0;faye.subscribe(c,f);e.push(c)})};pinger=new ChatPinger;
and press Enter.
There are a few options you can set (square brackets indicate default value):
pinger.muted = true|[false]
- Don't ping
pinger.notifyMyOwn = true|[false]
- Ping when your own message gets sent
pinger.notifyActiveTab = [true]|false
- Ping even when messages appear in your current chat tab
pinger.notifyActions = true|[false]
- Ping when some gets chat powers applied to them
You can also set your own ping sound by typing pinger.setSound('url')
, where url
is the address of a sound file.
Warning: Current ping sound is fairly loud.