(function () { var protocol = location.protocol, is_mac = navigator.userAgent.indexOf('Mac') > -1 || location.search.indexOf('is_mac') > -1, is_win = (navigator.userAgent.indexOf('Windows') > -1 || location.search.indexOf('is_win') > -1) && location.search.indexOf('is_linux') < 0, suffix = is_mac ? '-Mac' : (is_win ? '' : '-GNOME'); if (protocol == 'file:') protocol = 'https:'; function $maketoggle(trigger_selector, toggle_selector, return_value) { if (return_value == null) return_value = true; $(trigger_selector).css('cursor', 'pointer').hover(function () { $(this).addClass('hover'); }, function () { $(this).removeClass('hover'); }).click(function () { var $this = $(this); if ($this.hasClass('collapsed')) $this.removeClass('collapsed').addClass('expanded'); else $this.removeClass('expanded').addClass('collapsed'); $this.next(toggle_selector).slideToggle(); return return_value; }).addClass('collapsed clickable').next(toggle_selector).hide(); }; function $makeslider(container_selector, toggle_selector, class_name, effect) { if (!effect) effect = 'slideToggle'; $(toggle_selector).hide(); $(container_selector).addClass(class_name); $('a[href^="' + toggle_selector + '"]').click(function () { $(toggle_selector + ' .close-button').click(); return false; }).addClass('off'); $('
').click(function () { if ($('a[href^="' + toggle_selector + '"]').hasClass('off')) $('a[href^="' + toggle_selector + '"]').removeClass('off').addClass('on'); else $('a[href^="' + toggle_selector + '"]').removeClass('on').addClass('off'); $(toggle_selector)[effect](); return false; }).appendTo(toggle_selector); }; function $splash_anim(i, splash_frames) { if (i == splash_frames.length) { var width = (is_mac ? 816 : (is_win ? 752 : 762)); $('#splash').fadeOut(566, function () { $('#splash_version_string, .splash_anim').hide(); $('#splash').addClass('folded'); $('#splash').css({'background-image': 'url(' + imgs.pop().src + ')', 'background-size': width + 'px auto', 'display': 'block', 'width': width + 'px', 'height': '660px', 'top': '42px'}); setTimeout(function () { $('#splash').addClass('unfold'); if ($(window).height() <= $('#header').outerHeight(true) + 64 && $(window).scrollTop() < ($('#header').outerHeight(true) + 64) - $(window).height()) setTimeout(function () { $('#splash').css({'top': '344px'}) $('#intro').css({'z-index': 9999}).animate({'top': '-876px', 'margin-bottom': '-306px'}, 500, function() { $('#splash').addClass('down'); }); }, 1000); }, 100); }); return; } splash_frames[i].css('left', '0'); if (i && i != 16) splash_frames[i - 1].hide(); setTimeout(function () { $splash_anim(i + 1, splash_frames); }, 1000 / 30); }; var img, imgs = [], imgpaths = ['theme/splash.png', 'theme/splash_version.png', 'theme/splash_anim.png']; jQuery(function ($) { /* Infobox slider */ $('').prependTo('#infobox'); $makeslider('#infobox', '#info', 'fixed-top'); /* Donation box slider */ if (location.protocol == 'file:') $makeslider('#donation-box', '#donate', 'fixed-center', 'fadeToggle'); /* TOC toggles */ $maketoggle('#toc li:has(ul) > a', 'ul', false); /* Download toggle */ $maketoggle('#download h3', 'div'); /* Linux downloads combo */ $('#download div > div > a.button').mousedown(function () { $('#download div > div > ul.packages').slideToggle(); return false; }).click(function () { return false; }); /* Quickstart sub toggle */ $maketoggle('#quickstart h3', 'div.toggle'); /* Quickstart sub sub toggle */ $maketoggle('#quickstart h4, #quickstart h5', 'ol, p'); /* Requirements toggle */ $maketoggle('#requirements-source h3', 'div'); /* Driver install sub toggle */ $maketoggle('#install-windows-driver h4, #install-windows-driver h5', 'ol, p'); /* Install toggle */ $maketoggle('#install h3', 'div'); /* Hide issues list */ $('#issues > ul').hide(); /* Issues toggle */ $maketoggle('#issues dt', '#issues dd'); /* toggle on link click */ $('a[href^="#"]:not([href^="#install-"])').click(function() { if ($($(this).attr('href')).hasClass('collapsed')) $($(this).attr('href')).click(); return true; }); /* Install toggle on link click */ $('a[href^="#install-"]').click(function() { if ($($(this).attr('href')).find('h3').hasClass('collapsed')) $($(this).attr('href')).find('h3').click(); return true; }); /* Changelog toggle */ $maketoggle('#changelog dt', 'dd'); $('#changelog dt').first().click(); /* Mail */ $('a:not([href])').each(function () { var $this = $(this), at = ' ‹at› '; if ($this.html().indexOf(at) > -1) { var email = $this.html().split(at).join('@').split(/\s+/).join(''); $this.attr('href', 'mailto:' + email).html(email); } }); /* Track outbound links */ if (location.protocol != 'file:') $('a[href^="http://"]:not([href^="http://' + location.hostname + '"], [href^="http://hub.' + location.hostname + '"], [href^="http://colorimetercorrections.' + location.hostname + '"]), a[href^="https://"]:not([href^="https://' + location.hostname + '"], [href^="https://hub.' + location.hostname + '"], [href^="https://colorimetercorrections.' + location.hostname + '"])').each(function () { this.target = "_blank"; }).on('mouseup', function (e) { if (e.which <= 2) $.get(location.protocol + '//outbound.' + location.hostname + '/' + this.hostname + this.pathname); return true; }); /* Indent after br */ $('#content p > br').after('') /* Intro */ if (location.pathname != '/history.html' && location.pathname != '/CHANGES.html' && $(window).width() >= 760 && (location.protocol != 'file:' || (location.search || '').indexOf('debug') > -1 || (document.cookie || '').indexOf('debug') > -1) && !navigator.userAgent.match(/MSIE\s*[678]\./)) { $('#header').addClass('intro'); function splash_onload() { this._loaded = true; for (var i = 0; i < imgpaths.length; i ++) if (!imgs[i] || !imgs[i]._loaded || !imgs[i].complete || !imgs[i].height) return; var splash_wrapper = $(''), splash = $('