From c27b2759b247fa592f71e93661be58a93245bb03 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Jun 2017 18:18:43 +0200 Subject: [PATCH] Created discussions component element --- assets/js/common/functionsSchema.js | 14 +++++++++- assets/js/common/page.js | 6 +++- assets/js/components/discussions/manager.js | 31 +++++++++++++++++++++ corePage/config/dev.config.php | 1 + 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 assets/js/components/discussions/manager.js diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index 61ccceda..b058b157 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -470,7 +470,19 @@ var ComunicWeb = { bar:{ }, - } + }, + + /** + * Discussions + */ + discussions:{ + /** + * Discussions manager + */ + manager:{ + //TODO : implement + }, + }, }, /** diff --git a/assets/js/common/page.js b/assets/js/common/page.js index 4c24fbbe..9bbfdea9 100644 --- a/assets/js/common/page.js +++ b/assets/js/common/page.js @@ -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(); } } diff --git a/assets/js/components/discussions/manager.js b/assets/js/components/discussions/manager.js new file mode 100644 index 00000000..b51a87fb --- /dev/null +++ b/assets/js/components/discussions/manager.js @@ -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; + } +} \ No newline at end of file diff --git a/corePage/config/dev.config.php b/corePage/config/dev.config.php index fe10035a..0e5d319d 100644 --- a/corePage/config/dev.config.php +++ b/corePage/config/dev.config.php @@ -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",