mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Created landing page script
This commit is contained in:
parent
9d0572cfa7
commit
6a738e6032
@ -328,7 +328,6 @@ var ComunicWeb = {
|
|||||||
*/
|
*/
|
||||||
pages:{
|
pages:{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Home page
|
* 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
|
//Check wether if user is logged in or not
|
||||||
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
|
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
|
||||||
|
|
||||||
//Dev feature : Show result
|
//Check if user is in or not
|
||||||
if(userLoggedIn){
|
if(userLoggedIn){
|
||||||
|
//Dev feature : Show result
|
||||||
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User logged in !", "info"));
|
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User logged in !", "info"));
|
||||||
|
|
||||||
//Create logout button
|
//Create logout button
|
||||||
@ -28,15 +29,8 @@ ComunicWeb.pages.home.home = {
|
|||||||
targetElement.appendChild(loginButton);
|
targetElement.appendChild(loginButton);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
targetElement.appendChild(ComunicWeb.common.messages.createCalloutElem("", "User not logged in !", "warning"));
|
//Display landing page
|
||||||
|
ComunicWeb.pages.home.landingPage.display(targetElement);
|
||||||
//Create login button
|
|
||||||
var loginButton = document.createElement("button");
|
|
||||||
loginButton.onclick = (function(){
|
|
||||||
ComunicWeb.common.page.openPage("login");
|
|
||||||
});
|
|
||||||
loginButton.innerHTML="Login";
|
|
||||||
targetElement.appendChild(loginButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Everything seems to be OK
|
//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
|
//Pages scripts
|
||||||
"%PATH_ASSETS%js/pages/home/home.js",
|
"%PATH_ASSETS%js/pages/home/home.js",
|
||||||
|
"%PATH_ASSETS%js/pages/home/landingPage.js",
|
||||||
"%PATH_ASSETS%js/pages/login.js",
|
"%PATH_ASSETS%js/pages/login.js",
|
||||||
"%PATH_ASSETS%js/pages/logout.js",
|
"%PATH_ASSETS%js/pages/logout.js",
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user