2015-12-20 05:22:45 +01:00
|
|
|
|
2017-05-06 18:03:40 +02:00
|
|
|
//=include svg4everybody/dist/svg4everybody.js
|
|
|
|
//=include jquery/dist/jquery.js
|
2018-05-22 14:40:56 +02:00
|
|
|
//=include smooth-scroll/dist/smooth-scroll.js
|
2018-05-15 12:04:15 +02:00
|
|
|
//=include cookies-eu-banner/dist/cookies-eu-banner.js
|
2015-12-20 05:22:45 +01:00
|
|
|
|
2015-12-20 05:32:57 +01:00
|
|
|
//=include bigchain/analytics.js
|
2016-01-17 16:25:46 +01:00
|
|
|
//=include bigchain/dnt.js
|
2015-12-20 05:32:57 +01:00
|
|
|
|
2017-04-12 15:42:35 +02:00
|
|
|
//=include bigchain/forms.js
|
2015-12-21 14:03:31 +01:00
|
|
|
|
2015-12-20 05:22:45 +01:00
|
|
|
jQuery(function($) {
|
|
|
|
|
|
|
|
//
|
2017-04-12 15:42:35 +02:00
|
|
|
// init global modules
|
2015-12-20 05:22:45 +01:00
|
|
|
//
|
2017-04-12 15:42:35 +02:00
|
|
|
Forms.init()
|
2016-02-01 16:31:29 +01:00
|
|
|
|
2016-01-17 16:43:46 +01:00
|
|
|
|
2017-08-22 13:28:58 +02:00
|
|
|
//
|
|
|
|
// init Smooth Scroll
|
|
|
|
//
|
2017-11-17 12:21:07 +01:00
|
|
|
var scroll = new SmoothScroll('a[data-scroll], .toc-entry a', {
|
2017-08-22 13:28:58 +02:00
|
|
|
easing: 'easeOutQuint'
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2016-02-09 01:36:57 +01:00
|
|
|
//
|
|
|
|
// Open all external links in new window
|
|
|
|
//
|
|
|
|
$('a').not('[href*="mailto:"]').each(function () {
|
|
|
|
var isInternalLink = new RegExp('/' + window.location.host + '/');
|
|
|
|
if ( !isInternalLink.test(this.href) ) {
|
|
|
|
$(this).attr('target', '_blank');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2016-01-17 16:43:46 +01:00
|
|
|
//
|
|
|
|
// Automatically add header links to all Markdown headings
|
|
|
|
//
|
2018-04-12 11:03:54 +02:00
|
|
|
$('.content--page--markdown h1:not(#heading-1), .content--page--markdown h2:not(#heading-2)').each(function(i, el) {
|
2016-01-17 16:43:46 +01:00
|
|
|
var $el, icon, id;
|
|
|
|
$el = $(el);
|
|
|
|
id = $el.attr('id');
|
|
|
|
icon = '<i class="header-icon">#</i>';
|
|
|
|
if (id) {
|
|
|
|
return $el.prepend($('<a />').addClass('header-link').attr('href', '#' + id).html(icon));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-12-20 05:22:45 +01:00
|
|
|
});
|