summaryrefslogtreecommitdiff
path: root/js/codeq/statusbar.js
blob: 56070bd735f814005901ea55c052dfda06ae3c87 (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
(function () {

    var jqBar = $('#topbar'),
        jqLang = jqBar.find('.lang-selection'),
        jqLangChoice = jqLang.find('.lang-choice');

    (function () {
        var langs = codeq.supportedLangs,
            jqMenu = jqLang.find('.dropdown-menu'),
            lang, cssClass;
        for (lang in langs) {
            if (!langs.hasOwnProperty(lang)) continue;
            cssClass = 'lang-' + lang;
            jqMenu.append('<li><a class="' + cssClass + '">' + lang + '</a></li>');
            jqMenu.find('.' + cssClass).on('click', (function (l) {return function () {codeq.setLang(l)};})(lang));
        }
    })();

    codeq.on('langchange', function (params) {
        jqLangChoice.text(params.lang);
    });

    codeq.statusbar = {

    };
})();