summaryrefslogtreecommitdiff
path: root/js/codeq/language.js
blob: aac4e78651ae0f52d7f50993bb5c869138dd9299 (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
28
/**
 * Created by robert on 9/18/15.
 */

(function(){
    var jqScreen = $('#screen_language'),
        jqProlog = $('#choose-prolog'),
        jqPython = $('#choose-python'),
        chooseProlog = function () {codeq.globalStateMachine.transition('problem', 'prolog');},
        choosePython = function () {codeq.globalStateMachine.transition('problem', 'python');};

    codeq.globalStateMachine.register('language',{
        'enter': function(){
            $("#navigation-language").addClass("active").css('display', '');

            jqScreen.css('display', '');
            jqProlog.on('click', chooseProlog);
            jqPython.on('click', choosePython);
        },
        'exit' : function(){
            jqProlog.off();
            jqPython.off();
            jqScreen.css('display', 'none');

            $('#navigation-language').css('display', 'none').removeClass("active");
        }
    });
})();