mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Created conversations page
This commit is contained in:
		
							
								
								
									
										54
									
								
								assets/js/pages/conversations/listPane.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								assets/js/pages/conversations/listPane.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Conversations list pane
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.conversations.listPane = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Display the list of conversation
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {HTMLElement} target The target of the page
 | 
			
		||||
	 */
 | 
			
		||||
	display: function(target){
 | 
			
		||||
 | 
			
		||||
		//Create the box
 | 
			
		||||
		var listBox = createElem2({
 | 
			
		||||
			appendTo: target,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "box box-solid"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Box header
 | 
			
		||||
		var boxHeader = createElem2({
 | 
			
		||||
			appendTo: listBox,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "box-header with-border"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Box title
 | 
			
		||||
		createElem2({
 | 
			
		||||
			appendTo: boxHeader,
 | 
			
		||||
			type: "h3",
 | 
			
		||||
			class: "box-title",
 | 
			
		||||
			innerHTML: "Conversations"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Box body
 | 
			
		||||
		var boxBody = createElem2({
 | 
			
		||||
			appendTo: listBox,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "box-body no-padding"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Loading message
 | 
			
		||||
		var loadingMsg = createElem2({
 | 
			
		||||
			appendTo: boxBody,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "conv-list-loading-msg",
 | 
			
		||||
			innerHTML: "Loading, please wait..."
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								assets/js/pages/conversations/main.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								assets/js/pages/conversations/main.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Conversation page main script file
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.conversations.main = {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Open settings page
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {object} args Optionnal arguments
 | 
			
		||||
	 * @param {HTMLElement} target The target for the page
 | 
			
		||||
	 */
 | 
			
		||||
	open: function(args, target){
 | 
			
		||||
 | 
			
		||||
		//Conversation page is organized like an array with two columns
 | 
			
		||||
		//Left column : the list of conversations
 | 
			
		||||
		//Rigth column : the message of the currently opened conversation
 | 
			
		||||
 | 
			
		||||
		//Create a row
 | 
			
		||||
		var row = createElem2({
 | 
			
		||||
			appendTo: target,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "row conversations-page-container"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Left area: The list of conversations
 | 
			
		||||
		var leftArea = createElem2({
 | 
			
		||||
			appendTo: row,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "col-md-3"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Right area : The conversations
 | 
			
		||||
		var rightArea = createElem2({
 | 
			
		||||
			appendTo: row,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "col-md-9"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Display the list of conversation
 | 
			
		||||
		ComunicWeb.pages.conversations.listPane.display(leftArea);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user