From 1d9ae0dadd4912029d7bd068ef45a071628b9fb3 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 13 May 2018 14:06:32 +0200 Subject: [PATCH] Created conversations page --- assets/css/pages/conversations/main.css | 17 ++++++ assets/js/common/functionsSchema.js | 20 +++++++ assets/js/components/menuBar/authenticated.js | 15 ++++++ assets/js/pages/conversations/listPane.js | 54 +++++++++++++++++++ assets/js/pages/conversations/main.js | 44 +++++++++++++++ assets/js/pagesList.js | 9 ++++ system/config/dev.config.php | 7 +++ 7 files changed, 166 insertions(+) create mode 100644 assets/css/pages/conversations/main.css create mode 100644 assets/js/pages/conversations/listPane.js create mode 100644 assets/js/pages/conversations/main.js diff --git a/assets/css/pages/conversations/main.css b/assets/css/pages/conversations/main.css new file mode 100644 index 00000000..0b7cfcbf --- /dev/null +++ b/assets/css/pages/conversations/main.css @@ -0,0 +1,17 @@ +/** + * Conversations page main script file + * + * @author Pierre HUBERT + */ + +.conversations-page-container { + max-width: 1000px; + margin: auto; + margin-top: 10px; +} + + +.conversations-page-container .conv-list-loading-msg { + text-align: center; + padding: 10px; +} \ No newline at end of file diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index 9c941549..580dd2f1 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -1107,6 +1107,26 @@ var ComunicWeb = { }, + /** + * Conversations page + */ + conversations: { + + /** + * Main script + */ + main: { + //TODO : implement + }, + + /** + * Conversations list pane + */ + listPane: { + //TODO : implement + } + }, + /** * User settings page */ diff --git a/assets/js/components/menuBar/authenticated.js b/assets/js/components/menuBar/authenticated.js index e0faa057..efd81412 100644 --- a/assets/js/components/menuBar/authenticated.js +++ b/assets/js/components/menuBar/authenticated.js @@ -75,6 +75,21 @@ ComunicWeb.components.menuBar.authenticated = { dropdownContent.className = "dropdown-menu" dropdownContent.setAttribute("role", "menu"); + + //Add conversations link + var conversationsButton = createElem2({ + appendTo: dropdownContent, + type: "li" + }); + var conversationsLink = createElem2({ + appendTo: conversationsButton, + type: "a", + innerHTML: "Conversations" + }); + conversationsButton.onclick = function(){ + openPage("conversations"); + }; + //Add settings link var settingsButton = createElem2({ appendTo: dropdownContent, diff --git a/assets/js/pages/conversations/listPane.js b/assets/js/pages/conversations/listPane.js new file mode 100644 index 00000000..6067fbc2 --- /dev/null +++ b/assets/js/pages/conversations/listPane.js @@ -0,0 +1,54 @@ +/** + * Conversations list pane + * + * @author Pierre HUBERT + */ + +ComunicWeb.pages.conversations.listPane = { + + /** + * Display the list of conversation + * + * @param {HTMLElement} target The target of the page + */ + display: function(target){ + + //Create the box + var listBox = createElem2({ + appendTo: target, + type: "div", + class: "box box-solid" + }); + + //Box header + var boxHeader = createElem2({ + appendTo: listBox, + type: "div", + class: "box-header with-border" + }); + + //Box title + createElem2({ + appendTo: boxHeader, + type: "h3", + class: "box-title", + innerHTML: "Conversations" + }); + + //Box body + var boxBody = createElem2({ + appendTo: listBox, + type: "div", + class: "box-body no-padding" + }); + + //Loading message + var loadingMsg = createElem2({ + appendTo: boxBody, + type: "div", + class: "conv-list-loading-msg", + innerHTML: "Loading, please wait..." + }); + } + +} \ No newline at end of file diff --git a/assets/js/pages/conversations/main.js b/assets/js/pages/conversations/main.js new file mode 100644 index 00000000..790a8f0f --- /dev/null +++ b/assets/js/pages/conversations/main.js @@ -0,0 +1,44 @@ +/** + * Conversation page main script file + * + * @author Pierre HUBERT + */ + +ComunicWeb.pages.conversations.main = { + /** + * Open settings page + * + * @param {object} args Optionnal arguments + * @param {HTMLElement} target The target for the page + */ + open: function(args, target){ + + //Conversation page is organized like an array with two columns + //Left column : the list of conversations + //Rigth column : the message of the currently opened conversation + + //Create a row + var row = createElem2({ + appendTo: target, + type: "div", + class: "row conversations-page-container" + }); + + //Left area: The list of conversations + var leftArea = createElem2({ + appendTo: row, + type: "div", + class: "col-md-3" + }); + + //Right area : The conversations + var rightArea = createElem2({ + appendTo: row, + type: "div", + class: "col-md-9" + }); + + //Display the list of conversation + ComunicWeb.pages.conversations.listPane.display(leftArea); + } +} \ No newline at end of file diff --git a/assets/js/pagesList.js b/assets/js/pagesList.js index c0e50979..314815c7 100644 --- a/assets/js/pagesList.js +++ b/assets/js/pagesList.js @@ -41,6 +41,15 @@ ComunicWeb.pagesList = { disableMenus: false }, + /** + * Conversations page + */ + conversations: { + pageTitle: "Conversations", + methodHandler: "ComunicWeb.pages.conversations.main.open", + disableMenus: false + }, + /** * User settings page */ diff --git a/system/config/dev.config.php b/system/config/dev.config.php index f1d6f5c9..397a128b 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -195,6 +195,9 @@ class Dev { //Post page "css/pages/postPage/main.css", + //Conversations page + "css/pages/conversations/main.css", + //Settings page //Sections sections "css/pages/settings/sections/general.css", @@ -365,6 +368,10 @@ class Dev { //Latest posts page "js/pages/latestPosts/main.js", + //Conversations page + "js/pages/conversations/main.js", + "js/pages/conversations/listPane.js", + //User settings page "js/pages/settings/main.js", "js/pages/settings/navigationPane.js",