diff options
Diffstat (limited to 'docs/website/js/buildroot.js')
-rw-r--r-- | docs/website/js/buildroot.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/docs/website/js/buildroot.js b/docs/website/js/buildroot.js index 83a3ac0305..2fd3b7811b 100644 --- a/docs/website/js/buildroot.js +++ b/docs/website/js/buildroot.js @@ -53,6 +53,21 @@ function google_analytics() { s.parentNode.insertBefore(ga, s); } +$(function() { + $('a[href*=#]:not([href=#])').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); + if (target.length) { + $('html,body').animate({ + scrollTop: target.offset().top + }, 1000); + return false; + } + } + }); +}); + google.load("feeds", "1"); google.setOnLoadCallback(initialize); google_analytics(); @@ -62,4 +77,37 @@ jQuery(document).ready(function($) { // Get the basename of the URL url = url.split(/[\\/]/).pop() $('.nav a[href="/' + url + '"]').parent().addClass('active'); + + $('#slides').html('<iframe src="http://docs.google.com/gview?url=http://free-electrons.com/doc/training/buildroot/buildroot-slides.pdf&embedded=true" style="position:absolute; width:100%; height:100%; top:0; left:0;" frameborder="0"></iframe>') +}); + +function showTooltip(elem, msg) { + elem.setAttribute('class', 'btn tooltipped tooltipped-s'); + elem.setAttribute('aria-label', msg); +} + +var clipboard = new Clipboard('.btn'); + +$(function () { + $('[data-toggle="tooltip"]').tooltip() +}) + +clipboard.on('success', function(e) { + e.clearSelection(); + $(e.trigger).tooltip('show'); +}); + +$(function() { + $('a[href*=#]:not([href=#])').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); + if (target.length) { + $('html,body').animate({ + scrollTop: target.offset().top + }, 1000); + return false; + } + } + }); }); |