mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-26 10:58:49 +00:00
Created landing page script
This commit is contained in:
parent
9d0572cfa7
commit
6a738e6032
@ -328,7 +328,6 @@ var ComunicWeb = {
|
||||
*/
|
||||
pages:{
|
||||
|
||||
|
||||
/**
|
||||
* Home page
|
||||
*/
|
||||
@ -344,6 +343,13 @@ var ComunicWeb = {
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Landing home page
|
||||
*/
|
||||
landingPage:{
|
||||
//TODO : implement
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
16
assets/js/pages/home/landingPage.js
Normal file
16
assets/js/pages/home/landingPage.js
Normal 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.");
|
||||
}
|
||||
};
|
@ -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",
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user