summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-19 11:37:49 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-19 11:37:49 +0100
commita54ba81b9c25d1ed4685899762785550ddaea4fd (patch)
treea4b3ef7ba7c06bb6d052f13e2176c10e2567ee3d /js
parent9637157642b5c9a4ba1b7f928c4ab6fd29f96275 (diff)
Make language selection in login/signup tab-accessible
Diffstat (limited to 'js')
-rw-r--r--js/codeq/login.js11
-rw-r--r--js/codeq/signup.js8
-rw-r--r--js/codeq/upgrade_to_aai.js11
3 files changed, 27 insertions, 3 deletions
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 9d899c6..68cf14a 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -9,6 +9,7 @@
jqAAILoginBtn = $('#aai_login_button'),
jqSignupBtn = $('#signup_button'),
jqSubmitLoginBtn = $("#submit"),
+ jqLangSelect = jqScreen.find('.lang-select'),
jqDisabledOverlay = $('#disabled');
//the loginCallbackFunction is used here and in the AAI login as well
@@ -79,14 +80,19 @@
codeq.globalStateMachine.transition('aailogin');
e.preventDefault();
});
-
jqSubmitLoginBtn.on('click', loginFun);
formInputs.on('keyup', function (ev) {
if ((ev.keyCode || ev.which) == 13) {
jqSubmitLoginBtn.trigger('click');
}
});
- //$('#modalLogIn').modal();
+
+ // setup language selection links
+ jqLangSelect.on('click', function (e) {
+ codeq.setLang($(this).data('lang'));
+ e.preventDefault();
+ });
+
jqScreen.css('display', '');
jqDisabledOverlay.css('display', 'none');
},
@@ -96,6 +102,7 @@
formInputs.off('keyup');
jqSignupBtn.off('click');
jqAAILoginBtn.off('click');
+ jqLangSelect.off('click');
jqScreen.css('display', 'none');
$("#password").val('');
diff --git a/js/codeq/signup.js b/js/codeq/signup.js
index ad666a0..3498201 100644
--- a/js/codeq/signup.js
+++ b/js/codeq/signup.js
@@ -11,6 +11,7 @@
jqVerify = $("#modalSignUpVerify"),
jqFormSignUp = $('#formSignUp'),
jqExitSignUpBtn = $('#exit_signup_btn'),
+ jqLangSelect = jqScreen.find('.lang-select'),
jqNavBarRight = $('.nav.navbar-nav.navbar-right'),
jqNavigationHomeBtn = $('#navigation-home');
@@ -51,6 +52,12 @@
}
event.preventDefault(); // Prevent the form from submitting via the browser.
});
+
+ // setup language selection links
+ jqLangSelect.on('click', function (e) {
+ codeq.setLang($(this).data('lang'));
+ e.preventDefault();
+ });
},
'exit' : function(){
jqScreen.css('display', 'none');
@@ -62,6 +69,7 @@
//disable listeners on stuff from this page only
jqExitSignUpBtn.off('click');
jqFormSignUp.off('submit');
+ jqLangSelect.off('click');
//show the menu buttons
jqNavBarRight.css('display','');
diff --git a/js/codeq/upgrade_to_aai.js b/js/codeq/upgrade_to_aai.js
index 31c581a..e37761a 100644
--- a/js/codeq/upgrade_to_aai.js
+++ b/js/codeq/upgrade_to_aai.js
@@ -6,7 +6,8 @@
var jqScreen = $("#screen_upgrade_to_aai"),
jqForm = $('#formUpgradeToAAI'),
jqNoBtn = $('#btnUpgradeToAAINo'),
- jqPassword = $('#formUpgradeToAAIPassword') ;
+ jqPassword = $('#formUpgradeToAAIPassword'),
+ jqLangSelect = jqScreen.find('.lang-select');
codeq.globalStateMachine.register('upgradeToAAI',{
'enter': function(){
@@ -44,12 +45,20 @@
.done();
});
+
+ // setup language selection links
+ jqLangSelect.on('click', function (e) {
+ codeq.setLang($(this).data('lang'));
+ e.preventDefault();
+ });
+
jqScreen.css('display', '');
$('#disabled').css('display', 'none');
},
'exit' : function(){
jqNoBtn.off('click');
jqForm.off('submit');
+ jqLangSelect.off('click');
jqScreen.css('display', 'none');
jqPassword.val('');
}