Create a gist now

Instantly share code, notes, and snippets.

@subzey /koolclicks.js Secret
Created Aug 19, 2015

What would you like to do?
/*
* Kool Clicks™ Version 0.0.1
* http://banzor.us/
*
* Copyright (c) 2015 Chris Bannon
* Licensed under the MIT License
*
*/
/*
* Modified by <subzey@gmail.com>
*/
(function koolClicks() {
if (!window.addEventListener){
return;
}
// auto element in the outer scope, lazy initialized
var kcAudio = null;
// Listen to ALL click events on capturing phase
window.addEventListener('click', function(e){
// Check if clicked element or any of its parent nodes is a link
var isLink = false;
for (var element = e.target; element; element = element.parentNode){
if (element.href && element.tagName && element.tagName.toLowerCase() === 'a'){
isLink = true;
break;
}
}
if (!isLink){
// It's not a link.
return;
}
if (!kcAudio){
// Create kcAudio in the outer scope if needed
var kcEncodedWavFile = 'UklGRkQsAABXQVZFZm10IBAAAAABAAIARKwAABCxAgAEABAAZGF0YSAsAAAAAAAAAAAAAAAAAAABAAEAAAAAAP7//v/+//7/7//v/63/rf9k/2T/kv+S/8EAwQCJAokC7wLvAj4BPgF4/3j/Jf8l/9P/0/9KAEoA9//3/7D/sP9AAEAAEwETAWIBYgEeAR4BjwCPAAkACQAMAAwAhgCGABwAHABq/mr+Wv1a/ef95/3n/uf+f/9///b/9v/5APkAJgImAoYBhgHF/sX+cPxw/Pf89/w6ADoAlQKTAhEBDQF4/nb+cP5z/iwAOQC0AMQAzf7V/t382/yy/a79KgAoAGsBbQGsAKwAff97/9P/1P//AAUB0ADYAOv/8v9zAHYAGgIbAp4CnwIPABEAZPxl/M/8x/ydAI8AxgG7AS3/Jv+Q/I38zfzN/JX/mv8SAh0CigKTAuMB3gEvAR0BrwCeAK8ArgDLANcAQgBJANb/z/+OAIYAPwFAAf3/AQA+/jr+A//0/nABYgGUApICrQGzAQsAEABh/2D/KgApAE8BVAGQAZUB7ADtABYAGACJ/5P/f/+N/5b/mv+s/53/bgBbAFUBUwHOANUA0f7O/vj85/yy/KH8F/4S/n//if9z/4H/Cv8V/9L/1/8MAQ4BlAGYAUsBU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wgAAADg//X/y//f/8D/x/+0/7//tP/R/7r/5f+9/9//zv/V//b/4P8XAPD/HQDz/w4A8//3//z/2/8DAMz////f//b/DQD3/x4AAAD2/wEAyf/9/83/+v/u//z/BgACAAYACwDz/woA3/8AAOn//P8VAAMARgAPAFAAEQA1ABIAHQAfABkAJAAiABMANwAHAEgAFQA7ACoAIQAsAA8AIAD+/xUA6v8JAOf/AADz//3////+/wgAAwAiABUAQAAjAEUAFQAsAPj/BwDj/9//2P/C/9D/wv/O/9f/1f/y/+L/+f/p/9//4f+9/9T/sv/O/7//0f/O/9z/2f/v/97/AADb/wYA1P8CANf////p/wAA//8DAAcABAALAA0AEwAdABwAKAAfACMAGwAbABIAGwALACQAFAAwACQANgAoADcAIwA3ABsAMAAWACAAHwAYADUAIwBCAC0ARQAjAEQADAA8APb/IQDh////0f/t/8n/8v/F//z/wP8AAL7/AADB//X/xf/p/8n/7v/P/wEA1f8JAOD/9//y/9r/BQDF/xAAzf8YAOz/KgD+/zcA+/8yAAIALwAZADoAIQA7ABoALQAfACgAMQAwADoANgA0ADUAJQAyABQAMQAHADIAAAArAPz/HwAAABgABgAVAAwADgAXAAUAFgD8//T/6v/J/9P/w//L/+X/zP/8/8T/6P+5/8v/tv/H/7X/2f+1/+L/uv/Q/8H/vv/I/9D/0//2/+X/BgD8//z/DgDr/xcA8/8dAAgAIwAIAB8A/P8TAAkAEAAuABUAOgASABcABADw//3/AAD8/ygA+P8fAPP/8P/5/9H/BQDQ/wwA6f8OABEAFQApAB0AGwAdAAYAGwAIABoABQAUAOv/CQDd/wAA7f8AAPb/7//x/+P/7//h//D/4P/n/9//3f/c/9//3//i/+P/5v/n//j/7/8GAPn/AAAAAPX/AwD6/wcABQAMAA4ADgARAAsAEAAIAAUABQAAAAIABQAAAAwAAAAHAAAAAAD8/wAA+v8AAPz/+f8AAOv/AAD1/wMADwAIABcACgAMAAkAFAALACAADQAOAAkA9v8CAPX/AAD6/wAA8//7//r/9v8KAPb/BQD1//X/8f/5//L/AADz//X/8v/v//L/AAD3/w8A/v8OAAAAAgAAAPz/AAD//wMACAAHAA8ACAANAAYACQAEAAkABAAIAAIABAAAAP//AAD4//7/+f/9//j//f/0//3/9f8AAAAAAgAHAAQAAAADAPz/AgD//wMA/P8DAPn/AgD9/wIA/v8BAPb/AAD2/wAAAwAAAAgA/v8AAPv/AAD7////+//4//r/9P/5//r/+v8EAP3/EAAAABEAAAAGAAAAAgAAAAkAAgAPAAQACwAEAAgABAAHAAMABAACAAUAAQAHAAEABAAAAP//AAD3////9P/+//v/AAAFAAAACAABAAQAAQAAAAIAAAACAP3/AAD5/wAA/P8AAP//AQD6/wAA9v8AAP7/AAAGAAAAAwAAAP///v/9//3/+v/7//X/+v/6////BgAGAA0ACwAHAAYAAAD//wAA/P8FAAAACgACAAYAAQACAAAAAgACAAEABQAEAAYACgAGAAwABQAHAAEABAABAAUAAwADAAAA/P/7//b/9f/2//b/+f/7//v//v///wAAAwAEAAsACgAKAAoAAAAAAPT/8//2//L/AAD//wgACAACAAQA+v/7//f/9//5//3/+P8AAPL/+P/r/+//7f/x//f/+/8AAAAABAABAAIA//8AAP//AAACAAAABAAAAAEAAAACAAcACAAMAAwABAADAPT/9P/x//H/AAAAAAkACAAAAAAA8//0//L/8/8AAP7/CgAJAAwADQAMAAsADAAIAAoABgAIAAUACgAGAAsABAAHAAEABAADAAMABAAAAAAA+f/6//n/+/8AAAIABwAIAAYABwAAAAAA/f/9/wAAAAAHAAMABgAFAAEAAwD//wAA/v8AAPz////8//7//////wAAAAACAAMAAAACAPr//f/y//T/7v/x//H/9P/3//r/+f/9//n//P/9////AQADAAUABgAGAAYAAgACAP7//v/7//r//f/5/wAA/v8FAAQABwAGAAEAAAD///7/AAAAAAIAAQAAAAAAAAD///7//f/8//z/AAD//wUABAALAAoADAANAAUABgD+/////v/+/wUABQAOAAwACgAHAP///v/7//v/////////AAD8//7//f/+/wAAAQAEAAUABAAGAAQABQACAAQAAQACAP//AAD6//v/9v/3//f/+f/9//7/AAAAAP//AAD//////v////7//v//////AAAAAAAAAAAAAAAAAAAAAAIAAgACAAEA/v/+//r/+v/6//r//////wIAAgACAAIAAAD///3//P/9//r//v/7//7/+v////3/AgABAAYABQAFAAQAAwACAAIAAgADAAIAAQACAP7//v/8//3///8AAAIAAwADAAYAAQADAAAAAgABAAMAAwAHAAUACQAHAAoACQALAAcACQAEAAcABAAGAAUABgABAAIA/f/9//f/9//3//f/+//6//z/+//7//n/+f/3//j/9//4//b/+f/2//z/+f8BAP//BQABAAMAAAAAAP//AAD//wEAAAAAAP//AAD+/wAAAAAFAAUACQAJAAYABwABAAIAAAABAAIABAAEAAcABAAGAAMABgAEAAcACAAKAAkACwAHAAkAAgAEAP//AAD8/////f////z//f/3//f/8v/z//P/8//2//X/+P/4//v/+v////7/AwACAAUAAwAAAAAA/P/6//v/+f8CAAEADAAKAAoACAAAAAAA/P/7/////v8BAAAA/v/8//b/9P/1//T//f/8/wEAAAAAAAAA/v/+//////8CAAIAAwADAAAAAQACAAIABwAIAAkACgADAAQA+f/6//j/+f8BAAIABgAHAAAAAQD4//n/9f/2//r/+/8BAAEABQAFAAYABwAGAAYABAAFAAMABAAFAAUABAAEAAMAAwAEAAQABgAGAAMAAwD+//7//f/9/wAAAAADAAMAAQABAP3//P/5//j/+f/5//3//f///////v/+//z//P/7//r/+v/6//z/+//9//3/AAAAAAQAAwAFAAQAAQABAP3//f/7//v//////wIAAgAEAAQAAwADAAQABAAGAAYABwAHAAYABgACAAMA/v////r/+v/5//n//P/8/wEAAQADAAQAAQACAAAAAAAAAAAAAAAAAAAAAAD//////v////3//v/+////AQABAAUABgAGAAcAAQACAP3//f/8//z/AAAAAAYABgAEAAQA///+//z/+/8AAP//AAAAAAAAAAAAAAAABQAFAAkACQAJAAkABgAFAAIAAQAAAAAAAAAAAP3//v/4//n/9//3//r/+f/9//3//v/+//3//f/8//z//f/9/wAAAAAAAAAAAAABAAAAAAABAAEAAwAEAAIAAgAAAAAA/v/+//////8AAAAAAQABAAAAAAD9//z//P/8//z//P/+//3/AAD//wIAAQAEAAMAAwADAAIAAgABAAEAAgACAAIAAgAAAAAAAAAAAAAAAAABAAEABAADAAQABAABAAMAAAAEAAEACAADAAgAAgADAAAAAAAAAAAAAQACAAIAAwAEAAUABgAHAAYACQABAAUA+v/9//T/9v/2//b//P/8/wAAAQD+////+f/2//b/8P/5//P//P/4//z/+v/7//r/+//8//7/AQACAAUAAwABAAEA+/8AAPr/AQAAAAAABAAAAAEAAQD//wUAAQAIAAcABAAFAP7/+//9//b/AwD+/wYABQACAAQA/v////z//P//////AgAEAAMABgADAAQAAQADAAAAAwD+/wMA/v8AAP7/+f/+//j/////////AQD+//7//v/3/wAA+f8EAAEABgAKAAcADAAFAAkAAwAGAAIABAACAAQAAgAEAAEAAgAAAAAA/v/+//3////+//7//v/7/////P8AAAEAAAADAP7/AAD7//v/+f/4//v/+//+/wAA//8BAP//AAAAAAAAAgABAAMAAgADAAIAAQABAAAAAAD9////+//9//3/+/8AAPz/AQD9/wAA/f8AAP//AQAAAAMAAQADAAIAAgADAAIABAABAAQAAQACAAMAAQAEAAAABAAAAAEAAAD+/wAA/f////////8BAAAAAAAAAP3//f/8//z//f/9//7//f/9//v//f/9/wAAAQABAAUAAgAHAAIABAADAAEAAgABAAEAAwAAAAQA//8CAAAA//8AAP//AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAQAAAAEAAAABAAAAAAAAAP//AAD9/////P////7/AAAAAAEAAAABAAAAAAAAAP///v/+//7//v/+//7//v/+//7/AAAAAAAAAQAAAAAAAAD//wAA/f8AAP7/AAD/////AAD//wAAAAAAAAEAAAADAAAABQAAAAYAAAAEAAEAAgADAAIABQADAAUAAwAEAAIAAwAAAAIAAAABAAIAAAABAP//AAD+//7//v/9/////v8AAAAAAAD//wAA/f8AAPv/AAD8/wEA/P8BAP7/AQAAAAIAAQADAAIAAgABAAAAAAD///3//v/9//7////+/wEA/v8AAP3//v/8//7//f8AAP3/AAD+/wAA/////wEAAAACAAEAAgADAAEAAgACAAEAAgABAAEAAQAAAAAAAAAAAP//AAD//wAA//8BAAAAAAAAAPz/AAD7/wAA/v8AAAAAAAD//wAA/f8AAP3/AQAAAAIAAgACAAMAAQADAAAAAwAAAAIAAAABAAAAAQAAAAAA//8AAP//AAD//wAA//8AAP7//v////////8AAAAAAQAAAAEAAAAAAAEAAAABAAAAAQAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAD+/wAA/f8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAQABAAIAAQACAAEAAQABAAAAAQAAAAEA//8AAAAAAAAAAP//AAD/////AAD//wAA//8AAP//AAD//wAA//8AAP//AAD+/wAA//8AAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
// Create Audio Element and set src to Base64 encoded data URI
kcAudio = new Audio('data:audio/wav;base64,'+kcEncodedWavFile);
}
// Now the tricky part: Wait until all the handlers finished, both on capturing and bubbling phase
setTimeout(function(){
if (e.defaultPrevented){
// Some handler called e.preventDefault(), so link actually would not be activated
return;
}
// Play some oldskool soundz
kcAudio.play();
}, 0);
}, true);
}());

banzor commented Aug 19, 2015

Bless you subzey. I was too lazy to write that code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment