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
(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) |
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(typeof Ink === 'undefined'){ | |
var Ink = {}; | |
Ink.$ = (jQuery) ? jQuery : $; | |
Ink.isMobile = function(){ | |
return (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())); | |
}; | |
} |
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 imageLoadEvent = function(){ | |
console.log('image ready'); | |
} | |
var $newImg = this.$(new Image()), | |
src = 'blah.png'; | |
// using onreadstatechange to deal with cached stuff in IE | |
$newImg.bind('load readystatechange', function(e){ | |
if(this.complete || (this.readyState == 'complete' && e.type == 'readystatechange')) imageLoadEvent(); |
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
<a href="http://www.nytimes.com/interactive/2012/12/28/multimedia/2012-the-year-in-graphics.html"><div id="nytg-trailer" style="width:337px; height:190px;" data-poster='http://graphics8.nytimes.com/packages/images/newsgraphics/2012/1227-annual/year-in-graphics-poster.jpg' data-mp4='http://graphics8.nytimes.com/packages/video/newsgraphics/2012/1227-annual/year-in-graphics.mp4' data-ogv='http://graphics8.nytimes.com/packages/video/newsgraphics/2012/1227-annual/year-in-graphics.oggtheora.ogv' data-loop="false"></div></a> | |
<script type="text/javascript" charset="utf-8"> | |
/* | |
* The New York Times Multimedia Desk. | |
* Namespace: NYTD.NYTMM | |
*/ | |
window.NYTD=window.NYTD||{};window.NYTD.NYTMM=window.NYTD.NYTMM||{};if(NYTD.jQuery){$j=NYTD.jQuery.noConflict()}window.NYTD.NYTMM.namespace=function(d){var c=d.split("."),b=NYTD.NYTMM,a;if(c[0]==="NYTD"&&c[1]==="NYTMM"){c=c.slice(2)}for(a=0;a<c.length;a+=1){if(typeof b[c[a]]==="undefined"){b[c[a]]={}}b=b[c[a]]}return b};if(typeof console=="undefined"){window.console={log:func |
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
nytg.gfx = function(){ | |
return{ | |
init: function(){ | |
this.mmVideoPlayerOptions = { | |
autoPlay : false, | |
controlsBelow : false, | |
fullScreen : true, | |
skin : "light", | |
autoRewind : true | |
}; |
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 console = console || {log:function(a){return false}}; | |
'use strict'; | |
// Add ECMA262-5 method binding if not supported natively | |
// | |
if (!('bind' in Function.prototype)) { | |
Function.prototype.bind= function(owner) { | |
var that= this; | |
if (arguments.length<=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
<script type="text/javascript" charset="utf-8"> | |
nytint.history = { | |
// The interval at which the window location is polled. | |
URL_CHECK_INTERVAL : 500, | |
// We need to use an iFrame to save history if we're in an old version of IE. | |
USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8, |
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 scrollLoader = function(){ | |
return{ | |
elements: [], | |
winHeight: window.innerHeight ? window.innerHeight : $(window).height(), | |
threshHold: 150, | |
init: function(){ | |
this.setElementsPosition(); | |
$(window).bind('scroll',_.bind(scrollLoader.checkViewPort,this)); | |
this.checkViewPort.lastChecked = 0; | |
this.checkViewPort.busy = false; |
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
window.Inflector = { | |
camelize: function(s) { | |
var parts = s.split('-'), len = parts.length; | |
if (len == 1) return parts[0]; | |
var camelized = s.charAt(0) == '-' | |
? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) | |
: parts[0]; | |
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
// Handles JavaScript history management and callbacks. To use, register a | |
// regexp that matches the history hash with its corresponding callback: | |
// | |
// dc.history.register(/^#search/, controller.runSearch); | |
// | |
// And then you can save arbitrary history fragments. | |
// | |
// dc.history.save('search/freedom/p3'); | |
// | |
DV.history = { |