summaryrefslogtreecommitdiff
path: root/js/codeq/language.js
blob: d4b6ee48b686bd3834a7f754313c26f70a9de8ef (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
29
30
31
32
33
34
35
36
/**
 * Created by robert on 9/18/15.
 */

(function(){
    codeq.globalStateMachine.register('language',{
        'enter': function(){
            $('#submit_language').on('click',function(){
                codeq.globalStateMachine.transition('problem',$('#language').val());
                //var lan = $('#language').val();
                //codeq.activateState('problem',{'lan':lan});
            });

            $('#navigation-login').css('display', '');
            /*$('#navigation-login').on('click', function(){
               codeq.globalStateMachine.transition('login');
               //codeq.activateState('login');
            });*/
            $("#navigation-language").addClass("active");
            $('#navigation-language').css('display', '');

            $("#screen_language").css('display', '');
        },
        'exit' : function(){
            $("#submit_language").off();
            $("#screen_language").css('display', 'none');

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

            $('#language').val("prolog");//reset to the default value
        }
    });
})();