2014-03-02 19:01:55 +01:00
|
|
|
function load_activity(feedurl, divid) {
|
|
|
|
var feed = new google.feeds.Feed(feedurl);
|
2014-11-03 00:58:16 +01:00
|
|
|
var container = document.getElementById(divid);
|
|
|
|
var loaded = 0;
|
|
|
|
var nb_display = 8;
|
2014-03-02 19:01:55 +01:00
|
|
|
feed.setNumEntries(30);
|
|
|
|
feed.load(function(result) {
|
2014-11-03 00:58:16 +01:00
|
|
|
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"));
|
2014-03-02 19:01:55 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function initialize() {
|
2014-11-03 00:58:15 +01:00
|
|
|
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");
|
2014-03-02 19:01:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function google_analytics() {
|
2014-11-03 00:58:15 +01:00
|
|
|
var _gaq = _gaq || [];
|
|
|
|
_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
|
|
|
|
2014-11-03 00:58:15 +01:00
|
|
|
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);
|
2014-03-02 19:01:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
google.load("feeds", "1");
|
|
|
|
google.setOnLoadCallback(initialize);
|
|
|
|
google_analytics();
|
|
|
|
|
2014-11-03 00:58:15 +01:00
|
|
|
jQuery(document).ready(function($) {
|
2014-03-02 19:01:55 +01:00
|
|
|
var url = window.location.href;
|
|
|
|
// Get the basename of the URL
|
|
|
|
url = url.split(/[\\/]/).pop()
|
2014-11-03 00:58:15 +01:00
|
|
|
$('.nav a[href="/' + url + '"]').parent().addClass('active');
|
2014-03-02 19:01:55 +01:00
|
|
|
});
|