Created conversations page

This commit is contained in:
Pierre 2018-05-13 14:06:32 +02:00
parent 1a922704ed
commit 1d9ae0dadd
7 changed files with 166 additions and 0 deletions

View File

@ -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;
}

View File

@ -1107,6 +1107,26 @@ var ComunicWeb = {
}, },
/**
* Conversations page
*/
conversations: {
/**
* Main script
*/
main: {
//TODO : implement
},
/**
* Conversations list pane
*/
listPane: {
//TODO : implement
}
},
/** /**
* User settings page * User settings page
*/ */

View File

@ -75,6 +75,21 @@ ComunicWeb.components.menuBar.authenticated = {
dropdownContent.className = "dropdown-menu" dropdownContent.className = "dropdown-menu"
dropdownContent.setAttribute("role", "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 //Add settings link
var settingsButton = createElem2({ var settingsButton = createElem2({
appendTo: dropdownContent, appendTo: dropdownContent,

View File

@ -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..."
});
}
}

View File

@ -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);
}
}

View File

@ -41,6 +41,15 @@ ComunicWeb.pagesList = {
disableMenus: false disableMenus: false
}, },
/**
* Conversations page
*/
conversations: {
pageTitle: "Conversations",
methodHandler: "ComunicWeb.pages.conversations.main.open",
disableMenus: false
},
/** /**
* User settings page * User settings page
*/ */

View File

@ -195,6 +195,9 @@ class Dev {
//Post page //Post page
"css/pages/postPage/main.css", "css/pages/postPage/main.css",
//Conversations page
"css/pages/conversations/main.css",
//Settings page //Settings page
//Sections sections //Sections sections
"css/pages/settings/sections/general.css", "css/pages/settings/sections/general.css",
@ -365,6 +368,10 @@ class Dev {
//Latest posts page //Latest posts page
"js/pages/latestPosts/main.js", "js/pages/latestPosts/main.js",
//Conversations page
"js/pages/conversations/main.js",
"js/pages/conversations/listPane.js",
//User settings page //User settings page
"js/pages/settings/main.js", "js/pages/settings/main.js",
"js/pages/settings/navigationPane.js", "js/pages/settings/navigationPane.js",