all libraries are open source, unless otherwise mentioned
XUI - DOM manipulation, Ajax, Events, CSS, FX
Lawnchair - offline storage wrapper
(higgins={bot:function(){return Math.random()>0.5?"it's just JavaScript":"Dojo already did it"}}).bot() |
document.addEventListener('click', function (evt) { | |
if (typeof evt.target.ontouchend == 'function') { | |
evt.target.ontouchend.call(evt.target, evt); | |
} | |
}, false); |
all libraries are open source, unless otherwise mentioned
XUI - DOM manipulation, Ajax, Events, CSS, FX
Lawnchair - offline storage wrapper
For best results, use hub and git bash completion (included with git under contrib/completion
).
/** | |
* Contains utility functions to be used in various places. | |
*/ | |
var util = {}; | |
/** | |
* Checks the types and sanitizes arguments for functions with optional | |
* parameters and default values. | |
* |
// lazy loading and caching templates | |
// callback receives rendered html - can write to the DOM or whatnot | |
var TMPL_PREFIX = 'tmpl.' | |
function renderTemplate(callback, identifier, data) { | |
// check localStorage for identifier | |
var data = data || {}, | |
key = TMPL_PREFIX + identifier, | |
url = 'templates/' + identifier + '.mustache', |
(function(window, document, notDefined) { | |
/** | |
* Do not use thumbs.js on touch-enabled devices | |
*/ | |
if (document.ontouchstart!=notDefined) return; | |
/** | |
* Map touch events to mouse events | |
*/ |
// check which style properties are different between two DOM elements | |
// obv. needs a browser with getComputedStyle | |
function styleDiff(first, second) { | |
var oneStyle = getComputedStyle(first), | |
twoStyle = getComputedStyle(second), | |
diff = [], | |
i, | |
prop; | |
for (i = 0; i < oneStyle.length; i++) { |
# sed in place, for OS X (Darwin) and Linux | |
# user-agent detection - probably not the best way | |
DASHI='' | |
unamestr=`uname` | |
if [[ "$unamestr" == 'Linux' ]]; then | |
DASHI="-i" | |
elif [[ "$unamestr" == 'Darwin' ]]; then | |
DASHI='-i ""' |
This is some text right here |