X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fdocs%2Fwebsite%2Fjs%2Fbuildroot.js;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fdocs%2Fwebsite%2Fjs%2Fbuildroot.js;h=83a3ac0305d9dcb2fb8559e2163ac56ba2925c47;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/docs/website/js/buildroot.js b/cirros-testvm/src-cirros/buildroot-2015.05/docs/website/js/buildroot.js new file mode 100644 index 0000000..83a3ac0 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/docs/website/js/buildroot.js @@ -0,0 +1,65 @@ +function load_activity(feedurl, divid) { + var feed = new google.feeds.Feed(feedurl); + var container = document.getElementById(divid); + var loaded = 0; + var nb_display = 8; + feed.setNumEntries(30); + feed.load(function(result) { + if (result.error) { + return; + } + for (var i = 0; i < result.feed.entries.length; i++) { + var entry = result.feed.entries[i]; + if (entry.title.indexOf("git commit") != -1) + continue; + loaded += 1; + if (loaded > nb_display) + break; + var div = document.createElement("p"); + var link = document.createElement("a"); + var d = new Date(entry.publishedDate); + var data = '[' + d.toLocaleDateString() + '] ' + entry.title + var text = document.createTextNode(data); + link.appendChild(text); + link.title = entry.title; + link.href = entry.link + div.appendChild(link); + container.appendChild(div); + } + var empty = nb_display - loaded; + for (var i = 0; i < empty; i++) { + container.appendChild(document.createElement("p")); + } + }); +} + +function initialize() { + load_activity("http://rss.gmane.org/topics/excerpts/gmane.comp.lib.uclibc.buildroot", "mailing-list-activity"); + load_activity("http://git.buildroot.org/buildroot/atom/?h=master", "commit-activity"); +} + +function google_analytics() { + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-21761074-1']); + _gaq.push(['_setDomainName', 'none']); + _gaq.push(['_setAllowLinker', true]); + _gaq.push(['_trackPageview']); + + var ga = document.createElement('script'); + ga.type = 'text/javascript'; + ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga, s); +} + +google.load("feeds", "1"); +google.setOnLoadCallback(initialize); +google_analytics(); + +jQuery(document).ready(function($) { + var url = window.location.href; + // Get the basename of the URL + url = url.split(/[\\/]/).pop() + $('.nav a[href="/' + url + '"]').parent().addClass('active'); +});