mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Added edit comment button.
This commit is contained in:
		@@ -18,11 +18,13 @@
 | 
				
			|||||||
	float: none;
 | 
						float: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.post-comments .delete-comment-link {
 | 
					.post-comments .delete-comment-link,
 | 
				
			||||||
 | 
					.post-comments .edit-comment-link {
 | 
				
			||||||
	margin-left: 5px;
 | 
						margin-left: 5px;
 | 
				
			||||||
	color: #b5bbc8;
 | 
						color: #b5bbc8;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.post-comments .delete-comment-link:active {
 | 
					.post-comments .delete-comment-link:active,
 | 
				
			||||||
 | 
					.post-comments .edit-comment-link:active {
 | 
				
			||||||
	color: black;
 | 
						color: black;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -110,9 +110,26 @@ ComunicWeb.components.comments.ui = {
 | 
				
			|||||||
			innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.time_sent) + " ago"
 | 
								innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.time_sent) + " ago"
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Offer the user the possibility to delete the comment if he is allowed to do so
 | 
							//Offer the user the possibility to delete and update the comment if he is allowed to do so
 | 
				
			||||||
		if(userID() == infos.userID){
 | 
							if(userID() == infos.userID){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								//Create a button to update the comment
 | 
				
			||||||
 | 
								var editCommentLink = createElem2({
 | 
				
			||||||
 | 
									appendTo: rightContener,
 | 
				
			||||||
 | 
									type: "a",
 | 
				
			||||||
 | 
									class: "edit-comment-link"
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								createElem2({
 | 
				
			||||||
 | 
									appendTo: deleteCommentLink,
 | 
				
			||||||
 | 
									type: "i",
 | 
				
			||||||
 | 
									class: "fa fa-edit"
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								//Make edit button lives
 | 
				
			||||||
 | 
								//Open in editor (separate file)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Create a button to delete the comment
 | 
								//Create a button to delete the comment
 | 
				
			||||||
			var deleteCommentLink = createElem2({
 | 
								var deleteCommentLink = createElem2({
 | 
				
			||||||
				appendTo: rightContener,
 | 
									appendTo: rightContener,
 | 
				
			||||||
@@ -126,7 +143,7 @@ ComunicWeb.components.comments.ui = {
 | 
				
			|||||||
				class: "fa fa-trash"
 | 
									class: "fa fa-trash"
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Make button lives
 | 
								//Make delete button lives
 | 
				
			||||||
			deleteCommentLink.onclick = function(){
 | 
								deleteCommentLink.onclick = function(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				ComunicWeb.common.messages.confirm("Are you sure do you want to delete this comment ? This operation is unrecoverable!", function(response){
 | 
									ComunicWeb.common.messages.confirm("Are you sure do you want to delete this comment ? This operation is unrecoverable!", function(response){
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user