/** * Created by robert on 9/18/15. */ (function(){ var jqScreen = $('#screen_language'), jqProlog = $('#choose-prolog'), jqPython = $('#choose-python'), jqRobot = $('#choose-robot'), chooseProlog = function () {codeq.globalStateMachine.transition('problem', 'prolog');}, choosePython = function () {codeq.globalStateMachine.transition('problem', 'python');}, chooseRobot = function () {codeq.globalStateMachine.transition('problem', 'robot');}; codeq.globalStateMachine.register('language',{ 'enter': function(){ $("#navigation-language").addClass("active").css('display', ''); jqScreen.css('display', ''); jqProlog.on('click', chooseProlog); jqPython.on('click', choosePython); jqRobot.on('click', chooseRobot); }, 'exit' : function(){ jqProlog.off(); jqPython.off(); jqRobot.off(); jqScreen.css('display', 'none'); $('#navigation-language').css('display', 'none').removeClass("active"); } }); })();