This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.shuffle = function(size) { | |
var arr = this.split(''); | |
for (var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x){}; | |
arr = arr.join(''); | |
return size ? arr.substr(0, Math.min(size, arr.length-1)) : arr; | |
}; | |
var Tokenizer = { | |
seed: '1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm', | |
getToken: function(size) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used to track the enabling of hover effects | |
var enableTimer = 0; | |
/* | |
* Listen for a scroll and use that to remove | |
* the possibility of hover effects | |
*/ | |
window.addEventListener('scroll', function() { | |
clearTimeout(enableTimer); | |
removeHoverClass(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Able to load a JS file | |
$.loadJS = function (src) { | |
var s = document.createElement('script') | |
s.type = 'text/javascript' | |
s.async = true | |
s.src = src | |
var x = document.getElementsByTagName('script')[0] | |
x.parentNode.insertBefore(s, x) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* If class Petar does not already exist, create a new instance of it | |
*/ | |
window.Petar = window.Petar || {}; | |
Petar.Music = function() { | |
var innerContent; | |
function init() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Minified version | |
* 1.14KB (377 bytes gzipped) | |
* | |
* (function(){var documentIsReady=false;function documentReadyHandler(fn){if(!documentIsReady){documentIsReady=true;if(document.addEventListener)document.removeEventListener("DOMContentLoaded",function(){documentReadyHandler(fn)},false);else if(document.attachEvent)if(document.readyState=="complete")document.detachEvent("onreadystatechange",function(){documentReadyHandler(fn)});fn()}}function documentReady(fn){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){documentReadyHandler(fn)},false);window.addEventListener("load",function(){documentReadyHandler(fn)},false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){documentReadyHandler(fn)});window.attachEvent("onload",function(){documentReadyHandler(fn)});var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel)doScrollCheck(function(){documentReadyHandler(fn)})}}function doSc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var html = (function () {/* | |
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Hello, world!</h1> | |
</body> | |
</html> | |
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Declaration | |
*/ | |
(function($) { | |
$.jPanelMenu = function(options) { | |
var jpm = { | |
options: $.extend({ | |
'animated': true, | |
'duration': 500, | |
'direction': 'left' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options -Indexes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* For browsers like IE8 and below so we do not reek havok | |
*/ | |
if (!('console' in window)) { | |
function nothing() {} | |
window.console = { | |
debug: nothing, | |
dir: nothing, | |
error: nothing, | |
group: nothing, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add an event listener on an elemnent or array of elements | |
* @param element DOMNode | |
* @param eventName String | |
* @param eventHandler Function | |
*/ | |
function addEventListener(element, eventName, eventHandler) { | |
if (typeOf(eventName) === 'array') { | |
for (var i=0, l=eventName.length; i<l; ++i) { |