Created discussions component element

This commit is contained in:
Pierre 2017-06-03 18:18:43 +02:00
parent 93969fc9f1
commit c27b2759b2
4 changed files with 50 additions and 2 deletions

View File

@ -470,7 +470,19 @@ var ComunicWeb = {
bar:{
},
}
},
/**
* Discussions
*/
discussions:{
/**
* Discussions manager
*/
manager:{
//TODO : implement
},
},
},
/**

View File

@ -186,8 +186,12 @@ ComunicWeb.common.page = {
//We load specific components for logged in users
if(ComunicWeb.user.userLogin.getUserLoginState()){
//We load frieds list (if user is logged in)
//We load friends list (if user is logged in)
ComunicWeb.components.friends.bar.display();
//We load discussions manager (login required)
ComunicWeb.components.discussions.manager.display();
}
}

View File

@ -0,0 +1,31 @@
/**
* Discussions manager
*
* @author Pierre HUBERT
*/
ComunicWeb.components.discussions.manager = {
/**
* Display discussions manager
*
* @return {Boolean} True for a success
*/
display: function(){
//Try to get discussion manager
var discussionsContainerElem = byId("discussionsElem");
//Check if element exists or not
if(discussionsContainerElem){
ComunicWeb.debug.logMessage("NOTICE : couldn't initializate discussion manager because a discussion manager is already on the page");
return true;
}
//Else inform user and create discussion manager
ComunicWeb.debug.logMessage("INFO : initializate discussion manager");
//Success
return true;
}
}

View File

@ -72,6 +72,7 @@ $config['JSfiles'] = array(
"%PATH_ASSETS%js/components/menuBar/authenticated.js",
"%PATH_ASSETS%js/components/friends/friendsList.js",
"%PATH_ASSETS%js/components/friends/friendsBar.js",
"%PATH_ASSETS%js/components/discussions/manager.js",
//User scripts
"%PATH_ASSETS%js/user/loginTokens.js",