/*! * jQuery Smooth Scroll - v1.6.0 - 2015-12-26 * https://github.com/kswedberg/jquery-smooth-scroll * Copyright (c) 2015 Karl Swedberg * Licensed MIT */ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){function e(t){return t.replace(/(:|\.|\/)/g,"\\$1")}var o={},l=function(e){var o=[],l=!1,s=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[s]()>0?o.push(this):(e[s](1),l=e[s]()>0,l&&o.push(this),e[s](0))):(o.push(document.scrollingElement),!1)}),o.length||this.each(function(){"BODY"===this.nodeName&&(o=[this])}),"first"===e.el&&o.length>1&&(o=[o[0]]),o};t.fn.extend({scrollable:function(t){var e=l.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=l.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(o,l){if("options"===(o=o||{}))return l?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},l);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var s=t.extend({},t.fn.smoothScroll.defaults,o),n=function(o){var l=this,n=t(this),i=t.extend({},s,n.data("ssOpts")||{}),c=s.exclude,a=i.excludeWithin,r=0,h=0,u=!0,d={},p=t.smoothScroll.filterPath(location.pathname),f=t.smoothScroll.filterPath(l.pathname),m=location.hostname===l.hostname||!l.hostname,g=i.scrollTarget||f===p,_=e(l.hash);if(i.scrollTarget||m&&g&&_){for(;u&&r1&&"[object Object]"!==String(e)){if(o=jQuery.extend({},o),null==e&&(o.expires=-1),"number"==typeof o.expires){var l=o.expires,s=o.expires=new Date;s.setDate(s.getDate()+l)}return e=String(e),document.cookie=[encodeURIComponent(t),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}var n,i=(o=e||{}).raw?function(t){return t}:decodeURIComponent;return(n=new RegExp("(?:^|; )"+encodeURIComponent(t)+"=([^;]*)").exec(document.cookie))?i(n[1]):null},jQuery(document).ready(function(t){if("undefined"!=typeof tocplus){if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1==tocplus.smooth_scroll){var e=hostname=pathname=qs=hash=null;t(document).on("click","#toc_container a, ul.toc_widget_list a",function(o){if(hostname=t(this).prop("hostname"),pathname=t(this).prop("pathname"),qs=t(this).prop("search"),hash=t(this).prop("hash"),pathname.length>0&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash){var l=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1");t(l).length>0?e=hash:(anchor=hash,anchor=anchor.replace("#",""),e='a[name="'+anchor+'"]',0==t(e).length&&(e="")),void 0!==tocplus.smooth_scroll_offset?offset=-1*tocplus.smooth_scroll_offset:t("#wpadminbar").length>0&&t("#wpadminbar").is(":visible")?offset=-30:offset=0,e&&t.smoothScroll({scrollTarget:e,offset:offset})}})}if(void 0!==tocplus.visibility_show){var o,l=void 0!==tocplus.visibility_hide_by_default,s=!!t.cookie&&!!t.cookie("tocplus_hidetoc"),n=l?!s:s,i=void 0!==tocplus.toggle_style?tocplus.toggle_style:"brackets",c=n?tocplus.visibility_show:tocplus.visibility_hide;o=t("").addClass("toc_toggle"),"brackets"===i?o.addClass("toc_toggle_brackets").append(t("").addClass("toc_brackets").text("[")).append(t("").attr("href","#").text(c)).append(t("").addClass("toc_brackets").text("]")):o.addClass("toc_toggle_icon").addClass("toc_toggle_"+i).append(t("").attr("href","#").attr({role:"button","aria-label":c}).append(t("").addClass("toc_toggle_indicator").attr("aria-hidden","true"))),t("#toc_container .toc_title").append(document.createTextNode(" ")).append(o),n&&(t("ul.toc_list").hide(),t("#toc_container").addClass("contracted").shrinkTOCWidth()),t("span.toc_toggle a").click(function(e){e.preventDefault();var o,s=!t("#toc_container").hasClass("contracted"),n=s?tocplus.visibility_show:tocplus.visibility_hide;"brackets"===i?t(this).text(n):t(this).attr("aria-label",n),o=s,t.cookie&&(t.cookie("tocplus_hidetoc",null,{path:"/"}),o!=l?t.cookie("tocplus_hidetoc","1",{expires:30,path:window.location.pathname}):t.cookie("tocplus_hidetoc",null,{path:window.location.pathname})),s?(t("ul.toc_list").hide("fast"),t("#toc_container").addClass("contracted").shrinkTOCWidth()):(t("#toc_container").css("width",tocplus.width).removeClass("contracted"),t("ul.toc_list").show("fast"))})}}});