mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Created discussions component element
This commit is contained in:
parent
93969fc9f1
commit
c27b2759b2
@ -470,7 +470,19 @@ var ComunicWeb = {
|
||||
bar:{
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Discussions
|
||||
*/
|
||||
discussions:{
|
||||
/**
|
||||
* Discussions manager
|
||||
*/
|
||||
manager:{
|
||||
//TODO : implement
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
31
assets/js/components/discussions/manager.js
Normal file
31
assets/js/components/discussions/manager.js
Normal 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;
|
||||
}
|
||||
}
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user