Prepare login page

This commit is contained in:
Pierre 2017-02-18 18:37:36 +01:00
parent 1fb2507742
commit 7ead57ce24
6 changed files with 47 additions and 2 deletions

View File

@ -246,6 +246,11 @@ var ComunicWeb = {
* Try to login user
*/
loginUser: function(usermail, userpassword, permanentLogin, afterLogin){},
/**
* Logout user
*/
logoutUser: function(afterLogout){},
},
/**
@ -278,5 +283,15 @@ var ComunicWeb = {
},
},
/**
* Login controller
*/
login:{
/**
* Open login page
*/
openLoginPage: function(additionnalData, targetElement){},
}
},
}

View File

@ -94,11 +94,11 @@ ComunicWeb.common.page = {
document.title = pageInfos.pageTitle;
//Get the main contener of the page
var mainContenerElem = document.getElementById("wrapper");
//var mainContenerElem = document.getElementById("wrapper");
//If we didn't get anything, clean the page and create a wrapper element
if(!mainContenerElem){
mainContenerElem = this.emptyPage(true);
var mainContenerElem = this.emptyPage(true);
}
//Check if some additionnal data was specified

View File

@ -1,9 +1,12 @@
/**
* Common homes functions
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.home.home = {
/**
* Open home page
*
* @param {Object} additionnalData Additionnal data passed in the method
* @param {element} targetElement Where the template will be applied
* @returns {Boolean} False if it fails

18
assets/js/pages/login.js Normal file
View File

@ -0,0 +1,18 @@
/**
* Login page controller
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.login = {
/**
* Open login page
*
* @param {Object} additionnalData Additionnal data passed in the method
* @param {element} targetElement Where the template will be applied
* @returns {Boolean} False if it fails
*/
openLoginPage: function(additionnalData, targetElement){
alert("login page to open !");
}
};

View File

@ -13,6 +13,14 @@ ComunicWeb.pagesList = {
methodHandler: "ComunicWeb.pages.home.home.openHomePage",
},
/**
* Login page
*/
login: {
pageTitle: "Login page",
methodHandler: "ComunicWeb.pages.login.openLoginPage",
},
/**
* 404 Page not found
*/

View File

@ -49,6 +49,7 @@ $config['JSfiles'] = array(
//Pages scripts
"%PATH_ASSETS%js/pages/home/home.js",
"%PATH_ASSETS%js/pages/login.js",
//Init script
"%PATH_ASSETS%js/init.js",