Skip to content

Instantly share code, notes, and snippets.

@starlocke
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starlocke/89b5ac41a82958c923de to your computer and use it in GitHub Desktop.
Save starlocke/89b5ac41a82958c923de to your computer and use it in GitHub Desktop.
Dell Chat Ping SFX
/*****
* Adds a "ping" sound whenever a Dell agent responds in the chat
* - @author Victor Yap <victor.yap@alumni.concordia.ca>
* NOTES:
* - Uses HTML5's <audio> tag (future proof?)
* - Originally targetted Chrome with "Custom Javascript for websites" plugin.
*****/
/*****
* Audio clip from: http://soundbible.com/1441-Elevator-Ding.html
* Audio clip License: Sampling Plus 1.0 | Recorded by Corsica
*****/
if(document.URL.match('dell/naclient.aspx')){
var chattext = document.getElementById("chattext");
if(chattext){
chattext.innerHTML += '<audio id="playsnd" src="https://www.dropbox.com/s/so62xy1nm13q1j1/elevator-ding.mp3?raw=1" style="display: none;"></audio>';
}
playsound = function(){
var aud = document.getElementById('playsnd');
aud.load(); aud.currentTime = 0; aud.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment