From 3dfd91102fb22152e63adf2a2160a4a0e4d27d99 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 5 Mar 2018 18:50:56 +0100 Subject: [PATCH] Created friends list modal script file --- assets/js/common/functionsSchema.js | 7 +++++++ assets/js/components/friends/listModal.js | 18 ++++++++++++++++++ assets/js/pages/userPage/profileInfos.js | 9 ++++++++- system/config/dev.config.php | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 assets/js/components/friends/listModal.js diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index fba0296d..b84d62dd 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -548,6 +548,13 @@ var ComunicWeb = { bar:{ //TODO : implement }, + + /** + * Friends list modal box + */ + listModal: { + //TODO : implement + } }, /** diff --git a/assets/js/components/friends/listModal.js b/assets/js/components/friends/listModal.js new file mode 100644 index 00000000..57f49d26 --- /dev/null +++ b/assets/js/components/friends/listModal.js @@ -0,0 +1,18 @@ +/** + * Friends list modal + * + * @author Pierre HUBERT + */ + +ComunicWeb.components.friends.listModal = { + + /** + * Display the box that contains the list of friends of the user + * + * @param {number} userID The ID of the target user + */ + display: function(userID){ + alert(userID); + } + +}; \ No newline at end of file diff --git a/assets/js/pages/userPage/profileInfos.js b/assets/js/pages/userPage/profileInfos.js index f986debe..e78d1e1b 100644 --- a/assets/js/pages/userPage/profileInfos.js +++ b/assets/js/pages/userPage/profileInfos.js @@ -108,13 +108,20 @@ ComunicWeb.pages.userPage.profileInfos = { type: "b", innerHTML: "Friends" }); - createElem2({ + var friendsListLink = createElem2({ appendTo: friendsLi, type: "a", class: "pull-right", innerHTML: infos.number_friends }); + //Make the user number lives + friendsListLink.onclick = function(){ + + ComunicWeb.components.friends.listModal.display(infos.userID); + + }; + //Add user status informations (if required) if(signed_in()){ if(userID() != infos.userID){ diff --git a/system/config/dev.config.php b/system/config/dev.config.php index 7aac1138..e0ec5c46 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -213,6 +213,7 @@ class Dev { //Friends components "js/components/friends/friendsList.js", "js/components/friends/friendsBar.js", + "js/components/friends/listModal.js", //Private conversations "js/components/conversations/manager.js",