From ee1147476f988a74fd89a784352643acae7f1e3f Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Mon, 6 Mar 2017 17:47:05 -0600 Subject: [PATCH] Fix toc scrollspy and desc for internal.md --- content/templates/internal.md | 2 +- pipeline/js/scripts/homepage.js | 69 +-------------------------------- pipeline/js/scripts/toc.js | 56 ++++++++++++++++++++++++++ static/js/script.min.js | 8 ++-- 4 files changed, 62 insertions(+), 73 deletions(-) create mode 100644 pipeline/js/scripts/toc.js diff --git a/content/templates/internal.md b/content/templates/internal.md index b17a4c630..425e00e9a 100644 --- a/content/templates/internal.md +++ b/content/templates/internal.md @@ -1,7 +1,7 @@ --- title: Internal Templates linktitle: Internal Templates -description: Hugo ships with a series of internal templates to +description: Hugo ships with internal boilerplate templates that cover the most common use cases for static websites. date: 2017-03-06 publishdate: 2017-03-06 lastmod: 2017-03-06 diff --git a/pipeline/js/scripts/homepage.js b/pipeline/js/scripts/homepage.js index 39bb1ae41..fce43b94f 100644 --- a/pipeline/js/scripts/homepage.js +++ b/pipeline/js/scripts/homepage.js @@ -46,71 +46,4 @@ $(document).ready(function() { // else if (scroll > offset3) }); } -}); - -// var mySequence = [ -// { e: $element1, p: { translateX: 100 }, o: { duration: 1000 } }, -// /* The call below will run at the same time as the first call. */ -// { e: $element2, p: { translateX: 200 }, o: { duration: 1000, sequenceQueue: false }, -// /* As normal, the call below will run once the second call is complete. */ -// { e: $element3, p: { translateX: 300 }, o: { duration: 1000 } -// ]; -// $.Velocity.RunSequence(mySequence); - - - -// terminalElements = document.querySelectorAll('span.terminal-line'); - -// function terminals_init() { -// var elements = terminalElements; -// for (var i = 0; i < elements.length; i++) { -// var e = elements[i] -// e.completeHTML = e.innerHTML -// e.innerHTML = "" -// e.i = 0 -// } - -// } - -// function terminals_start() { -// //terminalIntervalFunction = function(){ terminals_next() } -// // setInterval(terminalIntervalFunction, 1000/60); -// terminals_next() -// } - -// function terminals_next() { -// var done = true -// var elements = terminalElements; - -// for (var i = 0; i < elements.length && done == true; i++) { -// var e = elements[i] - -// e.i++ - -// if (e.innerHTML.length >= e.completeHTML.length) { -// e.innerHTML = e.completeHTML -// } else { -// var s = e.completeHTML.substring(0, e.i) - -// if (s.slice(-1) == " ") { -// if (e.innerHTML.length % 6 == 0) { s = s + "" } else { s = s + "|" } -// } else { -// s = s + "|" -// } - -// e.innerHTML = s -// e.parentNode.style.display = 'none' -// e.parentNode.style.display = 'block' -// done = false -// } -// } - -// if (!done) { -// //window.clearInterval(terminalIntervalFunction) -// setTimeout(terminals_next, 1600 / 15) -// } -// } - -// terminals_init() - -// window.onload = function() { terminals_start() }; +}); \ No newline at end of file diff --git a/pipeline/js/scripts/toc.js b/pipeline/js/scripts/toc.js new file mode 100644 index 000000000..f12a1339f --- /dev/null +++ b/pipeline/js/scripts/toc.js @@ -0,0 +1,56 @@ +//IIFE to remove all third-level li's from TOC so as not to negatively affect scrollspy (these are currently hidden anyway) +(function() { + let toc = document.getElementById('toc') ? true : false; + if (toc) { + let levelFours = document.querySelectorAll('#TableOfContents > ul > li > ul > li > ul > li > ul'); + if (levelFours) { + for (var i = 0; i < levelFours.length; i++) { + levelFours[i].remove(); + } + } + } +})(); + +$(document).ready(function() { + // Cache selectors + var lastId, + tocNav = $("#TableOfContents"), + tocNavHeight = tocNav.outerHeight() + 15, + headerHeight = $('#site-header').height(), + // All list items + menuItems = tocNav.find("a"), + // Anchors corresponding to menu items + scrollItems = menuItems.map(function() { + var item = $($(this).attr("href")); + if (item.length) { + return item; + } + }); + // Bind to scroll + $(window).scroll(function(evt) { + evt.preventDefault(); + var isBottom = $(window).scrollTop() + $(window).height() == $(document).height(); + // Get container scroll position + var fromTop = $(this).scrollTop() + headerHeight + 100; + // Get id of current scroll item + var cur = scrollItems.map(function() { + if ($(this).offset().top < fromTop) + return this; + }); + // Get the id of the current element + cur = cur[cur.length - 1]; + var id = cur && cur.length ? cur[0].id : ""; + if (lastId !== id) { + lastId = id; + // Set/remove active class + menuItems.parent().removeClass("active").end().filter("[href='#" + id + "']").parent().addClass("active"); + history.replaceState({}, "", menuItems.filter("[href='#" + id + "']").attr("href")); + } + if (isBottom) { + menuItems.parent().removeClass('active'); + if (menuItems.last().parent().attr('class') !== 'active') { + menuItems.last().parent().addClass('active'); + } + } + }); +}); diff --git a/static/js/script.min.js b/static/js/script.min.js index 810ede384..09308a2fd 100644 --- a/static/js/script.min.js +++ b/static/js/script.min.js @@ -1,4 +1,4 @@ -"use strict";function showTooltip(e,t){e.setAttribute("class","copy-button tooltipped tooltipped-s"),e.setAttribute("aria-label",t)}function fallbackMessage(e){var t="",r="cut"===e?"X":"C";return t=isMac?"Press ⌘-"+r:"Press Ctrl-"+r}function toggleToc(e){e.preventDefault(),e.stopPropagation(),console.log("hello"),document.getElementById("toc").classList.toggle("toc-open"),document.getElementById("toc-toggle").classList.toggle("toc-open")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){if("object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Clipboard=e()}}(function(){var e;return function t(e,r,n){function a(i,s){if(!r[i]){if(!e[i]){var l="function"==typeof require&&require;if(!s&&l)return l(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return a(r?r:t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;in;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],a=[];if(n&&t)for(var o=0,i=n.length;i>o;o++)n[o].fn!==t&&n[o].fn._!==t&&a.push(n[o]);return a.length?r[e]=a:delete r[e],this}},t.exports=n},{}],8:[function(t,r,n){!function(a,o){if("function"==typeof e&&e.amd)e(["module","select"],o);else if("undefined"!=typeof n)o(r,t("select"));else{var i={exports:{}};o(i,a.select),a.clipboardAction=i.exports}}(this,function(e,t){function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=r(t),o="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":_typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":"undefined"==typeof e?"undefined":_typeof(e)},i=function(){function e(e,t){for(var r=0;r0&&t-1 in e)}if(!e.jQuery){var r=function c(e,t){return new c.fn.init(e,t)};r.isWindow=function(e){return e&&e===e.window},r.type=function(e){return e?"object"==("undefined"==typeof e?"undefined":_typeof(e))||"function"==typeof e?a[i.call(e)]||"object":"undefined"==typeof e?"undefined":_typeof(e):e+""},r.isArray=Array.isArray||function(e){return"array"===r.type(e)},r.isPlainObject=function(e){var t;if(!e||"object"!==r.type(e)||e.nodeType||r.isWindow(e))return!1;try{if(e.constructor&&!o.call(e,"constructor")&&!o.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(t in e);return void 0===t||o.call(e,t)},r.each=function(e,r,n){var a,o=0,i=e.length,s=t(e);if(n){if(s)for(;o0?a=i:r=i;while(Math.abs(o)>b&&++s=h?u(t,s):0===l?s:d(t,r,r+w)}function g(){k=!0,e===r&&n===a||f()}var m=4,h=.001,b=1e-7,y=10,v=11,w=1/(v-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var x=0;x<4;++x)if("number"!=typeof arguments[x]||isNaN(arguments[x])||!isFinite(arguments[x]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var C=S?new Float32Array(v):new Array(v),k=!1,N=function(t){return k||g(),e===r&&n===a?t:0===t?0:1===t?1:l(p(t),r,a)};N.getControlPoints=function(){return[{x:e,y:r},{x:n,y:a}]};var P="generateBezier("+[e,r,n,a]+")";return N.toString=function(){return P},N}function c(e,t){var r=e;return m.isString(e)?v.Easings[e]||(r=!1):r=m.isArray(e)&&1===e.length?s.apply(null,e):m.isArray(e)&&2===e.length?w.apply(null,e.concat([t])):!(!m.isArray(e)||4!==e.length)&&l.apply(null,e),r===!1&&(r=v.Easings[v.defaults.easing]?v.defaults.easing:y),r}function u(e){if(e){var t=(new Date).getTime(),r=v.State.calls.length;r>1e4&&(v.State.calls=a(v.State.calls),r=v.State.calls.length);for(var o=0;o4;e--){var t=r.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e}return n}(),g=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r,n=(new Date).getTime();return r=Math.max(0,16-(n-e)),e=n+r,setTimeout(function(){t(n+r)},r)}}(),m={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==("undefined"==typeof e?"undefined":_typeof(e))&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==n&&(0===e.length||"object"==_typeof(e[0])&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},h=!1;if(e.fn&&e.fn.jquery?(d=e,h=!0):d=t.Velocity.Utilities,p<=8&&!h)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(p<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var b=400,y="swing",v={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:d,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:b,easing:y,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){d.data(e,"velocity",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:3,patch:0},debug:!1};t.pageYOffset!==n?(v.State.scrollAnchor=t,v.State.scrollPropertyLeft="pageXOffset",v.State.scrollPropertyTop="pageYOffset"):(v.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,v.State.scrollPropertyLeft="scrollLeft",v.State.scrollPropertyTop="scrollTop");var w=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,n){var a={x:t.x+n.dx*r,v:t.v+n.dv*r,tension:t.tension,friction:t.friction};return{dx:a.v,dv:e(a)}}function r(r,n){var a={dx:r.v,dv:e(r)},o=t(r,.5*n,a),i=t(r,.5*n,o),s=t(r,n,i),l=1/6*(a.dx+2*(o.dx+i.dx)+s.dx),c=1/6*(a.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*n,r.v=r.v+c*n,r}return function n(e,t,a){var o,i,s,l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,f=1e-4,d=.016;for(e=parseFloat(e)||500,t=parseFloat(t)||20,a=a||null,l.tension=e,l.friction=t,o=null!==a,o?(u=n(e,t),i=u/a*d):i=d;s=r(s||l,i),c.push(1+s.x),u+=16,Math.abs(s.x)>f&&Math.abs(s.v)>f;);return o?function(e){return c[e*(c.length-1)|0]}:u}}();v.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},d.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){v.Easings[t[0]]=l.apply(null,t[1])});var S=v.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){p&&!(p>9)||v.State.isGingerbread||(S.Lists.transformsBase=S.Lists.transformsBase.concat(S.Lists.transforms3D));for(var e=0;e8)&&3===o.split(" ").length&&(o+=" 1"),o;case"inject":return p<=8?4===a.split(" ").length&&(a=a.split(/\s+/).slice(0,3).join(" ")):3===a.split(" ").length&&(a+=" 1"),(p<=8?"rgb":"rgba")+"("+a.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(p||v.State.isAndroid&&!v.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(v.State.prefixMatches[e])return[v.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,n=t.length;r=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,n,a,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=n:"Left"===o.direction?t.scrollTo(n,o.alternateValue):t.scrollTo(o.alternateValue,n);else if(S.Normalizations.registered[r]&&"transform"===S.Normalizations.registered[r]("name",e))S.Normalizations.registered[r]("inject",e,n),s="transform",n=i(e).transformCache[r];else{if(S.Hooks.registered[r]){var l=r,c=S.Hooks.getRoot(r);a=a||S.getPropertyValue(e,c),n=S.Hooks.injectValue(l,n,a),r=c}if(S.Normalizations.registered[r]&&(n=S.Normalizations.registered[r]("inject",e,n),r=S.Normalizations.registered[r]("name",e)),s=S.Names.prefixCheck(r)[0],p<=8)try{e.style[s]=n}catch(u){v.debug&&console.log("Browser does not support ["+n+"] for ["+s+"]")}else{var f=i(e);f&&f.isSVG&&S.Names.SVGAttribute(r)?e.setAttribute(r,n):e.style[s]=n}v.debug>=2&&console.log("Set "+r+" ("+s+"): "+n)}return[s,n]},flushTransformCache:function(e){var t="",r=i(e);if((p||v.State.isAndroid&&!v.State.isChrome)&&r&&r.isSVG){var n=function(t){return parseFloat(S.getPropertyValue(e,t))},a={translate:[n("translateX"),n("translateY")],skewX:[n("skewX")],skewY:[n("skewY")],scale:1!==n("scale")?[n("scale"),n("scale")]:[n("scaleX"),n("scaleY")],rotate:[n("rotateZ"),0,0]};d.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(t+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var o,s;d.each(i(e).transformCache,function(r){return o=i(e).transformCache[r],"transformPerspective"===r?(s=o,!0):(9===p&&"rotateZ"===r&&(r="rotate"),void(t+=r+o+" "))}),s&&(t="perspective"+s+" "+t)}S.setPropertyValue(e,"transform",t)}};S.Hooks.register(),S.Normalizations.register(),v.hook=function(e,t,r){var a;return e=o(e),d.each(e,function(e,o){if(i(o)===n&&v.init(o),r===n)a===n&&(a=v.CSS.getPropertyValue(o,t));else{var s=v.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&v.CSS.flushTransformCache(o),a=s}}),a};var x=function k(){function e(){return l?T.promise||null:p}function a(e,a){function o(o){var p,g;if(l.begin&&0===N)try{l.begin.call(h,h)}catch(b){setTimeout(function(){throw b},1)}if("scroll"===O){var x,k,P,E=/^x$/i.test(l.axis)?"Left":"Top",I=parseFloat(l.offset)||0;l.container?m.isWrapped(l.container)||m.isNode(l.container)?(l.container=l.container[0]||l.container,x=l.container["scroll"+E],P=x+d(e).position()[E.toLowerCase()]+I):l.container=null:(x=v.State.scrollAnchor[v.State["scrollProperty"+E]],k=v.State.scrollAnchor[v.State["scrollProperty"+("Left"===E?"Top":"Left")]],P=d(e).offset()[E.toLowerCase()]+I),f={scroll:{rootPropertyValue:!1,startValue:x,currentValue:x,endValue:P,unitType:"",easing:l.easing,scrollData:{container:l.container,direction:E,alternateValue:k}},element:e},v.debug&&console.log("tweensContainer (scroll): ",f.scroll,e)}else if("reverse"===O){if(p=i(e),!p)return;if(!p.tweensContainer)return void d.dequeue(e,l.queue);"none"===p.opts.display&&(p.opts.display="auto"),"hidden"===p.opts.visibility&&(p.opts.visibility="visible"),p.opts.loop=!1,p.opts.begin=null,p.opts.complete=null,w.easing||delete l.easing,w.duration||delete l.duration,l=d.extend({},p.opts,l),g=d.extend(!0,{},p?p.tweensContainer:null);for(var M in g)if("element"!==M){var A=g[M].startValue;g[M].startValue=g[M].currentValue=g[M].endValue,g[M].endValue=A,m.isEmptyObject(w)||(g[M].easing=l.easing),v.debug&&console.log("reverse tweensContainer ("+M+"): "+JSON.stringify(g[M]),e)}f=g}else if("start"===O){p=i(e),p&&p.tweensContainer&&p.isAnimating===!0&&(g=p.tweensContainer);var R=function(t,r){var o,i,s;return m.isArray(t)?(o=t[0],!m.isArray(t[1])&&/^[\d-]/.test(t[1])||m.isFunction(t[1])||S.RegEx.isHex.test(t[1])?s=t[1]:(m.isString(t[1])&&!S.RegEx.isHex.test(t[1])||m.isArray(t[1]))&&(i=r?t[1]:c(t[1],l.duration),t[2]!==n&&(s=t[2]))):o=t,r||(i=i||l.easing),m.isFunction(o)&&(o=o.call(e,a,C)),m.isFunction(s)&&(s=s.call(e,a,C)),[o||0,i,s]};d.each(y,function(e,t){if(RegExp("^"+S.Lists.colors.join("$|^")+"$").test(S.Names.camelCase(e))){var r=R(t,!0),a=r[0],o=r[1],i=r[2];if(S.RegEx.isHex.test(a)){for(var s=["Red","Green","Blue"],l=S.Values.hexToRgb(a),c=i?S.Values.hexToRgb(i):n,u=0;u=1&&console.log("Unit ratios: "+JSON.stringify(s),e),s};if(/[\/*]/.test(W))_=H;else if(H!==_&&0!==F)if(0===j)_=H;else{s=s||q();var U=/margin|padding|left|right|width|text|word|letter/i.test($)||/X$/.test($)||"x"===$?"x":"y";switch(H){case"%":F*="x"===U?s.percentToPxWidth:s.percentToPxHeight;break;case"px":break;default:F*=s[H+"ToPx"]}switch(_){case"%":F*=1/("x"===U?s.percentToPxWidth:s.percentToPxHeight);break;case"px":break;default:F*=1/s[_+"ToPx"]}}switch(W){case"+":j=F+j;break;case"-":j=F-j;break;case"*":j=F*j;break;case"/":j=F/j}f[$]={rootPropertyValue:z,startValue:F,currentValue:F,endValue:j,unitType:_,easing:B},v.debug&&console.log("tweensContainer ("+$+"): "+JSON.stringify(f[$]),e)}else v.debug&&console.log("Skipping ["+X+"] due to a lack of browser support.")}f.element=e}f.element&&(S.Values.addClass(e,"velocity-animating"),L.push(f),p=i(e),p&&(""===l.queue&&(p.tweensContainer=f,p.opts=l),p.isAnimating=!0),N===C-1?(v.State.calls.push([L,h,l,null,T.resolver]),v.State.isTicking===!1&&(v.State.isTicking=!0,u())):N++)}var s,l=d.extend({},v.defaults,w),f={};switch(i(e)===n&&v.init(e),parseFloat(l.delay)&&l.queue!==!1&&d.queue(e,l.queue,function(t){v.velocityQueueEntryFlag=!0,i(e).delayTimer={setTimeout:setTimeout(t,parseFloat(l.delay)),next:t}}),l.duration.toString().toLowerCase()){case"fast":l.duration=200;break;case"normal":l.duration=b;break;case"slow":l.duration=600;break;default:l.duration=parseFloat(l.duration)||1}v.mock!==!1&&(v.mock===!0?l.duration=l.delay=1:(l.duration*=parseFloat(v.mock)||1,l.delay*=parseFloat(v.mock)||1)),l.easing=c(l.easing,l.duration),l.begin&&!m.isFunction(l.begin)&&(l.begin=null),l.progress&&!m.isFunction(l.progress)&&(l.progress=null),l.complete&&!m.isFunction(l.complete)&&(l.complete=null),l.display!==n&&null!==l.display&&(l.display=l.display.toString().toLowerCase(),"auto"===l.display&&(l.display=v.CSS.Values.getDisplayType(e))),l.visibility!==n&&null!==l.visibility&&(l.visibility=l.visibility.toString().toLowerCase()),l.mobileHA=l.mobileHA&&v.State.isMobile&&!v.State.isGingerbread,l.queue===!1?l.delay?setTimeout(o,l.delay):o():d.queue(e,l.queue,function(e,t){return t===!0?(T.promise&&T.resolver(h),!0):(v.velocityQueueEntryFlag=!0,void o(e))}),""!==l.queue&&"fx"!==l.queue||"inprogress"===d.queue(e)[0]||d.dequeue(e)}var s,l,p,g,h,y,w,x=arguments[0]&&(arguments[0].p||d.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties));if(m.isWrapped(this)?(l=!1,g=0,h=this,p=this):(l=!0,g=1,h=x?arguments[0].elements||arguments[0].e:arguments[0]),h=o(h)){x?(y=arguments[0].properties||arguments[0].p,w=arguments[0].options||arguments[0].o):(y=arguments[g],w=arguments[g+1]);var C=h.length,N=0;if(!/^(stop|finish|finishAll)$/i.test(y)&&!d.isPlainObject(w)){var P=g+1;w={};for(var E=P;EparseFloat(r[1]))}var o=e.Velocity;if(!o||!o.Utilities)return void(t.console&&console.log("Velocity UI Pack: Velocity must be loaded first. Aborting."));var i=o.Utilities,s=o.version,l={major:1,minor:1,patch:0};if(a(l,s)){var c="Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";throw alert(c),new Error(c)}o.RegisterEffect=o.RegisterUI=function(e,t){function r(e,t,r,n){var a,s=0;i.each(e.nodeType?[e]:e,function(e,t){n&&(r+=e*n),a=t.parentNode;var l=["height","paddingTop","paddingBottom","marginTop","marginBottom"];"border-box"===o.CSS.getPropertyValue(t,"boxSizing").toString().toLowerCase()&&(l=["height"]),i.each(l,function(e,r){s+=parseFloat(o.CSS.getPropertyValue(t,r))})}),o.animate(a,{height:("In"===t?"+":"-")+"="+s},{queue:!1,easing:"ease-in-out",duration:r*("In"===t?.6:1)})}return o.Redirects[e]=function(a,s,l,c,u,f,d){var p=l===c-1;d=d||t.loop,"function"==typeof t.defaultDuration?t.defaultDuration=t.defaultDuration.call(u,u):t.defaultDuration=parseFloat(t.defaultDuration);for(var g=0;g1&&(i.each(t.reverse(),function(e,r){var n=t[e+1];if(n){var a=r.o||r.options,s=n.o||n.options,l=a&&a.sequenceQueue===!1?"begin":"complete",c=s&&s[l],u={};u[l]=function(){var e=n.e||n.elements,t=e.nodeType?[e]:e;c&&c.call(t,t),o(r)},n.o?n.o=i.extend({},s,u):n.options=i.extend({},s,u)}}),t.reverse()),o(t[0])}}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)}),function(e,t,r,n){var a=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>0;e--){var t=r.createElement("div");if(t.innerHTML="",t.getElementsByTagName("span").length)return t=null,e;t=null}return n}(),o=t.console||{log:function(){},time:function(){}},i="blast",s={latinPunctuation:"–—′’'“″„\"(«.…¡¿′’'”″“\")».…!?",latinLetters:"\\u0041-\\u005A\\u0061-\\u007A\\u00C0-\\u017F\\u0100-\\u01FF\\u0180-\\u027F"},l={abbreviations:new RegExp("[^"+s.latinLetters+"](e\\.g\\.)|(i\\.e\\.)|(mr\\.)|(mrs\\.)|(ms\\.)|(dr\\.)|(prof\\.)|(esq\\.)|(sr\\.)|(jr\\.)[^"+s.latinLetters+"]","ig"),innerWordPeriod:new RegExp("["+s.latinLetters+"].["+s.latinLetters+"]","ig"),onlyContainsPunctuation:new RegExp("[^"+s.latinPunctuation+"]"),adjoinedPunctuation:new RegExp("^["+s.latinPunctuation+"]+|["+s.latinPunctuation+"]+$","g"),skippedElements:/(script|style|select|textarea)/i,hasPluginClass:new RegExp("(^| )"+i+"( |$)","gi")};e.fn[i]=function(c){function u(e){return e.replace(l.abbreviations,function(e){return e.replace(/\./g,"{{46}}")}).replace(l.innerWordPeriod,function(e){return e.replace(/\./g,"{{46}}")})}function f(e){return e.replace(/{{(\d{1,3})}}/g,function(e,t){return String.fromCharCode(t)})}function d(e,t){var n=r.createElement(t.tag);if(n.className=i,t.customClass&&(n.className+=" "+t.customClass,t.generateIndexID&&(n.id=t.customClass+"-"+b.blastedIndex)),"all"===t.delimiter&&/\s/.test(e.data)&&(n.style.whiteSpace="pre-line"),t.generateValueClass===!0&&!t.search&&("character"===t.delimiter||"word"===t.delimiter)){var a,o=e.data;"word"===t.delimiter&&l.onlyContainsPunctuation.test(o)&&(o=o.replace(l.adjoinedPunctuation,"")), -a=i+"-"+t.delimiter.toLowerCase()+"-"+o.toLowerCase(),n.className+=" "+a}return t.aria&&n.setAttribute("aria-hidden","true"),n.appendChild(e.cloneNode(!1)),n}function p(e,t){var r=-1,n=0;if(3===e.nodeType&&e.data.length){if(b.nodeBeginning&&(e.data=t.search||"sentence"!==t.delimiter?f(e.data):u(e.data),b.nodeBeginning=!1),r=e.data.search(m),r!==-1){var a=e.data.match(m),o=a[0],i=a[1]||!1;""===o?r++:i&&i!==o&&(r+=o.indexOf(i),o=i);var s=e.splitText(r);s.splitText(o.length),n=1,t.search||"sentence"!==t.delimiter||(s.data=f(s.data));var c=d(s,t,b.blastedIndex);s.parentNode.replaceChild(c,s),b.wrappers.push(c),b.blastedIndex++}}else if(1===e.nodeType&&e.hasChildNodes()&&!l.skippedElements.test(e.tagName)&&!l.hasPluginClass.test(e.className))for(var g=0;g'),$(".body-copy > h2:not(.section-heading),.body-copy > h3").each(function(){var e=$(this).attr("id");$(this).prepend('')})}),function(){for(var e=document.querySelectorAll("blockquote > p"),t=new RegExp(/\s\-\s/),r=0;r― '+a+""}}(),$(".download-button").on("click",function(){var e=$(this).siblings(".code-copy-content"),t=e.text(),r=e.attr("id"),n=new Blob([t],{type:"text/plain;charset=utf-8"});saveAs(n,r)});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){$(".body-copy img:not(.hugo-icon)").each(function(){$(this).wrap('')})}(),function(e){function t(e,r){if(!(this instanceof t)){var n=new t(e,r);return n.open(),n}this.id=t.id++,this.setup(e,r),this.chainCallbacks(t._callbackChain)}if("undefined"==typeof e)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var r=[],n=function(t){return r=e.grep(r,function(e){return e!==t&&e.$instance.closest("body").length>0})},a=function(e,t){var r={},n=new RegExp("^"+t+"([A-Z])(.*)");for(var a in e){var o=a.match(n);if(o){var i=(o[1]+o[2].replace(/([A-Z])/g,"-$1")).toLowerCase();r[i]=e[a]}}return r},o={keyup:"onKeyUp",resize:"onResize"},i=function(r){e.each(t.opened().reverse(),function(){if(!r.isDefaultPrevented()&&!1===this[o[r.type]](r))return r.preventDefault(),r.stopPropagation(),!1})},s=function(r){if(r!==t._globalHandlerInstalled){t._globalHandlerInstalled=r;var n=e.map(o,function(e,r){return r+"."+t.prototype.namespace}).join(" ");e(window)[r?"on":"off"](n,i)}};t.prototype={constructor:t,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"✕",loading:"",persist:!1,otherClose:null,beforeOpen:e.noop,beforeContent:e.noop,beforeClose:e.noop,afterOpen:e.noop,afterContent:e.noop,afterClose:e.noop,onKeyUp:e.noop,onResize:e.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(t,r){"object"!==("undefined"==typeof t?"undefined":_typeof(t))||t instanceof e!=!1||r||(r=t,t=void 0);var n=e.extend(this,r,{target:t}),a=n.resetCss?n.namespace+"-reset":n.namespace,o=e(n.background||['
','
','',n.closeIcon,"",'
'+n.loading+"
","
","
"].join("")),i="."+n.namespace+"-close"+(n.otherClose?","+n.otherClose:"");return n.$instance=o.clone().addClass(n.variant),n.$instance.on(n.closeTrigger+"."+n.namespace,function(t){var r=e(t.target);("background"===n.closeOnClick&&r.is("."+n.namespace)||"anywhere"===n.closeOnClick||r.closest(i).length)&&(n.close(t),t.preventDefault())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var t=this,r=this.constructor.contentFilters,n=function(e){return t.$currentTarget&&t.$currentTarget.attr(e)},a=n(t.targetAttr),o=t.target||a||"",i=r[t.type];if(!i&&o in r&&(i=r[o],o=t.target&&a),o=o||n("href")||"",!i)for(var s in r)t[s]&&(i=r[s],o=t[s]);if(!i){var l=o;if(o=null,e.each(t.contentFilters,function(){return i=r[this],i.test&&(o=i.test(l)),!o&&i.regex&&l.match&&l.match(i.regex)&&(o=l),!o}),!o)return"console"in window&&window.console.error("Featherlight: no content filter found "+(l?' for "'+l+'"':" (no target specified)")),!1}return i.process.call(t,o)},setContent:function(t){var r=this;return(t.is("iframe")||e("iframe",t).length>0)&&r.$instance.addClass(r.namespace+"-iframe"),r.$instance.removeClass(r.namespace+"-loading"),r.$instance.find("."+r.namespace+"-inner").not(t).slice(1).remove().end().replaceWith(e.contains(r.$instance[0],t[0])?"":t),r.$content=t.addClass(r.namespace+"-inner"),r},open:function(t){var n=this;if(n.$instance.hide().appendTo(n.root),!(t&&t.isDefaultPrevented()||n.beforeOpen(t)===!1)){t&&t.preventDefault();var a=n.getContent();if(a)return r.push(n),s(!0),n.$instance.fadeIn(n.openSpeed),n.beforeContent(t),e.when(a).always(function(e){n.setContent(e),n.afterContent(t)}).then(n.$instance.promise()).done(function(){n.afterOpen(t)})}return n.$instance.detach(),e.Deferred().reject().promise()},close:function(t){var r=this,a=e.Deferred();return r.beforeClose(t)===!1?a.reject():(0===n(r).length&&s(!1),r.$instance.fadeOut(r.closeSpeed,function(){r.$instance.detach(),r.afterClose(t),a.resolve()})),a.promise()},resize:function(e,t){if(e&&t){this.$content.css("width","").css("height","");var r=Math.max(e/(parseInt(this.$content.parent().css("width"),10)-1),t/(parseInt(this.$content.parent().css("height"),10)-1));r>1&&(r=t/Math.floor(t/r),this.$content.css("width",""+e/r+"px").css("height",""+t/r+"px"))}},chainCallbacks:function(t){for(var r in t)this[r]=e.proxy(t[r],this,e.proxy(this[r],this))}},e.extend(t,{id:0,autoBind:"[data-featherlight]",defaults:t.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(t){return t instanceof e&&t},process:function(t){return this.persist!==!1?e(t):e(t).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(t){var r=this,n=e.Deferred(),a=new Image,o=e('');return a.onload=function(){o.naturalWidth=a.width,o.naturalHeight=a.height,n.resolve(o)},a.onerror=function(){n.reject(o)},a.src=t,n.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(t){return e(t)}},ajax:{regex:/./,process:function(t){var r=e.Deferred(),n=e("
").load(t,function(e,t){"error"!==t&&r.resolve(n.contents()),r.fail()});return r.promise()}},iframe:{process:function(t){var r=new e.Deferred,n=e("