summaryrefslogtreecommitdiffstats
path: root/docs/website/js/buildroot.js
diff options
context:
space:
mode:
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>2015-10-13 21:03:29 +0200
committerPeter Korsgaard <peter@korsgaard.com>2015-11-23 22:56:59 +0100
commit97ab48658d574ded87f8af799795ba7ed76f6ba4 (patch)
treeca69cbb45c1821c6a8fcfe9a220bae3021c1d4e1 /docs/website/js/buildroot.js
parenta597e3c676948c6c1eb6440c82f19b7460f29192 (diff)
downloadbuildroot-97ab48658d574ded87f8af799795ba7ed76f6ba4.tar.gz
buildroot-97ab48658d574ded87f8af799795ba7ed76f6ba4.zip
docs/website: New website
This patch introduces a new buildroot website based on a modern flat layout inspired by material design. Each page of the old website is converted to the new css/layout, the big bump is in main page which is completely rewritten. Content of the old website is copied more or less verbatim, planning to add more content in the future. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'docs/website/js/buildroot.js')
-rw-r--r--docs/website/js/buildroot.js48
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;
+ }
+ }
+ });
});
OpenPOWER on IntegriCloud