mirror of
https://github.com/actix/actix-website
synced 2024-11-27 18:12:57 +01:00
11 lines
42 KiB
JavaScript
11 lines
42 KiB
JavaScript
|
/*!
|
||
|
* Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||
|
* file at the top-level directory of this distribution and at
|
||
|
* http://rust-lang.org/COPYRIGHT.
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||
|
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||
|
* option. This file may not be copied, modified, or distributed
|
||
|
* except according to those terms.
|
||
|
*/(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword"];var search_input=document.getElementsByClassName('search-input')[0];var currentTab=0;var themesWidth=null;if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position;};}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1;};}function getPageId(){var id=document.location.href.split('#')[1];if(id){return id.split('?')[0].split('&')[0];}return null;}function hasClass(elem,className){if(elem&&className&&elem.className){var elemClass=elem.className;var start=elemClass.indexOf(className);if(start===-1){return false;}else if(elemClass.length===className.length){return true;}else{if(start>0&&elemClass[start-1]!==' '){return false;}var end=start+className.length;return!(end<elemClass.length&&elemClass[end]!==' ');}if(start>0&&elemClass[start-1]!==' '){return false;}var end=start+className.length;return!(end<elemClass.length&&elemClass[end]!==' ');}return false;}function addClass(elem,className){if(elem&&className&&!hasClass(elem,className)){if(elem.className&&elem.className.length>0){elem.className+=' '+className;}else{elem.className=className;}}}function removeClass(elem,className){if(elem&&className&&elem.className){elem.className=(" "+elem.className+" ").replace(" "+className+" "," ").trim();}}function isHidden(elem){return(elem.offsetParent===null)}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it");}var sidebar=document.getElementsByClassName('sidebar')[0];if(sidebar){addClass(sidebar,'mobile');var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div);}}var themePicker=document.getElementsByClassName("theme-picker");if(themePicker&&themePicker.length>0){themePicker[0].style.display="none";}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it");}var sidebar=document.getElementsByClassName('sidebar')[0];removeClass(sidebar,'mobile');var filler=document.getElementById("sidebar-filler");if(filler){filler.remove();}document.getElementsByTagName("body")[0].style.marginTop='';var themePicker=document.getElementsByClassName("theme-picker");if(themePicker&&themePicker.length>0){themePicker[0].style.display=null;}}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");onEach(document.getElementsByClassName('js-only'),function(e){removeClass(e,'js-only');});function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1]);});return params;}function browserSupportsHistoryApi(){return document.location.protocol!="file:"&&window.history&&typeof window.history.pushState==="function";}function highlightSourceLines(ev){hideSidebar();var search=document.getElementById("search");var i,from,to,match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(match){from=parseInt(match[1],10);to=Math.min(50000,parseInt(match[2]||match[1],10));from=Math.min(from,to);var elem=document.getElementById(from);if(!elem){return;}if(ev===null){var x=document.getElementById(from);if(x){x.scrollIntoView();}}onEach(document.getElementsByClassName('line-numbers'),function(e){onEach(e.getElementsByTagName('span'),function(i_e){removeClass(i_e,'line-highlighted');});});for(i=from;i<=to;++i){addClass(document.getElementById(i),'line-highlighted');}}else if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){addClass(search,"hidden");removeClass(document.getElement
|