function setPreviewPaneHeight(t){var e=t.find(".header"),i=t.find(".preview-body"),o=t.outerHeight()-e.outerHeight();i.css("height",o+"px")}function showProjectSignupBar(){var t,e=Cookies.get("projectSignupBarType");if(e)t=Cookies.get("projectSignupBarCount"),t=parseInt(t)+1,Cookies.set("projectSignupBarCount",t);else{e=["channel","part"][getRandomIntInclusive(0,1)],t=1,Cookies.set("projectSignupBarType",e,{expires:1}),Cookies.set("projectSignupBarCount",t,{expires:1})}var i=document.querySelector(".project-signup-bar."+e);if(i){var o=window.HAnalytics&&window.HAnalytics.keenService?window.HAnalytics.keenService:null;if(o){o.recordEvent({eventName:"Sign up prompt shown"});var r=i.querySelector(".reactPortal");r&&r.addEventListener("click",function(){o.recordEvent({eventName:"Sign up prompt clicked"})})}i.style.display="block",i.classList.add("project-signup-bar-show"),i.classList.remove("project-signup-bar-hide")}}!function(t,e){function i(e){var i=t(this).addClass("bitbucket-widget");if(!i.data("bitbucket-repo-inited")){i.data("bitbucket-repo-inited",!0);var o=e&&e.author&&e.repo?e.author+"/"+e.repo:i.attr("data-repo");if(!o)throw new Error("Either a data-repo attribute or author and repo options are required.");var r=o.split("/");if(2!==r.length)throw new Error("data-repo attribute must be in 'username/repository' format.");var n=r[0],a=r[1];i.html('
/
');var s=t(":first-child",i);s.children(".repo-name").children(":first-child").attr("href","http://www.bitbucket.org/"+n).attr("target","_blank").text(n).end().children().eq(1).attr("href","http://www.bitbucket.org/"+o).attr("target","_blank").text(a),t.ajax({dataType:"jsonp",url:"https://api.bitbucket.org/1.0/repositories/"+o}).done(function(e){function o(t,e,i){return 1===t?e:i}var r=s.children(".repo-last-update");r.text(e.last_updated?"Last updated on "+e.last_updated:"Never updated"),e.logo&&t('').insertBefore(r);var n=e.forks_count||0,a=e.followers_count||0;s.children(".repo-stats").html('
'+n+'
'+a+"
");var c="";e.website&&(c+=''+e.website+""),e.description&&(c+='
'+e.description.replace(/\n/g,"
")+"
"),i.children(".repo-body").html(c),i.trigger("repo-retrieved")}).fail(function(){var t="http://bitbucket.org/"+o;i.children(".repo-body").html('
There was error getting this repository\'s info. Try visiting '+t+"
")})}}t.fn.bitbucketRepo=function(t){return this.each(function(){i.call(this,t)}),this},t.fn.bitbucketRepo.loadOnDocumentReady=!0,t(document).ready(function(){(e.setImmediate||e.setTimeout)(function(){t.fn.bitbucketRepo.loadOnDocumentReady&&t(".bitbucket-widget").bitbucketRepo()})})}(jQuery,this);var githubWidgetLoader={fetchGithubData:function(t,e){$.ajax({url:e,dataType:"jsonp",context:this,success:function(e){var i=e.meta;switch(i.status){case 301:return void this.fetchGithubData(t,i.Location);case 403:return void console.error("Github: "+e.data.message);case 404:return void $(t).text("Repo not found. Make sure the repo is public!")}var o=e.data,r=new Date(o.pushed_at),n=r.getMonth()+1+"-"+r.getDate()+"-"+r.getFullYear(),a=$('

'+o.owner.login+' / '+o.name+'

'+(null!=o.description?o.description:"No description")+' \u2014 Read More

Latest commit to the master branch on '+n+'

Download as zip
');null!=o.homepage&&(homepage=0!=o.homepage.indexOf("http")?"http://"+o.homepage:o.homepage,$(".github-homepage",a).html($(''+o.homepage+""))),t.replaceWith(a)}})},a:0,initializeGithubWidget:function(t){0==this.a&&$("head").append(''),this.a++;var e=$(t),i=e.data("repo"),o="https://api.github.com/repos/"+i;this.fetchGithubData(e,o)}};$(".github-widget").each(function(){githubWidgetLoader.initializeGithubWidget(this)}),/*! * clipboard.js v1.5.3 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){return function t(e,i,o){function r(a,s){if(!i[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(n)return n(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[a]={exports:{}};e[a][0].call(d.exports,function(t){var i=e[a][1][t];return r(i||t)},d,d.exports,t,e,i,o)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;athis.lastScrollTop?(this.bar.is(":visible")&&this.bar.slideUp(),this.lastScrollTop=t):t+80 pre").each(function(t,e){window.hljs.highlightBlock(e)}),new Clipboard(".project-code-widget .copy-code",{target:function(t){return $(t).closest(".preview-pane").find("pre")[0]}}).on("success",function(t){var e=$(t.trigger);e.tooltip("destroy"),e.attr("title","Copied!"),e.tooltip({trigger:"manual"}).tooltip("show"),window.setTimeout(function(){e.tooltip("destroy"),e.attr("title","Copy the code")},1500),e.blur(),t.clearSelection()}).on("error",function(t){var e=$(t.trigger),i=e.parent();e.tooltip("hide"),i.tooltip({title:"Press CTRL+C to copy",trigger:"manual",placement:"top",container:"body"}).tooltip("show"),window.setTimeout(function(){i.tooltip("destroy")},1500),e.blur()}),$(".project-code-widget .tabs a").on("click",function(){$(this).closest(".project-code-widget").find(".tabs li, .preview-pane").removeClass("active"),$(this).parent().addClass("active");var t=$($(this).data("target"));t.addClass("active"),setPreviewPaneHeight(t)});var t=$(".project-code-widget");if(t.length)if(t.hasClass("single-file")&&t.hasClass("no-preview")){var e=t.find(".header");t.css("height",e.outerHeight()+"px"),affixer.init()}else t.find(".preview-pane").length&&setPreviewPaneHeight(t.find(".preview-pane").first());!function(){if(window.frameElement){var t=function(t){var e=t.getBoundingClientRect();window.parent.postMessage({source:"hster-project-iframe",payload:{main:{height:e.height}}},"*")},e=document.querySelector(".project-page");e&&($(e).resize(function(){t(e)}),t(e))}}()}); //# sourceMappingURL=/assets/projects/page-cd773f31a4a4a368cad2204e9d270a800c93c2015efba7d22698d0c064255a8a.js.map