From 02843ae55d8e87c5787cab8b9afb802ee73a29d1 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 18 Jan 2018 06:53:00 +0100 Subject: [PATCH] Created comments component. --- assets/js/common/functionsSchema.js | 28 ++++++++++++++++++++++ assets/js/components/comments/interface.js | 9 +++++++ assets/js/components/comments/ui.js | 23 ++++++++++++++++++ assets/js/components/comments/utils.js | 11 +++++++++ assets/js/components/posts/ui.js | 4 ++++ system/config/dev.config.php | 5 ++++ 6 files changed, 80 insertions(+) create mode 100644 assets/js/components/comments/interface.js create mode 100644 assets/js/components/comments/ui.js create mode 100644 assets/js/components/comments/utils.js diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index 5d651d97..5070a4dd 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -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 */ diff --git a/assets/js/components/comments/interface.js b/assets/js/components/comments/interface.js new file mode 100644 index 00000000..84b3cc59 --- /dev/null +++ b/assets/js/components/comments/interface.js @@ -0,0 +1,9 @@ +/** + * Comments interface with the server + * + * @author Pierre HUBERT + */ + +ComunicWeb.components.comments.interface = { + +}; \ No newline at end of file diff --git a/assets/js/components/comments/ui.js b/assets/js/components/comments/ui.js new file mode 100644 index 00000000..ce362d8a --- /dev/null +++ b/assets/js/components/comments/ui.js @@ -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 + + + }, + +} \ No newline at end of file diff --git a/assets/js/components/comments/utils.js b/assets/js/components/comments/utils.js new file mode 100644 index 00000000..4d7098e5 --- /dev/null +++ b/assets/js/components/comments/utils.js @@ -0,0 +1,11 @@ +/** + * Comments utilities + * + * @author Pierre HUBERT + */ + +ComunicWeb.components.comments.utils = { + + + +} \ No newline at end of file diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index 29c8dc77..b3360490 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -748,6 +748,10 @@ ComunicWeb.components.posts.ui = { userLiking, likesTarget ); + + //Load comments (if possible) + if(infos.comments != null) + ComunicWeb.components.comments.ui.display(infos.comments, infos.ID, postRoot); }, /** diff --git a/system/config/dev.config.php b/system/config/dev.config.php index 3d092568..288f1ed4 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -227,6 +227,11 @@ class Dev { "js/components/posts/form.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 "js/components/textarea.js",