mirror of
https://github.com/bigchaindb/site.git
synced 2024-12-24 18:36:11 +01:00
Matthias Kretschmann
26d547ae02
- new native select style - progressively enhanced select styles via select.js - new textarea autogrow functionality - start isolating all the forms, load only when needed
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
|
|
//=include svg4everybody/dist/svg4everybody.js
|
|
//=include jquery/dist/jquery.js
|
|
|
|
//=include bigchain/analytics.js
|
|
//=include bigchain/dnt.js
|
|
|
|
//=include bigchain/forms.js
|
|
|
|
jQuery(function($) {
|
|
|
|
//
|
|
// init global modules
|
|
//
|
|
Forms.init()
|
|
|
|
if (!_dntEnabled()) {
|
|
GoogleAnalytics.init();
|
|
}
|
|
|
|
|
|
//
|
|
// 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');
|
|
}
|
|
});
|
|
|
|
|
|
//
|
|
// Automatically add header links to all Markdown headings
|
|
//
|
|
$('.content--page--markdown h1:not(#heading-1), .content--page--markdown h2:not(#heading-2)').each(function(i, el) {
|
|
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));
|
|
}
|
|
});
|
|
|
|
});
|