website: Fix indentation
[Thomas: fix commit title.] Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
36c12e8203
commit
4438ccafcb
|
@ -2,61 +2,63 @@ function load_activity(feedurl, divid) {
|
||||||
var feed = new google.feeds.Feed(feedurl);
|
var feed = new google.feeds.Feed(feedurl);
|
||||||
feed.setNumEntries(30);
|
feed.setNumEntries(30);
|
||||||
feed.load(function(result) {
|
feed.load(function(result) {
|
||||||
if (!result.error) {
|
if (!result.error) {
|
||||||
var container = document.getElementById(divid);
|
var container = document.getElementById(divid);
|
||||||
var loaded = 0;
|
var loaded = 0;
|
||||||
var nb_display = 8;
|
var nb_display = 8;
|
||||||
for (var i = 0; i < result.feed.entries.length; i++) {
|
for (var i = 0; i < result.feed.entries.length; i++) {
|
||||||
var entry = result.feed.entries[i];
|
var entry = result.feed.entries[i];
|
||||||
if (entry.title.indexOf("git commit") != -1)
|
if (entry.title.indexOf("git commit") != -1)
|
||||||
continue;
|
continue;
|
||||||
loaded += 1;
|
loaded += 1;
|
||||||
if (loaded > nb_display)
|
if (loaded > nb_display)
|
||||||
break;
|
break;
|
||||||
var div = document.createElement("p");
|
var div = document.createElement("p");
|
||||||
var link = document.createElement("a");
|
var link = document.createElement("a");
|
||||||
var d = new Date(entry.publishedDate);
|
var d = new Date(entry.publishedDate);
|
||||||
var data = '[' + d.toLocaleDateString() + '] ' + entry.title
|
var data = '[' + d.toLocaleDateString() + '] ' + entry.title
|
||||||
var text = document.createTextNode(data);
|
var text = document.createTextNode(data);
|
||||||
link.appendChild(text);
|
link.appendChild(text);
|
||||||
link.title = entry.title;
|
link.title = entry.title;
|
||||||
link.href = entry.link
|
link.href = entry.link
|
||||||
div.appendChild(link);
|
div.appendChild(link);
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
|
}
|
||||||
|
var empty = nb_display - loaded;
|
||||||
|
for (var i = 0; i < empty; i++) {
|
||||||
|
container.appendChild(document.createElement("p"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var empty = nb_display - loaded;
|
|
||||||
for (var i = 0; i < empty; i++) {
|
|
||||||
container.appendChild(document.createElement("p"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
load_activity("http://rss.gmane.org/topics/excerpts/gmane.comp.lib.uclibc.buildroot", "mailing-list-activity");
|
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");
|
load_activity("http://git.buildroot.org/buildroot/atom/?h=master", "commit-activity");
|
||||||
}
|
}
|
||||||
|
|
||||||
function google_analytics() {
|
function google_analytics() {
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
_gaq.push(['_setAccount', 'UA-21761074-1']);
|
_gaq.push(['_setAccount', 'UA-21761074-1']);
|
||||||
_gaq.push(['_setDomainName', 'none']);
|
_gaq.push(['_setDomainName', 'none']);
|
||||||
_gaq.push(['_setAllowLinker', true]);
|
_gaq.push(['_setAllowLinker', true]);
|
||||||
_gaq.push(['_trackPageview']);
|
_gaq.push(['_trackPageview']);
|
||||||
|
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
var ga = document.createElement('script');
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
ga.type = 'text/javascript';
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
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.load("feeds", "1");
|
||||||
google.setOnLoadCallback(initialize);
|
google.setOnLoadCallback(initialize);
|
||||||
google_analytics();
|
google_analytics();
|
||||||
|
|
||||||
jQuery(document).ready(function($){
|
jQuery(document).ready(function($) {
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
// Get the basename of the URL
|
// Get the basename of the URL
|
||||||
url = url.split(/[\\/]/).pop()
|
url = url.split(/[\\/]/).pop()
|
||||||
$('.nav a[href="/'+url+'"]').parent().addClass('active');
|
$('.nav a[href="/' + url + '"]').parent().addClass('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue