2014-03-02 19:01:55 +01:00
|
|
|
function load_activity(feedurl, divid) {
|
2019-02-04 15:27:29 +01:00
|
|
|
let container = document.getElementById(divid);
|
2019-02-04 14:30:04 +01:00
|
|
|
$.ajax({
|
2019-10-09 17:23:06 +02:00
|
|
|
url: "https://cors-anywhere.herokuapp.com/" + feedurl
|
2019-02-04 14:30:04 +01:00
|
|
|
})
|
|
|
|
.done(function(data){
|
2019-02-04 15:27:29 +01:00
|
|
|
let x2js = new X2JS();
|
2019-10-09 17:23:06 +02:00
|
|
|
let result = x2js.xml_str2json(data.documentElement.outerHTML);
|
2019-02-04 15:27:29 +01:00
|
|
|
let loaded = 0;
|
|
|
|
let nb_display = 8;
|
2017-02-05 17:59:31 +01:00
|
|
|
if (result==null) return;
|
2019-02-04 15:27:29 +01:00
|
|
|
for (let i = 0; i < result.feed.entry.length; i++) {
|
|
|
|
let entry = result.feed.entry[i];
|
2019-02-04 15:27:30 +01:00
|
|
|
if (entry.title.indexOf("git commit") !== -1)
|
2014-11-03 00:58:16 +01:00
|
|
|
continue;
|
|
|
|
loaded += 1;
|
|
|
|
if (loaded > nb_display)
|
|
|
|
break;
|
2019-02-04 15:27:29 +01:00
|
|
|
let div = document.createElement("p");
|
|
|
|
let link = document.createElement("a");
|
|
|
|
let d = new Date(entry.published);
|
2019-02-04 15:27:31 +01:00
|
|
|
let data = '[' + d.toLocaleDateString() + '] ' + entry.title;
|
2019-02-04 15:27:29 +01:00
|
|
|
let text = document.createTextNode(data);
|
2014-11-03 00:58:16 +01:00
|
|
|
link.appendChild(text);
|
|
|
|
link.title = entry.title;
|
2019-02-04 14:30:04 +01:00
|
|
|
link.href = entry.link._href;
|
2014-11-03 00:58:16 +01:00
|
|
|
div.appendChild(link);
|
|
|
|
container.appendChild(div);
|
|
|
|
}
|
2019-02-04 15:27:29 +01:00
|
|
|
let empty = nb_display - loaded;
|
|
|
|
for (let i = 0; i < empty; i++) {
|
2014-11-03 00:58:16 +01:00
|
|
|
container.appendChild(document.createElement("p"));
|
2014-03-02 19:01:55 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function google_analytics() {
|
2019-02-04 15:27:29 +01:00
|
|
|
let _gaq = _gaq || [];
|
2014-11-03 00:58:15 +01:00
|
|
|
_gaq.push(['_setAccount', 'UA-21761074-1']);
|
|
|
|
_gaq.push(['_setDomainName', 'none']);
|
|
|
|
_gaq.push(['_setAllowLinker', true]);
|
|
|
|
_gaq.push(['_trackPageview']);
|
2014-03-02 19:01:55 +01:00
|
|
|
|
2019-02-04 15:27:29 +01:00
|
|
|
let ga = document.createElement('script');
|
2014-11-03 00:58:15 +01:00
|
|
|
ga.type = 'text/javascript';
|
|
|
|
ga.async = true;
|
2019-02-04 15:27:30 +01:00
|
|
|
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
2019-02-04 15:27:29 +01:00
|
|
|
let s = document.getElementsByTagName('script')[0];
|
2014-11-03 00:58:15 +01:00
|
|
|
s.parentNode.insertBefore(ga, s);
|
2014-03-02 19:01:55 +01:00
|
|
|
}
|
|
|
|
|
2015-10-13 21:03:29 +02:00
|
|
|
function showTooltip(elem, msg) {
|
|
|
|
elem.setAttribute('class', 'btn tooltipped tooltipped-s');
|
|
|
|
elem.setAttribute('aria-label', msg);
|
|
|
|
}
|
|
|
|
|
2019-02-04 15:27:29 +01:00
|
|
|
let clipboard = new Clipboard('.btn');
|
2015-10-13 21:03:29 +02:00
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|
2019-02-04 15:27:31 +01:00
|
|
|
});
|
2015-10-13 21:03:29 +02:00
|
|
|
|
|
|
|
clipboard.on('success', function(e) {
|
|
|
|
e.clearSelection();
|
|
|
|
$(e.trigger).tooltip('show');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function() {
|
2017-02-05 17:59:31 +01:00
|
|
|
$('a[href*=\\#]:not([href=\\#])').click(function() {
|
2019-02-04 15:27:30 +01:00
|
|
|
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
|
2019-02-04 15:27:29 +01:00
|
|
|
let target = $(this.hash);
|
2015-10-13 21:03:29 +02:00
|
|
|
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
|
|
|
|
if (target.length) {
|
|
|
|
$('html,body').animate({
|
|
|
|
scrollTop: target.offset().top
|
|
|
|
}, 1000);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-03-02 19:01:55 +01:00
|
|
|
});
|
2017-02-05 17:59:31 +01:00
|
|
|
|
|
|
|
jQuery(document).ready(function($) {
|
2019-02-04 15:27:29 +01:00
|
|
|
let url = window.location.href;
|
2017-02-05 17:59:31 +01:00
|
|
|
// Get the basename of the URL
|
2019-02-04 15:27:31 +01:00
|
|
|
url = url.split(/[\\/]/).pop();
|
2017-02-05 17:59:31 +01:00
|
|
|
$('.nav a[href="/' + url + '"]').parent().addClass('active');
|
|
|
|
|
2017-02-05 17:59:32 +01:00
|
|
|
load_activity("http://buildroot-busybox.2317881.n4.nabble.com/Buildroot-busybox-ft2.xml", "mailing-list-activity");
|
2017-02-05 17:59:31 +01:00
|
|
|
load_activity("http://git.buildroot.org/buildroot/atom/?h=master", "commit-activity");
|
|
|
|
|
2018-02-13 14:26:35 +01:00
|
|
|
$('#slides').html('<iframe src="https://docs.google.com/gview?url=http://bootlin.com/doc/training/buildroot/buildroot-slides.pdf&embedded=true" style="position:absolute; width:100%; height:100%; top:0; left:0;" frameborder="0"></iframe>')
|
2017-02-05 17:59:31 +01:00
|
|
|
});
|