Created comments component.

This commit is contained in:
Pierre 2018-01-18 06:53:00 +01:00
parent 531fd0305b
commit 02843ae55d
6 changed files with 80 additions and 0 deletions

View File

@ -700,6 +700,34 @@ var ComunicWeb = {
}, },
/**
* Comments component
*/
comments: {
/**
* Comments UI interface
*/
ui:{
//TODO : implement
},
/**
* Comments interface
*/
interface: {
//TODO : implement
},
/**
* Comments utilities
*/
utils: {
//TODO : implement
}
},
/** /**
* Modern textarea handler * Modern textarea handler
*/ */

View File

@ -0,0 +1,9 @@
/**
* Comments interface with the server
*
* @author Pierre HUBERT
*/
ComunicWeb.components.comments.interface = {
};

View File

@ -0,0 +1,23 @@
/**
* Comments UI
*
* @author Pierre HUBERT
*/
ComunicWeb.components.comments.ui = {
/**
* Display a list comments
*
* @param {Object} infos Informations about the comments
* @param {int} postID The ID of the post attached to the comments
* @param {HTMLElement} target The target for the comments
*/
display: function(infos, postID, target){
//First, get informations about the users
},
}

View File

@ -0,0 +1,11 @@
/**
* Comments utilities
*
* @author Pierre HUBERT
*/
ComunicWeb.components.comments.utils = {
}

View File

@ -748,6 +748,10 @@ ComunicWeb.components.posts.ui = {
userLiking, userLiking,
likesTarget likesTarget
); );
//Load comments (if possible)
if(infos.comments != null)
ComunicWeb.components.comments.ui.display(infos.comments, infos.ID, postRoot);
}, },
/** /**

View File

@ -227,6 +227,11 @@ class Dev {
"js/components/posts/form.js", "js/components/posts/form.js",
"js/components/posts/edit.js", "js/components/posts/edit.js",
//Comments component
"js/components/comments/ui.js",
"js/components/comments/interface.js",
"js/components/comments/utils.js",
//Modern textarea handler //Modern textarea handler
"js/components/textarea.js", "js/components/textarea.js",