Created landing page script

This commit is contained in:
Pierre 2017-05-22 18:12:50 +02:00
parent 9d0572cfa7
commit 6a738e6032
4 changed files with 28 additions and 11 deletions

View File

@ -328,7 +328,6 @@ var ComunicWeb = {
*/
pages:{
/**
* Home page
*/
@ -344,6 +343,13 @@ var ComunicWeb = {
},
/**
* Landing home page
*/
landingPage:{
//TODO : implement
}
},
/**

View File

@ -15,8 +15,9 @@ ComunicWeb.pages.home.home = {
//Check wether if user is logged in or not
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
//Dev feature : Show result
//Check if user is in or not
if(userLoggedIn){
//Dev feature : Show result
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User logged in !", "info"));
//Create logout button
@ -28,15 +29,8 @@ ComunicWeb.pages.home.home = {
targetElement.appendChild(loginButton);
}
else{
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User not logged in !", "warning"));
//Create login button
var loginButton = document.createElement("button");
loginButton.onclick = (function(){
ComunicWeb.common.page.openPage("login");
});
loginButton.innerHTML="Login";
targetElement.appendChild(loginButton);
//Display landing page
ComunicWeb.pages.home.landingPage.display(targetElement);
}
//Everything seems to be OK

View File

@ -0,0 +1,16 @@
/**
* Landing home page
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.home.landingPage = {
/**
* Display home landing page
*
* @param {element} targetElement Where the page will be applied
*/
display: function(targetElement){
//Log action
ComunicWeb.debug.logMessage("Open home landing page.");
}
};

View File

@ -62,6 +62,7 @@ $config['JSfiles'] = array(
//Pages scripts
"%PATH_ASSETS%js/pages/home/home.js",
"%PATH_ASSETS%js/pages/home/landingPage.js",
"%PATH_ASSETS%js/pages/login.js",
"%PATH_ASSETS%js/pages/logout.js",