This file contains hidden or 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
// http://ejohn.org/blog/javascript-micro-templating/ by John Resig | |
(function(w){ | |
var cache = {}; | |
w.tmpl = function tmpl(str){ | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || | |
tmpl(document.getElementById(str).innerHTML) : | |
new Function("obj", | |
"var p=[],print=function(){p.push.apply(p,arguments);};" + |
This file contains hidden or 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
(function(define) { | |
var SECONDS = { | |
second: 1, | |
minute: 60 | |
}; | |
SECONDS.hour = SECONDS.minute * 60; | |
SECONDS.day = SECONDS.hour * 24; | |
SECONDS.week = SECONDS.day * 7; | |
var TIME_ARR = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'], | |
TIME_ARR2 = TIME_ARR.slice(2); |
This file contains hidden or 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
window.FunctionHelpers = { | |
debounce: function(fn, threshold, execASAP) { | |
var timeout = null; | |
threshold = threshold || 100; | |
return function() { | |
var self = this; | |
var args = arguments; | |
var delayed = function() { | |
if (!execASAP) { | |
fn.apply(self, args); |