2017-05-24 12:31:56 +00:00
|
|
|
/**
|
|
|
|
* Not authenticated menu bar components
|
|
|
|
*
|
|
|
|
* @author Pierre HUBERT
|
|
|
|
*/
|
|
|
|
|
|
|
|
ComunicWeb.components.menuBar.notAuthenticated = {
|
|
|
|
/**
|
|
|
|
* Add not-authenticated user specific elements
|
|
|
|
*
|
2017-05-24 14:21:34 +00:00
|
|
|
* @param {HTMLElement} container The container element of the Menubar
|
2017-05-24 12:31:56 +00:00
|
|
|
*/
|
2017-05-24 14:21:34 +00:00
|
|
|
addElements: function(container){
|
|
|
|
|
|
|
|
//Create an auto-collapsed element
|
|
|
|
var navbarCollapse = createElem("div", container);
|
|
|
|
navbarCollapse.id = "navbar-collapse";
|
|
|
|
navbarCollapse.className = "navbar-collapse pull-right collapse";
|
|
|
|
|
|
|
|
//Create login form
|
|
|
|
var loginForm = createElem("form", navbarCollapse);
|
|
|
|
loginForm.className = "navbar-form navbar-left menubar-loginForm";
|
|
|
|
loginForm.setAttribute("role", "login");
|
|
|
|
|
|
|
|
loginForm.onsubmit = function(){
|
2017-05-24 14:37:41 +00:00
|
|
|
//Try to login user; in case of failure redirect to login page
|
|
|
|
|
|
|
|
return false;
|
2017-05-24 14:21:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Add email address formGroup
|
|
|
|
var emailFormGroup = createElem("div", loginForm);
|
|
|
|
emailFormGroup.className = "form-group";
|
|
|
|
|
|
|
|
//Add email input
|
|
|
|
var emailInput = createElem("input", emailFormGroup);
|
|
|
|
emailInput.className = "form-control";
|
|
|
|
emailInput.placeholder = "Email address";
|
|
|
|
emailInput.type = "email";
|
|
|
|
|
|
|
|
//Add password formGroup
|
|
|
|
var passwordFormGroup = createElem("div", loginForm);
|
|
|
|
passwordFormGroup.className = "form-group";
|
|
|
|
|
|
|
|
//Add password input
|
|
|
|
var passwordInput = createElem("input", passwordFormGroup);
|
|
|
|
passwordInput.className = "form-control";
|
|
|
|
passwordInput.placeholder = "Password";
|
|
|
|
passwordInput.type = "password";
|
|
|
|
|
|
|
|
//Add submit button formGroup
|
|
|
|
var submitFromGroup = createElem("div", loginForm);
|
|
|
|
submitFromGroup.className = "form-group";
|
|
|
|
|
|
|
|
//Add submit input
|
|
|
|
var submitInput = createElem("input", submitFromGroup);
|
|
|
|
submitInput.className = "form-control";
|
|
|
|
submitInput.value = "Login";
|
|
|
|
submitInput.type = "submit";
|
2017-05-24 12:31:56 +00:00
|
|
|
}
|
|
|
|
}
|