summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-10-06 18:32:42 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-10-06 18:32:42 +0200
commit0b2485f393bcc47dcf895044c410b2c8784af432 (patch)
treec47ce3db5e8ff35dccfe714b6c0635c01f07ee6d /js
parent3f699e7460fb79bb0b48077dddc3359ee4b974c1 (diff)
Rename state 'problem' to problem_list
Remove the Language element from the navbar and have "CodeQ" (logo TBD) send user to the language-selection page.
Diffstat (limited to 'js')
-rw-r--r--js/codeq/language.js10
-rw-r--r--js/codeq/navigation.js6
-rw-r--r--js/codeq/problem_list.js (renamed from js/codeq/problem.js)10
-rw-r--r--js/codeq/prolog.js6
-rw-r--r--js/codeq/python.js6
-rw-r--r--js/codeq/robot.js6
6 files changed, 16 insertions, 28 deletions
diff --git a/js/codeq/language.js b/js/codeq/language.js
index 0893e33..b861560 100644
--- a/js/codeq/language.js
+++ b/js/codeq/language.js
@@ -7,14 +7,12 @@
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');};
+ chooseProlog = function () {codeq.globalStateMachine.transition('problem_list', 'prolog');},
+ choosePython = function () {codeq.globalStateMachine.transition('problem_list', 'python');},
+ chooseRobot = function () {codeq.globalStateMachine.transition('problem_list', 'robot');};
codeq.globalStateMachine.register('language',{
'enter': function(){
- $("#navigation-language").addClass("active").css('display', '');
-
jqScreen.css('display', '');
jqProlog.on('click', chooseProlog);
jqPython.on('click', choosePython);
@@ -25,8 +23,6 @@
jqPython.off();
jqRobot.off();
jqScreen.css('display', 'none');
-
- $('#navigation-language').css('display', 'none').removeClass("active");
}
});
})();
diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js
index a1b8f3d..eafa5cc 100644
--- a/js/codeq/navigation.js
+++ b/js/codeq/navigation.js
@@ -81,12 +81,12 @@
//setup all the buttons in the banner
- $('#navigation-language').on('click', function(e){
+ $('#navigation-home').on('click', function(e){
codeq.globalStateMachine.transition('language');
e.preventDefault();
});
- $('#navigation-problem').on('click', function(e){
- codeq.globalStateMachine.transition('problem');
+ $('#navigation-problem_list').on('click', function(e){
+ codeq.globalStateMachine.transition('problem_list');
e.preventDefault();
});
$('#navigation-python').on('click', function(e){
diff --git a/js/codeq/problem.js b/js/codeq/problem_list.js
index 4387344..1b20fe2 100644
--- a/js/codeq/problem.js
+++ b/js/codeq/problem_list.js
@@ -1,5 +1,5 @@
(function(){
- var jqScreen = $('#screen_problem'),
+ var jqScreen = $('#screen_problem_list'),
languageCache = {}, // keyed by language identifier: processed data about languages
translationCache = [], // keys are autogenerated in ta(), a value is a dictionary of translations of a translation key for every language
problemCache = {}, // problem data cache, 3-level, keyed by: language, problem group, and problem identifier
@@ -349,12 +349,11 @@
// Register with the state machine
// ================================================================================
- codeq.globalStateMachine.register('problem', {
+ codeq.globalStateMachine.register('problem_list', {
'enter': function(language){
var data = null; // language data
- $('#navigation-language').css('display', '');
- $("#navigation-problem").addClass("active").css('display', '');
+ $("#navigation-problem_list").addClass("active").css('display', '');
if (!language) language = currentLanguage; // This happens when we hit this with the back button
@@ -378,8 +377,7 @@
},
'exit' : function(){
jqScreen.css('display', 'none');
- $('#navigation-language').css('display', 'none');
- $('#navigation-problem').css('display', 'none').removeClass("active");
+ $('#navigation-problem_list').css('display', 'none').removeClass("active");
}
});
})();
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index ce1865a..b73d037 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -67,8 +67,7 @@
var prologHandler; //created when we enter the prolog state and destroyed once we leave it
codeq.globalStateMachine.register('prolog', {
'enter': function (problemDef, commonDef, currentSolution) {
- $('#navigation-language').css('display', '');
- $('#navigation-problem').css('display', '');
+ $('#navigation-problem_list').css('display', '');
$("#navigation-prolog").addClass("active");
$('#navigation-prolog').css('display', '');
@@ -98,8 +97,7 @@
subScreens = null;
jqScreen.addClass('block1');
- $('#navigation-language').css('display', 'none');
- $('#navigation-problem').css('display', 'none');
+ $('#navigation-problem_list').css('display', 'none');
$("#navigation-prolog").removeClass("active");
$('#navigation-prolog').css('display', 'none');
}
diff --git a/js/codeq/python.js b/js/codeq/python.js
index c3a76b9..35c4be8 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -72,8 +72,7 @@
var pythonHandler; //created when we enter the python state and destroyed once we leave it
codeq.globalStateMachine.register('python', {
'enter': function (problemDef, commonDef, currentSolution) {
- $('#navigation-language').css('display', '');
- $('#navigation-problem').css('display', '');
+ $('#navigation-problem_list').css('display', '');
$("#navigation-python").addClass("active");
$('#navigation-python').css('display', '');
@@ -108,8 +107,7 @@
subScreens = null;
jqScreen.addClass('block1');
- $('#navigation-language').css('display', 'none');
- $('#navigation-problem').css('display', 'none');
+ $('#navigation-problem_list').css('display', 'none');
$("#navigation-python").removeClass("active");
$('#navigation-python').css('display', 'none');
}
diff --git a/js/codeq/robot.js b/js/codeq/robot.js
index 5d86559..1188c7f 100644
--- a/js/codeq/robot.js
+++ b/js/codeq/robot.js
@@ -67,8 +67,7 @@
var robotHandler; //created when we enter the robot state and destroyed once we leave it
codeq.globalStateMachine.register('robot', {
'enter': function (problemDef, commonDef, currentSolution) {
- $('#navigation-language').css('display', '');
- $('#navigation-problem').css('display', '');
+ $('#navigation-problem_list').css('display', '');
$("#navigation-robot").addClass("active");
$('#navigation-robot').css('display', '');
@@ -103,8 +102,7 @@
subScreens = null;
jqScreen.addClass('block1');
- $('#navigation-language').css('display', 'none');
- $('#navigation-problem').css('display', 'none');
+ $('#navigation-problem_list').css('display', 'none');
$("#navigation-robot").removeClass("active");
$('#navigation-robot').css('display', 'none');
}