aboutsummaryrefslogtreecommitdiff
path: root/src/js/BotleaguesFrontend.js
blob: e9ab570e943a359c0229067dcb666a6be608b078 (plain) (blame)
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
function BotleaguesFrontend(){}

BotleaguesFrontend.error = function(user_options) {
    options = {
        dismissable: true,
        prepend_to: $('#messages'),
        type: 'danger'
    };
    for (var key in user_options) {
        options[key] = user_options[key];
    }

    var html = '<div class="alert alert-' + options.type + '">';
    if (options.dismissable === true)
        html += '<a href="#" class="close" data-dismiss="alert">&times;</a>';
    html += options.message;
    html += '</div>';

    html = $(html);

    html.prependTo(options.prepend_to).delay(3000).fadeOut().queue(html.remove);
};

BotleaguesFrontend.login = function() {
    Botleagues.redirect({
        endpoint: 'user/login?redirect=http://local.botleagues.camilstaps.nl/'
    });
};