mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-29 15:26:27 +00:00
Can create conversations windows
This commit is contained in:
parent
80566edced
commit
0d804dbdf7
@ -7,10 +7,10 @@
|
|||||||
#discussionsElem {
|
#discussionsElem {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
width: 100%;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
|
right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#discussionsElem .open-conversation-button {
|
#discussionsElem .open-conversation-button {
|
||||||
@ -18,4 +18,5 @@
|
|||||||
border-top-right-radius: 2px;
|
border-top-right-radius: 2px;
|
||||||
border-bottom-left-radius: 0px;
|
border-bottom-left-radius: 0px;
|
||||||
border-bottom-right-radius: 0px;
|
border-bottom-right-radius: 0px;
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
15
assets/css/components/discussions/windows.css
Normal file
15
assets/css/components/discussions/windows.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Conversation window
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#discussionsElem .box {
|
||||||
|
width: 250px;
|
||||||
|
height: 350px;
|
||||||
|
max-width: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 5px;
|
||||||
|
text-align: justify;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
@ -482,6 +482,20 @@ var ComunicWeb = {
|
|||||||
manager:{
|
manager:{
|
||||||
//TODO : implement
|
//TODO : implement
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Discussions list windo
|
||||||
|
*/
|
||||||
|
list:{
|
||||||
|
//TODO : implement
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Discussiosn windows manager
|
||||||
|
*/
|
||||||
|
windows:{
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
31
assets/js/components/discussions/list.js
Normal file
31
assets/js/components/discussions/list.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* Discussions list window
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
ComunicWeb.components.discussions.list = {
|
||||||
|
/**
|
||||||
|
* Display discussions list window
|
||||||
|
*
|
||||||
|
* @param {HTMLElement} nodeBefore The node before the destination
|
||||||
|
* @return {Boolean} True for a success
|
||||||
|
*/
|
||||||
|
display: function(nodeBefore){
|
||||||
|
|
||||||
|
//Log action
|
||||||
|
ComunicWeb.debug.logMessage("INFO : initialize conversation list box.");
|
||||||
|
|
||||||
|
//Create a window
|
||||||
|
var listBox = ComunicWeb.components.discussions.windows.create(nodeBefore);
|
||||||
|
|
||||||
|
//Change box title
|
||||||
|
listBox.boxTitle.innerHTML = "Discussions";
|
||||||
|
|
||||||
|
//Remove footer
|
||||||
|
listBox.boxFooter.remove();
|
||||||
|
|
||||||
|
//Success
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
}
|
@ -76,7 +76,7 @@ ComunicWeb.components.discussions.manager = {
|
|||||||
|
|
||||||
//Temporary behavior
|
//Temporary behavior
|
||||||
addButton.onclick = function(){
|
addButton.onclick = function(){
|
||||||
alert("Open a conversation !");
|
ComunicWeb.components.discussions.list.display(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
69
assets/js/components/discussions/windows.js
Normal file
69
assets/js/components/discussions/windows.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* Discussions windows manager
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
ComunicWeb.components.discussions.windows = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new conversation window
|
||||||
|
*
|
||||||
|
* @param {HTMLElement} nodeBefore The node before the destination window
|
||||||
|
* @return {Object} Differents elements of the window
|
||||||
|
*/
|
||||||
|
create: function(nodeBefore){
|
||||||
|
//Create listbox element
|
||||||
|
var discussionBox = createElem("div", nodeBefore.parentNode);
|
||||||
|
discussionBox.className = "box box-primary";
|
||||||
|
|
||||||
|
//Create close box function
|
||||||
|
var closeBox = function(){
|
||||||
|
discussionBox.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create box header
|
||||||
|
var boxHeader = createElem("div", discussionBox);
|
||||||
|
boxHeader.className = "box-header with-border";
|
||||||
|
|
||||||
|
//Add box title
|
||||||
|
var boxTitle = createElem("h3", boxHeader);
|
||||||
|
boxTitle.className = "box-title";
|
||||||
|
|
||||||
|
|
||||||
|
//Box tools
|
||||||
|
var boxTools = createElem("div", boxHeader);
|
||||||
|
boxTools.className = "box-tools pull-right";
|
||||||
|
|
||||||
|
//Close button
|
||||||
|
var closeButton = createElem("button", boxTools);
|
||||||
|
closeButton.className = "btn btn-box-tool";
|
||||||
|
closeButton.onclick = closeBox;
|
||||||
|
|
||||||
|
//Close icon
|
||||||
|
var closeIcon = createElem("i", closeButton);
|
||||||
|
closeIcon.className = "fa fa-times";
|
||||||
|
|
||||||
|
//Box body
|
||||||
|
var boxBody = createElem("div", discussionBox);
|
||||||
|
boxBody.className = "box-body";
|
||||||
|
|
||||||
|
//Box footer
|
||||||
|
var boxFooter = createElem("div", discussionBox);
|
||||||
|
boxFooter.className = "box-footer";
|
||||||
|
|
||||||
|
//Prepare return
|
||||||
|
var boxElements ={
|
||||||
|
rootElem: discussionBox,
|
||||||
|
closeFunction: closeBox,
|
||||||
|
boxTitle: boxTitle,
|
||||||
|
boxTools: boxTools,
|
||||||
|
boxBody: boxBody,
|
||||||
|
boxFooter: boxFooter,
|
||||||
|
};
|
||||||
|
|
||||||
|
//Return elements
|
||||||
|
return boxElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -27,6 +27,7 @@ $config['CSSfiles'] = array(
|
|||||||
"%PATH_ASSETS%css/components/searchForm.css",
|
"%PATH_ASSETS%css/components/searchForm.css",
|
||||||
"%PATH_ASSETS%css/components/friends/friendsBar.css",
|
"%PATH_ASSETS%css/components/friends/friendsBar.css",
|
||||||
"%PATH_ASSETS%css/components/discussions/manager.css",
|
"%PATH_ASSETS%css/components/discussions/manager.css",
|
||||||
|
"%PATH_ASSETS%css/components/discussions/windows.css",
|
||||||
);
|
);
|
||||||
|
|
||||||
//JS files to include (at the end of the page)
|
//JS files to include (at the end of the page)
|
||||||
@ -74,6 +75,8 @@ $config['JSfiles'] = array(
|
|||||||
"%PATH_ASSETS%js/components/friends/friendsList.js",
|
"%PATH_ASSETS%js/components/friends/friendsList.js",
|
||||||
"%PATH_ASSETS%js/components/friends/friendsBar.js",
|
"%PATH_ASSETS%js/components/friends/friendsBar.js",
|
||||||
"%PATH_ASSETS%js/components/discussions/manager.js",
|
"%PATH_ASSETS%js/components/discussions/manager.js",
|
||||||
|
"%PATH_ASSETS%js/components/discussions/list.js",
|
||||||
|
"%PATH_ASSETS%js/components/discussions/windows.js",
|
||||||
|
|
||||||
//User scripts
|
//User scripts
|
||||||
"%PATH_ASSETS%js/user/loginTokens.js",
|
"%PATH_ASSETS%js/user/loginTokens.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user