From ebecea1f98b671b076876d6efe4819c708026b83 Mon Sep 17 00:00:00 2001 From: Florian Kissling Date: Thu, 11 Jun 2015 03:42:15 +0200 Subject: [PATCH] Update AnchorJS from v0.3.1 to 1.1.1. --- docs/_includes/head.html | 1 - docs/_layouts/default.html | 3 +- docs/_sass/_anchorjs.scss | 22 ++-------- docs/vendor/css/anchor.css | 78 ------------------------------------ docs/vendor/js/anchor.min.js | 4 +- 5 files changed, 7 insertions(+), 101 deletions(-) delete mode 100644 docs/vendor/css/anchor.css mode change 100644 => 100755 docs/vendor/js/anchor.min.js diff --git a/docs/_includes/head.html b/docs/_includes/head.html index e3d619f3..4f7fd69a 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -16,5 +16,4 @@ - diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index c5ea4e10..97bd9871 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -47,7 +47,8 @@ (function () { 'use strict'; - addAnchors('.s2-docs-container h1, .s2-docs-container h2, .s2-docs-container h3, .s2-docs-container h4, .s2-docs-container h5'); + anchors.options.placement = 'left'; + anchors.add('.s2-docs-container h1, .s2-docs-container h2, .s2-docs-container h3, .s2-docs-container h4, .s2-docs-container h5'); })(); diff --git a/docs/_sass/_anchorjs.scss b/docs/_sass/_anchorjs.scss index 04a4cca0..61900491 100644 --- a/docs/_sass/_anchorjs.scss +++ b/docs/_sass/_anchorjs.scss @@ -1,17 +1,9 @@ // AnchorJS Styles -// -// Styles for AnchorJS elements following the Bootstrap docs styles. -// -// @see https://github.com/twbs/bootstrap/blob/master/docs/assets/css/src/docs.css#L1599 .anchorjs-link { - float: left; - width: 1em; - height: 1em; - margin-left: -1.2em; - opacity: 0; color: inherit; - text-align: center; + transition: all .16s linear; + text-decoration: none; &:link, &:visited { @@ -26,18 +18,10 @@ *:hover > .anchorjs-link { opacity: .5; - -webkit-transition: all .16s linear; - -o-transition: all .16s linear; - transition: all .16s linear; + margin-left: -0.9em !important; } *:hover > .anchorjs-link:hover, .anchorjs-link:focus { opacity: 1; } - -.anchorjs-icon { - font-size: 60%; - vertical-align: .2em; -} - diff --git a/docs/vendor/css/anchor.css b/docs/vendor/css/anchor.css deleted file mode 100644 index 84b22b7f..00000000 --- a/docs/vendor/css/anchor.css +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Store the link icon as a base64 embedded icon font. - */ -@font-face { - font-family: 'anchorjs-icons'; - src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg6v8yoAAAC8AAAAYGNtYXDL8RqdAAABHAAAADxnYXNwAAAAEAAAAVgAAAAIZ2x5Zkm2oNUAAAFgAAABWGhlYWQAHd4cAAACuAAAADZoaGVhB3sECwAAAvAAAAAkaG10eAYAAEcAAAMUAAAADGxvY2EACgCsAAADIAAAAAhtYXhwAAYAcAAAAygAAAAgbmFtZUQXtNYAAANIAAABOXBvc3QAAwAAAAAEhAAAACAAAwQAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAACDmAAPA/8D/wAPAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEACgAAAAGAAQAAQACACDmAP//AAAAIOYA////4RoCAAEAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAIARwAHA7kDeQA2AG0AAAEnLgEiBg8BDgEUFh8BHgMXNy4DLwEuATQ2PwE+ATIWHwEeARQGDwEeAxU3PgE0JicBLgMnBx4DHwEeARQGDwEOASImLwEuATQ2PwEuAzUHDgEUFh8BHgEyNj8BPgE0Ji8BA7kEI1ldWiPaIyQkIwQDBgYGBFAEBwYHAwQTExMT2xMwMjETBBMTExNjBwkGA5gkIyMk/r4DBgYGBFAEBwYHAwQTExMT2xMwMjETBBMTExNjBwkGA5gkIyMkBCNZXVoj2iMkJCMEA3UEJCMjJNojWV1aIwQDBgUFA1ACBQUFAwQUM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ACAA4ARwADAAEECQADAA4AJAADAAEECQAEAA4AVQADAAEECQAFABYADgADAAEECQAGAA4AOQADAAEECQAKACgAYwBpAGMAbwBtAG8AbwBuAFYAZQByAHMAaQBvAG4AIAAwAC4AMABpAGMAbwBtAG8AbwBuaWNvbW9vbgBpAGMAbwBtAG8AbwBuAFIAZQBnAHUAbABhAHIAaQBjAG8AbQBvAG8AbgBHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4AAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff'); - font-style: normal; - font-weight: normal; -} -.anchorjs-icon { - font-family: 'anchorjs-icons'; - font-style: normal; - font-variant: normal; - font-weight: normal; - line-height: 1; - speak: none; - text-transform: none; - - /* Better Icon Rendering */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -/** - * Link placement and hover behavior. - */ -.anchorjs-link { - opacity: 0; - text-decoration: none; -} -*:hover > .anchorjs-link, -.anchorjs-link:focus { - /* To fade links as they appear, change transition-property from 'color' to 'all' */ - opacity: 1; - -webkit-transition: color .16s linear; - -moz-transition: color .16s linear; - -o-transition: color .16s linear; - transition: color .16s linear; -} -/** - * Make screen-reader friendly description text visually hidden. - */ -.anchorjs-description { - border: 0; - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} - -/** - * Reasonable default styles. - * Feel free to override or replace these with your own. - */ -.anchorjs-link:link { color: #DFD487; } -.anchorjs-link:visited { color: #DFD487; } -.anchorjs-link:hover { color: #EC7963; } -.anchorjs-link:active { color: #EC7963; } - -.anchorjs-icon { - font-size: 90%; - padding-left: 6px; -} - -.anchorjs-icon:before { - content: '\e600'; - /* alternative icons -- uncomment to use */ - /* - content: '#'; - content: '¶'; - content: '❡'; - content: '§'; - */ -} diff --git a/docs/vendor/js/anchor.min.js b/docs/vendor/js/anchor.min.js old mode 100644 new mode 100755 index b91e6870..68c3cb70 --- a/docs/vendor/js/anchor.min.js +++ b/docs/vendor/js/anchor.min.js @@ -1,6 +1,6 @@ /*! - * AnchorJS - v0.3.1 - 2015-03-06 + * AnchorJS - v1.1.1 - 2015-05-23 * https://github.com/bryanbraun/anchorjs * Copyright (c) 2015 Bryan Braun; Licensed MIT */ -function addAnchors(e){"use strict";if(e){if("string"!=typeof e)throw new Error("AnchorJS accepts only strings; you used a "+typeof e)}else e="h1, h2, h3, h4, h5, h6";var t=document.querySelectorAll(e);if(0===t.length)return!1;for(var r=document.querySelectorAll("[id]"),n=[].map.call(r,function(e){return e.id}),i=0;iAnchor link for: '+u+'';t[i].innerHTML+=p}} \ No newline at end of file +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,c,r,h,g,B,Q;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',B=document.createElement("div"),B.innerHTML=g,Q=B.childNodes,"always"===this.options.visible&&(Q[0].style.opacity="1"),""===this.options.icon&&(Q[0].style.fontFamily="anchorjs-icons",Q[0].style.fontStyle="normal",Q[0].style.fontVariant="normal",Q[0].style.fontWeight="normal"),"left"===this.options.placement?(Q[0].style.position="absolute",Q[0].style.marginLeft="-1em",Q[0].style.paddingRight="0.5em",e[i].insertBefore(Q[0],e[i].firstChild)):(Q[0].style.paddingLeft="0.375em",e[i].appendChild(Q[0]))}return this},this.remove=function(A){for(var e,t=document.querySelectorAll(A),o=0;o