mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Created comments component.
This commit is contained in:
		@@ -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
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								assets/js/components/comments/interface.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								assets/js/components/comments/interface.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Comments interface with the server
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 | 
					 * @author Pierre HUBERT
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ComunicWeb.components.comments.interface = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										23
									
								
								assets/js/components/comments/ui.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								assets/js/components/comments/ui.js
									
									
									
									
									
										Normal 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
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										11
									
								
								assets/js/components/comments/utils.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								assets/js/components/comments/utils.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Comments utilities
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 | 
					 * @author Pierre HUBERT
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ComunicWeb.components.comments.utils = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -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);
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user