From 68847b98e7b7804656e2abe09190a1b3553dbfc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Pu=C5=A1nik?= Date: Tue, 29 Sep 2015 13:12:02 +0200 Subject: logout, sign in + change password modals, setting drop-down, profile screen --- js/codeq/core.js | 4 +++- js/codeq/login.js | 1 + js/codeq/navigation.js | 9 +++++++++ js/codeq/statusbar.js | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/codeq/core.js b/js/codeq/core.js index 1685dd7..3dfa7c2 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -389,5 +389,7 @@ codeq.setLang(lang || 'en'); // initial language setting // go to login codeq.globalStateMachine.transition('login'); - }); + + //For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself. + $('[data-toggle="popover"]').popover()}); })(); diff --git a/js/codeq/login.js b/js/codeq/login.js index c400f06..f590acb 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -29,6 +29,7 @@ codeq.globalStateMachine.register('login',{ 'enter': function(){ $("#submit").on('click', loginFun); + //$('#modalLogin').modal(); $("#screen_login").css('display', ''); $('#disabled').css('display', 'none'); diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js index 1a7799f..80fd321 100644 --- a/js/codeq/navigation.js +++ b/js/codeq/navigation.js @@ -97,4 +97,13 @@ codeq.globalStateMachine.transition('prolog'); e.preventDefault(); }); + $('#navigation-logout').on('click', function(e){ + codeq.globalStateMachine.transition('login'); + e.preventDefault();//prevent this since we'll trigger a page reload otherwise + }); + $('#navigation-profile').on('click', function(e){ + codeq.globalStateMachine.transition('profile'); + e.preventDefault();//prevent this since we'll trigger a page reload otherwise + }); + })(); \ No newline at end of file diff --git a/js/codeq/statusbar.js b/js/codeq/statusbar.js index 2134b93..56070bd 100644 --- a/js/codeq/statusbar.js +++ b/js/codeq/statusbar.js @@ -6,7 +6,7 @@ (function () { var langs = codeq.supportedLangs, - jqMenu = jqBar.find('.dropdown-menu'), + jqMenu = jqLang.find('.dropdown-menu'), lang, cssClass; for (lang in langs) { if (!langs.hasOwnProperty(lang)) continue; -- cgit v1.2.1