hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
function load_activity(feedurl, divid) {
    let container = document.getElementById(divid);
    $.ajax({
      url: "https://cors-anywhere.herokuapp.com/" + feedurl
    })
    .done(function(data){
        let x2js = new X2JS();
        let result = x2js.xml_str2json(data.documentElement.outerHTML);
        let loaded = 0;
        let nb_display = 8;
        if (result==null) return;
        for (let i = 0; i < result.feed.entry.length; i++) {
            let entry = result.feed.entry[i];
            if (entry.title.indexOf("git commit") !== -1)
                continue;
            loaded += 1;
            if (loaded > nb_display)
                break;
            let div = document.createElement("p");
            let link = document.createElement("a");
            let d = new Date(entry.published);
            let data = '[' + d.toLocaleDateString() + '] ' + entry.title;
            let text = document.createTextNode(data);
            link.appendChild(text);
            link.title = entry.title;
            link.href = entry.link._href;
            div.appendChild(link);
            container.appendChild(div);
        }
        let empty = nb_display - loaded;
        for (let i = 0; i < empty; i++) {
            container.appendChild(document.createElement("p"));
        }
    });
}
 
function google_analytics() {
    let _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-21761074-1']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);
 
    let 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';
    let s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
}
 
function showTooltip(elem, msg) {
    elem.setAttribute('class', 'btn tooltipped tooltipped-s');
    elem.setAttribute('aria-label', msg);
}
 
let clipboard = new Clipboard('.btn');
 
$(function () {
  $('[data-toggle="tooltip"]').tooltip()
});
 
clipboard.on('success', function(e) {
    e.clearSelection();
    $(e.trigger).tooltip('show');
});
 
$(function() {
  $('a[href*=\\#]:not([href=\\#])').click(function() {
    if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
        let target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
});
 
jQuery(document).ready(function($) {
    let url = window.location.href;
    // Get the basename of the URL
    url = url.split(/[\\/]/).pop();
    $('.nav a[href="/' + url + '"]').parent().addClass('active');
 
    load_activity("http://buildroot-busybox.2317881.n4.nabble.com/Buildroot-busybox-ft2.xml", "mailing-list-activity");
    load_activity("http://git.buildroot.org/buildroot/atom/?h=master", "commit-activity");
 
    $('#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>')
});