2022-09-25 18:03:20 +02:00
|
|
|
function display_activity(result, activity) {
|
|
|
|
let loaded = 0;
|
|
|
|
let nb_display = 8;
|
|
|
|
let container;
|
|
|
|
if (result==null) return;
|
|
|
|
for (let i = 0; i < result.feed.entry.length; i++) {
|
|
|
|
let entry = result.feed.entry[i];
|
|
|
|
if (activity==="commit" && entry.title.toString().indexOf("git commit") !== -1) {
|
|
|
|
container = document.getElementById("commit-activity");
|
|
|
|
} else if (activity==="mailing-list" && entry.title.toString().indexOf("git commit") === -1) {
|
|
|
|
container = document.getElementById("mailing-list-activity");
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
loaded += 1
|
|
|
|
if (loaded > nb_display)
|
|
|
|
break;
|
|
|
|
let div = document.createElement("p");
|
|
|
|
let link = document.createElement("a");
|
|
|
|
let d = new Date(entry.updated);
|
|
|
|
let data = '[' + d.toLocaleDateString() + '] ' + entry.title;
|
2023-02-06 11:45:59 +01:00
|
|
|
data = data.replace("Re: ","");
|
|
|
|
data = data.replace("[Buildroot] ","");
|
2022-09-25 18:03:20 +02:00
|
|
|
let text = document.createTextNode(data);
|
|
|
|
link.appendChild(text);
|
|
|
|
link.title = entry.title;
|
|
|
|
link.href = entry.link._href;
|
|
|
|
div.appendChild(link);
|
|
|
|
container.appendChild(div);
|
|
|
|
}
|
|
|
|
for (let i = 0; i < (nb_display - loaded); i++) {
|
|
|
|
container.appendChild(document.createElement("p"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function load_activity(feedurl) {
|
2019-02-04 14:30:04 +01:00
|
|
|
$.ajax({
|
2022-09-25 18:03:20 +02:00
|
|
|
url: 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);
|
2022-09-25 18:03:20 +02:00
|
|
|
display_activity(result, "commit");
|
|
|
|
display_activity(result, "mailing-list");
|
2014-03-02 19:01:55 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-09-25 18:03:20 +02:00
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
2022-09-25 18:03:20 +02:00
|
|
|
load_activity("/new.atom");
|
2017-02-05 17:59:31 +01:00
|
|
|
|
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
|
|
|
});
|