mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Added lightbox
This commit is contained in:
		@@ -33,6 +33,7 @@ function createElem(nodeType, appendTo){
 | 
			
		||||
 * @info {String} id The ID of the new element
 | 
			
		||||
 * @info {String} title The title of the new element
 | 
			
		||||
 * @info {String} src The src attribute of the new element
 | 
			
		||||
 * @info {String} href href attribute for the src element
 | 
			
		||||
 * @info {String} elemType The type attribute of the new element
 | 
			
		||||
 * @info {String} value The value of the new element
 | 
			
		||||
 * @info {String} placeholder The placeholder of the new element
 | 
			
		||||
@@ -76,6 +77,8 @@ function createElem2(infos){
 | 
			
		||||
	//Specify the source of the element
 | 
			
		||||
	if(infos.src)
 | 
			
		||||
		newElem.src = infos.src;
 | 
			
		||||
	if(infos.href)
 | 
			
		||||
		newElem.href = infos.href;
 | 
			
		||||
 | 
			
		||||
	//Specify element type
 | 
			
		||||
	if(infos.elemType)
 | 
			
		||||
 
 | 
			
		||||
@@ -794,12 +794,29 @@ ComunicWeb.components.conversations.chatWindows = {
 | 
			
		||||
 | 
			
		||||
		//Check if an image has to be added
 | 
			
		||||
		if(messageInfos.image_path != null){
 | 
			
		||||
			createElem2({
 | 
			
		||||
			
 | 
			
		||||
			//Image link
 | 
			
		||||
			var imageLink = createElem2({
 | 
			
		||||
				appendTo: messageTargetElem,
 | 
			
		||||
				type:"a",
 | 
			
		||||
				href: messageInfos.image_path,
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
			//Image element
 | 
			
		||||
			createElem2({
 | 
			
		||||
				appendTo: imageLink,
 | 
			
		||||
				type: "img",
 | 
			
		||||
				src: messageInfos.image_path,
 | 
			
		||||
				class: "conversation-msg-image"
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
			//Enable lightbox
 | 
			
		||||
			imageLink.onclick = function(){
 | 
			
		||||
				$(this).ekkoLightbox({
 | 
			
		||||
					alwaysShowClose: true,
 | 
			
		||||
				});
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//Parse emojies in text message
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user