-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathscripts.min.js
More file actions
1 lines (1 loc) · 4.61 KB
/
scripts.min.js
File metadata and controls
1 lines (1 loc) · 4.61 KB
1
!function(p){p.fn.toc=function(t){var e,l=this,c=p.extend({},jQuery.fn.toc.defaults,t),t=p(c.container),a=p(c.selectors,t),i=[],s=c.prefix+"-active",h=function(t){for(var e=0,a=arguments.length;e<a;e++){var o=p(arguments[e]);if(0<o.scrollTop())return o;o.scrollTop(1);var n=0<o.scrollTop();if(o.scrollTop(0),n)return o}return[]}(c.container,"body","html"),t=function(t){e&&clearTimeout(e),e=setTimeout(function(){for(var t,e=p(window).scrollTop(),a=0,o=i.length;a<o;a++)if(i[a]>=e){p("li",l).removeClass(s),t=p("li:eq("+(a-1)+")",l).addClass(s),c.onHighlight(t);break}},50)};return c.highlightOnScroll&&(p(window).bind("scroll",t),t()),this.each(function(){var n=p(this),r=p("<ul/>");a.each(function(t,e){var a=p(e);i.push(a.offset().top-c.highlightOffset);p("<span/>").attr("id",c.anchorName(t,e,c.prefix)).insertBefore(a);var o=p("<a/>").text(c.headerText(t,e,a)).attr("href","#"+c.anchorName(t,e,c.prefix)).bind("click",function(t){var e,a;e=t,c.smoothScrolling&&(e.preventDefault(),a=p(e.target).attr("href"),t=p(a),h.animate({scrollTop:t.offset().top},400,"swing",function(){location.hash=a})),p("li",l).removeClass(s),p(e.target).parent().addClass(s),n.trigger("selected",p(this).attr("href"))}),o=p("<li/>").addClass(c.itemClass(t,e,a,c.prefix)).append(o);r.append(o)}),n.html(r)})},jQuery.fn.toc.defaults={container:"body",selectors:"h1,h2,h3",smoothScrolling:!0,prefix:"toc",onHighlight:function(){},highlightOnScroll:!0,highlightOffset:100,anchorName:function(t,e,a){return a+t},headerText:function(t,e,a){return a.text()},itemClass:function(t,e,a,o){return o+"-"+a[0].tagName.toLowerCase()}}}(jQuery),$(document).ready(function(){$.ajax({type:"GET",url:"https://api.github.com/repos/Codeception/Codeception/contributors",dataType:"jsonp",success:function(t,e){$.each(t.data,function(t,e){var a='<img src="'+e.avatar_url+'" width="48" height="48" alt="'+e.login+'">',o=$(document.createElement("a"));o.attr("href","https://github.com/"+e.login),o.attr("target","_blank"),o.attr("rel","tooltip"),o.attr("title",e.login),o.html(a),$("#contributors").append(o)}),$("#contributors").append('<p style="clear: both">Join us, fork Codeception and submit your pull requests!</p>')}}),$("#scroll-to-top").click(function(){return $("html, body").animate({scrollTop:0},400),!1}),$(window).scroll(function(){300<$(window).scrollTop()?$("#scroll-to-top").fadeIn("slow"):$("#scroll-to-top").fadeOut("slow")})}),$(document).ready(function(){function t(t){var e=$(t+" .item").length,a=Math.floor(Math.random()*e);$(t+" .item").each(function(t){t==a?$(this).addClass("active"):$(this).removeClass("active")})}t("#carousel-tweets"),t("#carousel-companies");var e=$("#toc");e.length&&e.toc({selectors:"h2",prefix:"toc",container:"#page",anchorName:function(t,e,a){return $(e).text().replace(/\s/g,"-").replace(/[^\w-]/g,"")}});var a=$("#page table"),o=$("#toc"),n=$("#toc > ul"),r=$("#toc ul.list li a");a.length&&a.addClass("table table-striped table-bordered"),o.length&&o.toc({selectors:"h2,h3,h4",prefix:"toc",container:"#page",anchorName:function(t,e,a){return $(e).text().replace(/\s/g,"-").replace(/[^\w-]/g,"")}}),n.length&&n.addClass("list"),r.length&&r.addClass("searchitem");var l={valueNames:["searchitem"]},c=(new List("searchable",l),$(".navbar-toggle"));function t(t){var e=$(t+" .item").length,a=Math.floor(Math.random()*e);$(t+" .item").each(function(t){t==a?$(this).addClass("active"):$(this).removeClass("active")})}c.length&&c.click(function(){$(".row.home").toggleClass("no-padding-top")}),t("#carousel-tweets"),t("#carousel-companies"),(e=$("#toc")).length&&e.toc({selectors:"h2",prefix:"toc",container:"#page",anchorName:function(t,e,a){return $(e).text().replace(/\s/g,"-").replace(/[^\w-]/g,"")}});var i=$(".cp:contains('<?php')"),e=$(".cp:contains('?>')"),a=$("#page table"),o=$("#toc"),n=$("#toc > ul"),r=$("#toc ul.list li a");i.length&&i.css({visibility:"hidden"}),e.length&&e.css({visibility:"hidden"}),a.length&&a.addClass("table table-striped table-bordered"),o.length&&o.toc({selectors:"h2,h3,h4",prefix:"toc",container:"#page",anchorName:function(t,e,a){return $(e).text().replace(/\s/g,"-").replace(/[^\w-]/g,"")}}),n.length&&n.addClass("list"),r.length&&r.addClass("searchitem");l={valueNames:["searchitem"]},new List("searchable",l);(c=$(".navbar-toggle")).length&&c.click(function(){$(".row.home").toggleClass("no-padding-top")})});var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-1899308-9"]),_gaq.push(["_trackPageview"]),function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)}();