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 opath(){ | |
var args = Array.prototype.slice.call(arguments); | |
var object = args.shift() | |
, val = args.pop(); | |
if(args.length > 0){ | |
us.each(args, function(arg, i){ | |
var cur; |
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://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
Extended by Will Shown: gist.github.com/thure | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, |
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
define(function(){ | |
return function(el){ | |
var id = el.getAttribute('id'); | |
if(id) { | |
return '#' + id; | |
}else if(typeof el.className === 'string' && el.className.length > 0){ | |
var classes = el.className.hasOwnProperty('baseVal') ? el.className.baseVal.split(/ +/) : el.className.split(/ +/); | |
classes.unshift(el.tagName.toLowerCase()); | |
return classes.join('.'); | |
}else{ |
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
define(['underscore'], function(_) { | |
return new function() { | |
var self = this; | |
var routes = []; | |
var catchAllCallback = null; | |
this.addRoute = function(pattern, callback) { | |
routes.push({pattern: pattern, callback: callback}); |
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
define(function(require, exports, module){ | |
exports.dateFromTicks = function(ticks){ | |
try { | |
var sec = Math.round(ticks / 1e7); | |
sec -= 1.16444736e10; | |
return new Date(sec * 1e3); | |
}catch(err){ | |
return null | |
} |
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
define(['q', 'underscore'], function(q, _){ | |
return function(opts){ | |
var opts = opts || {} | |
, parent = opts.parent || document.body | |
, innerHtml = opts.html || '' | |
, tagName = opts.tagName || 'div' | |
, className = opts.className ? opts.className + ' trackInsertion' : 'trackInsertion' | |
, data = opts.data || {} |
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
define(['q'], function(Q){ | |
return function(options) { | |
var deferred = Q.defer() | |
, req = new XMLHttpRequest(); | |
req.open(options.method || 'GET', options.url, true); | |
// Set request headers if provided. | |
Object.keys(options.headers || {}).forEach(function (key) { |
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
define(function(){ | |
return function(el, iterator){ | |
var cur = el; | |
while(cur.parentNode !== document.body){ | |
if(iterator.call(null, cur)){ | |
return cur | |
}else{ | |
cur = cur.parentNode; | |
} |
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
{ | |
"_version" : "2.6.2", | |
"applicationcache" : true, | |
"audio" : true, | |
"backgroundsize" : true, | |
"borderimage" : false, | |
"borderradius" : true, | |
"boxshadow" : true, | |
"canvas" : true, | |
"canvastext" : true, |
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
ajax : WinJS.xhr, | |
getDocumentFromUrl : function(url,cb){ | |
this.ajax({ url: url }).then( | |
function (r) { | |
cb(null,r.responseXML); | |
}, | |
function (e) { | |
cb(e); | |
} |