From f34fa4164428d57e2b21032e428df75159b8e396 Mon Sep 17 00:00:00 2001 From: Simon Holywell Date: Mon, 6 Jul 2015 13:06:16 +0100 Subject: [PATCH] Add heading anchor links JS --- _includes/anchor.min.js | 6 ++++++ scripts.js | 3 +++ style.css | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 _includes/anchor.min.js diff --git a/_includes/anchor.min.js b/_includes/anchor.min.js new file mode 100644 index 0000000..02d60af --- /dev/null +++ b/_includes/anchor.min.js @@ -0,0 +1,6 @@ +/*! + * AnchorJS - v1.2.1 - 2015-07-02 + * https://github.com/bryanbraun/anchorjs + * Copyright (c) 2015 Bryan Braun; Licensed MIT + */ +function AnchorJS(A){"use strict";this.options=A||{},this._applyRemainingDefaultOptions=function(A){this.options.icon=this.options.hasOwnProperty("icon")?A.icon:"",this.options.visible=this.options.hasOwnProperty("visible")?A.visible:"hover",this.options.placement=this.options.hasOwnProperty("placement")?A.placement:"right",this.options.class=this.options.hasOwnProperty("class")?A.class:""},this._applyRemainingDefaultOptions(A),this.add=function(A){var e,t,o,n,i,s,a,l,r,h,c,g;if(this._applyRemainingDefaultOptions(this.options),A){if("string"!=typeof A)throw new Error("The selector provided to AnchorJS was invalid.")}else A="h1, h2, h3, h4, h5, h6";if(e=document.querySelectorAll(A),0===e.length)return!1;for(this._addBaselineStyles(),t=document.querySelectorAll("[id]"),o=[].map.call(t,function(A){return A.id}),i=0;i