function getNav(){ var fieldset = $('body > nav fieldset[role=site-search]').after('
').next(); var select = $(fieldset).append('').children(); select.append(''); $($('body > nav ul[role=main-nav] a').concat($('body > nav ul[role=subscription] a'))).each(function(link) { select.append('') }); select.bind('change', function(event){ if (select.val()) window.location.href = select.val(); }); } function addSidebarToggler() { $('#articles').before('»').previous().bind('click', function(e){ e.preventDefault(); if($('body').hasClass('collapse-sidebar')){ $('body').removeClass('collapse-sidebar'); e.target.innerHTML = '»'; } else { $('body').addClass('collapse-sidebar'); e.target.innerHTML = '«'; } }); } function testFeatures() { var features = ['maskImage']; $(features).map(function(feature){ if (Modernizr.testAllProps(feature)) { $('html').addClass(feature); } else { $('html').addClass('no-'+feature); } }); if ("placeholder" in document.createElement("input")) { $('html').addClass('placeholder'); } else { $('html').addClass('no-placeholder'); } } function addDivLines(){ $('div.highlight pre code').each(function(el){ var content = bonzo(el).html(); var lines = content.replace(/\s*$/g, '').split('\n'); var count = lines.length; bonzo(lines).each(function(line, index){ if(line == '') line = ' '; lines[index] = '';
var lineNumbers = '';
var tableMiddle = ' | '; var tableEnd = ' |
'+$('pre', code).html()+'' + tableEnd;
$(code).html(table);
});
}
function flashVideoFallback(){
var flashplayerlocation = "/assets/jwplayer/player.swf",
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
$('video').each(function(video){
video = $(video);
if(!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") != -1){
video.children('source[src$=mp4]').first().map(function(source){;
var src = $(source).attr('src'),
id = 'video_'+Math.round(1 + Math.random()*(100000)),
width = video.attr('width'),
height = parseInt(video.attr('height')) + 30;
video.after('