mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Added comments component translation.
This commit is contained in:
		@@ -25,7 +25,7 @@ ComunicWeb.components.comments.actions = {
 | 
			
		||||
 | 
			
		||||
			//Check for errors
 | 
			
		||||
			if(result.error){
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification("Couldn't get informations about a comment !", "danger");
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification(lang("comments_actions_err_get_info_single"), "danger");
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ ComunicWeb.components.comments.editor = {
 | 
			
		||||
 | 
			
		||||
				//Check for error
 | 
			
		||||
				if(result.error){
 | 
			
		||||
					ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to update comment content !", "danger");
 | 
			
		||||
					ComunicWeb.common.notificationSystem.showNotification(lang("comments_editor_err_update"), "danger");
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
@@ -39,8 +39,8 @@ ComunicWeb.components.comments.editor = {
 | 
			
		||||
 | 
			
		||||
		//Prompt the user to enter the new content of the comment
 | 
			
		||||
		ComunicWeb.common.messages.inputString(
 | 
			
		||||
			"Edit comment content",
 | 
			
		||||
			"Please specify the new content of the comment: ",
 | 
			
		||||
			lang("comments_editor_title"),
 | 
			
		||||
			lang("comments_editor_notice"),
 | 
			
		||||
			infos.content,
 | 
			
		||||
			inputCallback
 | 
			
		||||
		);
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ ComunicWeb.components.comments.form = {
 | 
			
		||||
			type: "input",
 | 
			
		||||
			elemType: "text",
 | 
			
		||||
			class: "form-control",
 | 
			
		||||
			placeholder: "New comment...",
 | 
			
		||||
			placeholder: lang("comments_form_input_placeholder"),
 | 
			
		||||
			name: "content"
 | 
			
		||||
		});
 | 
			
		||||
		newCommentText.maxLength = 255;
 | 
			
		||||
@@ -106,7 +106,7 @@ ComunicWeb.components.comments.form = {
 | 
			
		||||
			appendTo: buttonsGroup,
 | 
			
		||||
			type: "button",
 | 
			
		||||
			class: "btn btn-default btn-flat",
 | 
			
		||||
			innerHTML: "Send"
 | 
			
		||||
			innerHTML: lang("comments_form_send")
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Catch form when submitted
 | 
			
		||||
@@ -117,7 +117,7 @@ ComunicWeb.components.comments.form = {
 | 
			
		||||
 | 
			
		||||
			//Check the comment
 | 
			
		||||
			if(!hasImage && newCommentText.value < 5){
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification("Please type a valid comment! (at least 5 characters)", "danger");
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification(lang("comments_form_err_invalid_comment"), "danger");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -140,7 +140,7 @@ ComunicWeb.components.comments.form = {
 | 
			
		||||
 | 
			
		||||
				//Check for errors
 | 
			
		||||
				if(result.error){
 | 
			
		||||
					ComunicWeb.common.notificationSystem.showNotification("Couldn't create comment! (check its content)", "danger");
 | 
			
		||||
					ComunicWeb.common.notificationSystem.showNotification(lang("comments_form_err_create_comment"), "danger");
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ ComunicWeb.components.comments.ui = {
 | 
			
		||||
			
 | 
			
		||||
			//Check for errors
 | 
			
		||||
			if(result.error){
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification("Couldn't informations about some users to display their comments !", "danger");
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_get_users_info"), "danger");
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -75,7 +75,7 @@ ComunicWeb.components.comments.ui = {
 | 
			
		||||
 | 
			
		||||
			//Check for errors
 | 
			
		||||
			if(result.error){
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification("Couldn't get informations about a user!", "danger");
 | 
			
		||||
				ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_get_user_info"), "danger");
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -191,7 +191,7 @@ ComunicWeb.components.comments.ui = {
 | 
			
		||||
			//Make delete button lives
 | 
			
		||||
			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(lang("comments_ui_confirm_delete"), function(response){
 | 
			
		||||
 | 
			
		||||
					//Check if user cancelled the operation
 | 
			
		||||
					if(!response)
 | 
			
		||||
@@ -207,7 +207,7 @@ ComunicWeb.components.comments.ui = {
 | 
			
		||||
 | 
			
		||||
						//Check for errors
 | 
			
		||||
						if(response.error){
 | 
			
		||||
							ComunicWeb.common.notificationSystem.showNotification("Could not delete comment!", "danger");
 | 
			
		||||
							ComunicWeb.common.notificationSystem.showNotification(lang("comments_ui_err_delete_comment"), "danger");
 | 
			
		||||
							return;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user