aboutsummaryrefslogtreecommitdiff
path: root/site/docs
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2018-11-13 16:10:43 +0200
committerXhmikosR <[email protected]>2018-11-20 11:47:10 +0200
commitb04f97f60be64549a37e0c71d676ab67e70891fa (patch)
tree86005442f323b4d732721647b6766f90ac3e09bb /site/docs
parent8470c5f78ce4578ce8c17b06206c23745c655b24 (diff)
downloadbootstrap-b04f97f60be64549a37e0c71d676ab67e70891fa.tar.xz
bootstrap-b04f97f60be64549a37e0c71d676ab67e70891fa.zip
Replace anchor.js with jekyll-anchor-headings.
This allows us to generate the anchor links on build time. https://github.com/allejo/jekyll-anchor-headings
Diffstat (limited to 'site/docs')
-rw-r--r--site/docs/4.1/assets/js/src/application.js6
-rw-r--r--site/docs/4.1/assets/js/vendor/anchor.min.js6
-rw-r--r--site/docs/4.1/assets/scss/_anchor.scss13
3 files changed, 10 insertions, 15 deletions
diff --git a/site/docs/4.1/assets/js/src/application.js b/site/docs/4.1/assets/js/src/application.js
index 40c3f1e94..250530848 100644
--- a/site/docs/4.1/assets/js/src/application.js
+++ b/site/docs/4.1/assets/js/src/application.js
@@ -10,7 +10,7 @@
* details, see https://creativecommons.org/licenses/by/3.0/.
*/
-/* global ClipboardJS: false, anchors: false, Holder: false, bsCustomFileInput: false */
+/* global ClipboardJS: false, Holder: false, bsCustomFileInput: false */
(function ($) {
'use strict'
@@ -101,10 +101,6 @@
.tooltip('_fixTitle')
})
- anchors.options = {
- icon: '#'
- }
- anchors.add('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5')
$('.bd-content > h2, .bd-content > h3, .bd-content > h4, .bd-content > h5').wrapInner('<div></div>')
// Holder
diff --git a/site/docs/4.1/assets/js/vendor/anchor.min.js b/site/docs/4.1/assets/js/vendor/anchor.min.js
deleted file mode 100644
index 29a64acae..000000000
--- a/site/docs/4.1/assets/js/vendor/anchor.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * AnchorJS - v4.1.1 - 2018-07-01
- * https://github.com/bryanbraun/anchorjs
- * Copyright (c) 2018 Bryan Braun; Licensed MIT
- */
-!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64}function f(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,r,a,c,h,l,u=[];if(d(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(e=f(A)).length)return this;for(function(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/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AAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))u.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=a=this.urlify(e[o].textContent),r=0;void 0!==s&&(c=a+"-"+r),r+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}n.replace(/-/g," "),(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.href="#"+n,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<u.length;o++)e.splice(u[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=f(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||d(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}}); \ No newline at end of file
diff --git a/site/docs/4.1/assets/scss/_anchor.scss b/site/docs/4.1/assets/scss/_anchor.scss
index 2f00424dd..7f407f7c2 100644
--- a/site/docs/4.1/assets/scss/_anchor.scss
+++ b/site/docs/4.1/assets/scss/_anchor.scss
@@ -1,10 +1,15 @@
-.anchorjs-link {
+.bd-anchor {
+ padding-left: .25rem;
font-weight: 400;
- color: rgba($link-color, .5);
- @include transition(color .16s linear);
+ color: $link-color;
+ opacity: 0;
+ @include transition(opacity .16s linear);
- &:hover {
+ :hover > &,
+ &:hover,
+ &:focus {
color: $link-color;
text-decoration: none;
+ opacity: 1;
}
}