mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Ready to implement call system
This commit is contained in:
		
							
								
								
									
										18
									
								
								assets/js/components/calls/controller.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								assets/js/components/calls/controller.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Calls controller
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre Hubert
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
class CallsController {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Open a call for a conversation
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {Conversation} conv Information about the target conversation
 | 
			
		||||
	 */
 | 
			
		||||
	static Open(conv) {
 | 
			
		||||
		alert("Open call for conversation " + conv.ID);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -585,11 +585,11 @@ const ConvChatWindow = {
 | 
			
		||||
	showCallButton: function(conversation){
 | 
			
		||||
 | 
			
		||||
		//Check if calls are disabled
 | 
			
		||||
		if(/*TODO : implement */false)
 | 
			
		||||
		if(!conversation.infos.can_have_call)
 | 
			
		||||
			return;
 | 
			
		||||
 | 
			
		||||
		//Add the call button
 | 
			
		||||
		var button = createElem2({
 | 
			
		||||
		const button = createElem2({
 | 
			
		||||
			insertBefore: conversation.box.boxTools.firstChild,
 | 
			
		||||
			type: "button",
 | 
			
		||||
			class: "btn btn-box-tool",
 | 
			
		||||
@@ -598,7 +598,7 @@ const ConvChatWindow = {
 | 
			
		||||
		conversation.box.callButton = button;
 | 
			
		||||
 | 
			
		||||
		button.addEventListener("click", function(){
 | 
			
		||||
			// TODO : implement
 | 
			
		||||
			CallsController.Open(conversation.infos)
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user