aboutsummaryrefslogtreecommitdiffstats
path: root/js/source.js
blob: 1eb0bb6ba57a2fce2f04610fdb6136ac9545887c (plain)
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

/*! mageia.org global nav | GNU GPL-3+ */
(function () {

    $("body").prepend('<header id="hmgn" style="display: none;"></header>');
    // TODO append footer?

    $("head").append('<link rel="stylesheet" href="//nav.mageia.org/css/">');
// it doesn't seems to work on treasurer   $("head").append('<link rel="icon" type="image/png" href="//nav.mageia.or/g/favicon.png" />');
    $("head").append('<link rel="icon" type="image/png" href="/g/favicon.png" />');

    // TODO test is h1#mgnavt exists;
    // TODO if not, inject existing first h1 value into a new h1#mgnavt element;
    // TODO and remove old h1.

    var params = {
        b: $("body").attr("class"),
        u: document.location.href,
        l: $("html").attr("lang"),
        c: $("meta[name=context]").attr("content")
    }

    $("#hmgn")
        .load("//nav.mageia.org/html/?" + $.param(params))
        .delay(1)
        .slideDown(1);
})();