forked from rspec/rspec.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
1 lines (1 loc) · 5.97 KB
/
app.js
1
!function(){function t(){$(".method_details_list .source_code").before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>"),$(".toggleSource").toggle(function(){$(this).parent().nextAll(".source_code").slideDown(100),$(this).text("Hide source")},function(){$(this).parent().nextAll(".source_code").slideUp(100),$(this).text("View source")})}function e(){var t=0;$(".defines").after(" <a href='#' class='toggleDefines'>more...</a>"),$(".toggleDefines").toggle(function(){t=$(this).parent().prev().height(),$(this).prev().css("display","inline"),$(this).parent().prev().height($(this).parent().height()),$(this).text("(less)")},function(){$(this).prev().hide(),$(this).parent().prev().height(t),$(this).text("more...")})}function s(){var t=0;$(".inheritanceTree").toggle(function(){t=$(this).parent().prev().height(),$(this).parent().toggleClass("showAll"),$(this).text("(hide)"),$(this).parent().prev().height($(this).parent().height())},function(){$(this).parent().toggleClass("showAll"),$(this).parent().prev().height(t),$(this).text("show all")})}function n(){$(".full_list_link").click(function(){return i(this,$(this).attr("href")),!1}),window.addEventListener("message",function(t){"navEscape"===t.data&&($("#nav").slideUp(100),$("#search a").removeClass("active inactive"),$(window).focus())}),$(window).resize(function(){0===$("#search:visible").length&&($("#nav").removeAttr("style"),$("#search a").removeClass("active inactive"),$(window).focus())})}function i(t,e){var s=$("#nav");$("#search a").removeClass("active").addClass("inactive"),s.attr("src")===e&&"none"!==s.css("display")?(s.slideUp(100),$("#search a").removeClass("active inactive")):($(t).addClass("active").removeClass("inactive"),s.attr("src")!==e&&s.attr("src",e),s.slideDown(100))}function a(){$(".summary_signature").click(function(){document.location=$(this).find("a").attr("href")})}function o(){$(".summary_toggle").click(function(t){return t.preventDefault(),m.summaryCollapsed=$(this).text(),$(".summary_toggle").each(function(){$(this).text("collapse"==$(this).text()?"expand":"collapse");var t=$(this).parent().parent().nextAll("ul.summary").first();if(t.hasClass("compact"))t.toggle(),t.nextAll("ul.summary").first().toggle();else if(t.hasClass("summary")){var e=$('<ul class="summary compact" />');e.html(t.html()),e.find(".summary_desc, .note").remove(),e.find("a").each(function(){$(this).html($(this).find("strong").html()),$(this).parent().html($(this)[0].outerHTML)}),t.before(e),t.toggle()}}),!1}),"collapse"==m.summaryCollapsed?$(".summary_toggle").first().click():m.summaryCollapsed="expand"}function l(){$(".constants_summary_toggle").click(function(t){return t.preventDefault(),m.summaryCollapsed=$(this).text(),$(".constants_summary_toggle").each(function(){$(this).text("collapse"==$(this).text()?"expand":"collapse");var t=$(this).parent().parent().nextAll("dl.constants").first();if(t.hasClass("compact"))t.toggle(),t.nextAll("dl.constants").first().toggle();else if(t.hasClass("constants")){var e=$('<dl class="constants compact" />');e.html(t.html()),e.find("dt").each(function(){$(this).addClass("summary_signature"),$(this).text($(this).text().split("=")[0]),$(this).has(".deprecated").length&&$(this).addClass("deprecated")}),e.find("pre.code").each(function(){console.log($(this).parent());var t=$(this).parent().prev(),e=$(this).text();t.hasClass("deprecated")&&(e="Deprecated. "+e),t.attr("title",e)}),e.find(".docstring, .tags, dd").remove(),t.before(e),t.toggle()}}),!1}),"collapse"==m.summaryCollapsed?$(".constants_summary_toggle").first().click():m.summaryCollapsed="expand"}function r(){if(0!==$("#filecontents").length){var t,e,s=$('<ol class="top"></ol>'),n=!1,i=s,a=0,o=["h2","h3","h4","h5","h6"];for($("#filecontents h1").length>1&&o.unshift("h1"),t=0;t<o.length;t++)o[t]="#filecontents "+o[t];var l=parseInt(o[0][1],10);$(o.join(", ")).each(function(){if(0==$(this).parents(".method_details .docstring").length&&"filecontents"!=this.id){n=!0;var s=parseInt(this.tagName[1],10);if(0===this.id.length){var o=$(this).attr("toc-id");if(void 0!==o)this.id=o;else{var o=$(this).text().replace(/[^a-z0-9-]/gi,"_");$("#"+o).length>0&&(o+=a,a++),this.id=o}}if(s>l)for(t=0;t<s-l;t++)void 0===e&&(e=$("<li/>"),i.append(e)),i=$("<ol/>"),e.append(i),e=undefined;if(s<l)for(t=0;t<l-s;t++)i=i.parent(),i=i.parent();var r=$(this).attr("toc-title");void 0===r&&(r=$(this).text()),e=$('<li><a href="#'+this.id+'">'+r+"</a></li>"),i.append(e),l=s}}),n&&(html='<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>',$("#content").prepend(html),$("#toc").append(s),$("#toc .hide_toc").toggle(function(){$("#toc .top").slideUp("fast"),$("#toc").toggleClass("hidden"),$("#toc .title small").toggle()},function(){$("#toc .top").slideDown("fast"),$("#toc").toggleClass("hidden"),$("#toc .title small").toggle()}))}}function c(t){if(1!==t.which)return void h();v.navWidth=t.pageX.toString(),$(".nav_wrap").css("width",t.pageX),$(".nav_wrap").css("-ms-flex","inherit")}function h(){$(window).unbind("mousemove",c),window.removeEventListener("message",d,!1)}function d(t){"mousemove"===t.data.action&&c(t.data.event),"mouseup"===t.data.action&&h()}function u(){$("#resizer").mousedown(function(t){t.preventDefault(),$(window).mousemove(c),window.addEventListener("message",d,!1)}),$(window).mouseup(h),v.navWidth&&c({which:1,pageX:parseInt(v.navWidth,10)})}function f(){function t(){if(!e){clearTimeout(s);var t={action:"expand",path:pathId};document.getElementById("nav").contentWindow.postMessage(t,"*"),e=!0}}var e=!1,s=setTimeout(t,500);window.addEventListener("message",function(e){return"navReady"===e.data&&t(),!1},!1)}function p(){var t=window.location.hash;""!==t&&$(t)[0]&&$(t)[0].scrollIntoView(),setTimeout(function(){$("#main").focus()},10)}function g(){window.onpopstate=function(){var t=window.location.hash;""!==t&&$(t)[0]&&$(t)[0].scrollIntoView()}}var m={},v={};try{m=window.localStorage}catch(t){}try{v=window.sessionStorage}catch(t){}$(document).ready(function(){u(),f(),t(),e(),s(),n(),a(),o(),l(),r(),p(),g()})}();