From 58771a0cc86e7ccd347494418054d19a185df8e2 Mon Sep 17 00:00:00 2001
From: Sebastien Curt <sebastien.curt@tetras-libre.fr>
Date: Tue, 18 Jan 2022 23:51:10 +0100
Subject: [PATCH] Js remove mixed spaces

---
 capsule-prototype/js/iannix.js                |   8 +-
 capsule-prototype/js/online-rekall/Project.js |  23 ++-
 capsule-prototype/js/online-rekall/Rekall.js  |  22 +--
 capsule-prototype/js/online-script.js         | 175 +++++++++---------
 capsule-prototype/js/rekall/Sorting.js        |   6 +-
 capsule-prototype/js/rekall/Source.js         |   4 +-
 capsule-prototype/js/rekall/Utils.js          |   6 +-
 7 files changed, 117 insertions(+), 127 deletions(-)

diff --git a/capsule-prototype/js/iannix.js b/capsule-prototype/js/iannix.js
index 21343fa..eb04abe 100644
--- a/capsule-prototype/js/iannix.js
+++ b/capsule-prototype/js/iannix.js
@@ -96,13 +96,13 @@ function dist(x1, y1, z1, x2, y2, z2) {
 function angle(x1, y1, x2, y2) {
 	var dx = x2 - x1, dy = y2 - y1, angle = 0;
 	if((dx > 0) && (dy >= 0))
-	    angle = (Math.atan(dy / dx)) * 180.0 / PI;
+		angle = (Math.atan(dy / dx)) * 180.0 / PI;
 	else if((dx <= 0) && (dy > 0))
-	    angle = (-Math.atan(dx / dy) + HALF_PI) * 180.0 / PI;
+		angle = (-Math.atan(dx / dy) + HALF_PI) * 180.0 / PI;
 	else if((dx < 0) && (dy <= 0))
-	    angle = (Math.atan(dy / dx) + PI) * 180.0 / PI;
+		angle = (Math.atan(dy / dx) + PI) * 180.0 / PI;
 	else if((dx >= 0) && (dy < 0))
-	    angle = (-Math.atan(dx / dy) + 3 * HALF_PI) * 180.0 / PI;
+		angle = (-Math.atan(dx / dy) + 3 * HALF_PI) * 180.0 / PI;
 	return angle;
 }
 function norm(value, low, high) {
diff --git a/capsule-prototype/js/online-rekall/Project.js b/capsule-prototype/js/online-rekall/Project.js
index e70c703..ebc832c 100644
--- a/capsule-prototype/js/online-rekall/Project.js
+++ b/capsule-prototype/js/online-rekall/Project.js
@@ -148,8 +148,8 @@ Project.prototype.loadXML = function(xml) {
 				
 				rekall.videoPlayer.on("durationchange", function(e) {
 					rekall.videoPlayer.markers.removeAll == undefined;
-					
-		            if(counts.documents>0){
+
+					if(counts.documents>0){
 						rekall.project.analyse();
 						rekall.videoPlayer.markers.initialize();
 					}
@@ -332,11 +332,10 @@ Project.prototype.analyse = function() {
 					var styleColor2 = styleColor;//"background-color: #3EA8B1;";
 					var styleImage = "";
 					if(tag.thumbnail.url != undefined) {  
-						                                                        
-						
-						//styleImage = "background-image: url(" + tag.thumbnail.url + ");";//" opacity: 0.5;";    
+
+						//styleImage = "background-image: url(" + tag.thumbnail.url + ");";//" opacity: 0.5;";
 						styleImage = "background-image: -webkit-linear-gradient(right bottom,  rgba(20,46,51,.60) 0%,rgba(20,46,51,.90) 100%), url(" + tag.thumbnail.url + "); background-image: -moz-linear-gradient(right bottom,  rgba(20,46,51,.60) 0%,rgba(20,46,51,.90) 100%), url(" + tag.thumbnail.url + "); background-image: -o-linear-gradient(right bottom,  rgba(20,46,51,.60) 0%,rgba(20,46,51,.90) 100%), url(" + tag.thumbnail.url + ");";
-					//	styleImage = "background-image: -webkit-linear-gradient(right bottom,  "+tag.color.replace(/rgb/g, "rgba").replace(/\)/g, ",.6)")+" 0%,"+tag.color.replace(/rgb/g, "rgba").replace(/\)/g, ",.9)")+" 100%), url(" + tag.thumbnail.url + ");";
+						//	styleImage = "background-image: -webkit-linear-gradient(right bottom,  "+tag.color.replace(/rgb/g, "rgba").replace(/\)/g, ",.6)")+" 0%,"+tag.color.replace(/rgb/g, "rgba").replace(/\)/g, ",.9)")+" 100%), url(" + tag.thumbnail.url + ");";
 						/*styleColor += "opacity: 0.25;"; */
 					} else styleImage = "background-color: " + tag.color + "; background-image: -webkit-linear-gradient(right bottom, rgba(20,46,51,.5) 0%,rgba(20,46,51,.8) 100%); background-image: -moz-linear-gradient(right bottom, rgba(20,46,51,.5) 0%,rgba(20,46,51,.8) 100%); background-image: -o-linear-gradient(right bottom, rgba(20,46,51,.5) 0%,rgba(20,46,51,.8) 100%);" ;//styleColor.replace(/rgb/g, "rgba").replace(/\)/g, ",.85)");//"background-color: rgba(255,255,255,.25)";
 
@@ -405,8 +404,8 @@ Project.prototype.analyse = function() {
 					});
 					tag.flattenTimelineDom.on({
 						dragstart: function(event) {
-				            event.dataTransfer.setData("key", 	  tag.document.key);
-				            event.dataTransfer.setData("version", tag.version);
+							event.dataTransfer.setData("key", 	  tag.document.key);
+							event.dataTransfer.setData("version", tag.version);
 						}
 					});  
 				
@@ -452,16 +451,16 @@ Project.prototype.analyse = function() {
 					html 	+= "<div class='flattentimeline_type'		style='" + icnType +"' title='" + tmpType + "'></div>";                                                           
 					html 	+= "<div class='flattentimeline_title' 		style='" + textColor2 + "' title='" + tag.getMetadata("Rekall->Name") + "'>" + tag.getMetadata("Rekall->Name") + "</div>";     
 					html    += "</div>";           
-			    
-					tag.flattenTimelineDom = $(html); 
+
+					tag.flattenTimelineDom = $(html);
 					tag.flattenTimelineDom.click(function(event) {                
 						tag.openPopupEdit(); 
 						//tag.openBrowser();
 					});
 					tag.flattenTimelineDom.on({
 						dragstart: function(event) {
-				            event.dataTransfer.setData("key", 	  tag.document.key);
-				            event.dataTransfer.setData("version", tag.version);
+							event.dataTransfer.setData("key", 	  tag.document.key);
+							event.dataTransfer.setData("version", tag.version);
 						}
 					});        
 				
diff --git a/capsule-prototype/js/online-rekall/Rekall.js b/capsule-prototype/js/online-rekall/Rekall.js
index 41657fd..676df7e 100644
--- a/capsule-prototype/js/online-rekall/Rekall.js
+++ b/capsule-prototype/js/online-rekall/Rekall.js
@@ -39,22 +39,22 @@ Rekall.prototype.loadXMLFile = function() {
 	url = url.replace("index.html", "");
 	index = oldURL.indexOf('?');
 	if(index == -1)
-	    index = oldURL.indexOf('#');
+		index = oldURL.indexOf('#');
 	if(index != -1)
-	    url = oldURL.substring(0, index);
+		url = oldURL.substring(0, index);
 	if(!url.endsWith("/"))
 		url = url + "/";
-	if(window.location.host == "dev3.memorekall.com") { 
-	    url = url.replace("dev3.memorekall.com", "dev2.memorekall.com"); 
-	    $("#popupSettingsBtnDelete").hide(); 
+	if(window.location.host == "dev3.memorekall.com") {
+		url = url.replace("dev3.memorekall.com", "dev2.memorekall.com");
+		$("#popupSettingsBtnDelete").hide();
 	} 
-	if(window.location.host == "legacy.memorekall.com") { 
-	    url = url.replace("legacy.memorekall.com", "project.memorekall.com"); 
-	    $("#popupSettingsBtnDelete").hide(); 
+	if(window.location.host == "legacy.memorekall.com") {
+		url = url.replace("legacy.memorekall.com", "project.memorekall.com");
+		$("#popupSettingsBtnDelete").hide();
 	} 
-	if(window.location.host == "legacy.memorekall.fr") { 
-	    url = url.replace("legacy.memorekall.fr", "project.memorekall.com"); 
-	    $("#popupSettingsBtnDelete").hide(); 
+	if(window.location.host == "legacy.memorekall.fr") {
+		url = url.replace("legacy.memorekall.fr", "project.memorekall.com");
+		$("#popupSettingsBtnDelete").hide();
 	}
 	this.baseUrl = url;
 	
diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js
index bfaf378..568dcb0 100644
--- a/capsule-prototype/js/online-script.js
+++ b/capsule-prototype/js/online-script.js
@@ -27,9 +27,9 @@ $(document).ready(function() {
 							
 			if(rekall_common.owner.canEdit) {
 				//Mode preview or not
-				$(".editmode").removeClass("editmode");     
-			    $(".empty").show();
-			    $(".displayMode").hide();
+				$(".editmode").removeClass("editmode");
+				$(".empty").show();
+				$(".displayMode").hide();
 				
 				setEditionControls();
 				
@@ -52,8 +52,8 @@ $(document).ready(function() {
 				}
 
 			} else {                                                    
-				$(".empty").hide();  
-			    $(".displayMode").show(); 
+				$(".empty").hide();
+				$(".displayMode").show();
 			
 				$("#projectInfoBtn").click(function(event){  
 					event.stopPropagation(); 
@@ -89,19 +89,16 @@ $(document).ready(function() {
 			rekall.loadXMLFile();
 		}
 	});
-	 
 
-	    
-	
-	$("#popupAlertSpace").click(function(event){  
+	$("#popupAlertSpace").click(function(event){
 		event.stopPropagation();      
 	});
 	$("#popupAlertButtonOk").click(function(event){  
 		event.stopPropagation(); 
 		$("#popupAlertSpace").hide();
 	});
-   
- 	$("#popupSpace").click(function(event){  
+
+	$("#popupSpace").click(function(event){
 		event.stopPropagation();  
 		closeEdit();              
 	});                    
@@ -161,8 +158,7 @@ function setEditionControls() {
 			}        
 		}
 	});   
-	                     
-	
+
 	$("#flattentimeline").on({
 		dragenter: function(event) {
 			//$(".flattentimeline_item").removeClass("draggable").addClass("drag");
@@ -177,8 +173,7 @@ function setEditionControls() {
 			$("#flattentimeline").removeClass("draggable").removeClass("drag");  
 		}
 	});
-	         
-	
+
 	$("#left_menu_bottom").click(function(event){
 		//var tmp = $(".vjs-marker").css("z-index");
 		//alert("val = "+tmp);
@@ -188,7 +183,7 @@ function setEditionControls() {
 		event.stopPropagation(); 
 		rekall.timeline.pause();
 		$("#popupSettingsSpace").show();         
-		                     
+
 		if(rekall.project.metadata["Title"]!="") {
 			$("#popupSettingsTitle").html(rekall.project.metadata["Title"]).removeClass("empty"); 
 			$("#popupSettingsTitleLabel").show();
@@ -221,10 +216,9 @@ function setEditionControls() {
 			$("#popupSettingsCreditsLabel").hide();
 		}     
 		
-		if(rekall_common.owner.canEdit) {                    
-	    	$(".empty").show();         
+		if(rekall_common.owner.canEdit) {
+			$(".empty").show();
 		}
-		                                                                             
 	});  
 	
 
@@ -275,20 +269,20 @@ function setEditionControls() {
 		
 		var isEnter = false;        
 		if (event.key !== undefined) {
-		       if (event.key === 'Enter' && event.altKey) {
-		          //openAlert('Alt + Enter pressed!');
-		       } else if(event.key === 'Enter') isEnter = true;  
-		    } else if (event.keyIdentifier !== undefined) {
-		       if (event.keyIdentifier === "Enter" && event.altKey) {
-		          //openAlert('Alt + Enter pressed!');
-		       } else if(event.keyIdentifier === 'Enter') isEnter = true;    
-		    } else if (event.keyCode !== undefined) {
-		       if (event.keyCode === 13 && event.altKey) {
-		          //openAlert('Alt + Enter pressed!');
-		    } else if(event.keyCode === 13) isEnter = true; 
+			if (event.key === 'Enter' && event.altKey) {
+				//openAlert('Alt + Enter pressed!');
+			} else if(event.key === 'Enter') isEnter = true;
+		} else if (event.keyIdentifier !== undefined) {
+			if (event.keyIdentifier === "Enter" && event.altKey) {
+				//openAlert('Alt + Enter pressed!');
+			} else if(event.keyIdentifier === 'Enter') isEnter = true;
+		} else if (event.keyCode !== undefined) {
+			if (event.keyCode === 13 && event.altKey) {
+				//openAlert('Alt + Enter pressed!');
+			} else if(event.keyCode === 13) isEnter = true;
 		}
-		             
-		if(isEnter == true) {                                                              
+
+		if(isEnter == true) {
 			closeSettingsInputs(); 
 		}
 	});
@@ -319,8 +313,8 @@ function setEditionControls() {
 		//alert("DELETE");
 		openAlert("Do you really want to delete this project ?", "yesnodeleteproject"); 
 	});                               
-	                                           
-	$("#left_menu_item_addnote").click(function(event){  
+
+	$("#left_menu_item_addnote").click(function(event){
 		event.stopPropagation();   
 		rekall.timeline.pause();
 		uploadFiles(["New note"]);   
@@ -340,8 +334,8 @@ function setEditionControls() {
 		$("#popupAddLinkSpace").show();  
 		$("#popupAddLinkInput").focus();
 	});       
-	    
-	$("#popupAddLinkButtonCancel").click(function(event){   
+
+	$("#popupAddLinkButtonCancel").click(function(event){
 		event.stopPropagation();            
 		closeAddLinkPopup();
 	});    
@@ -359,7 +353,7 @@ function setEditionControls() {
 		event.stopPropagation();              
 		if(event.which == 13) {     
 			var myLink = $("#popupAddLinkInput").val();
-		    addLink(myLink);
+			addLink(myLink);
 		}
 	});
                             
@@ -368,8 +362,8 @@ function setEditionControls() {
 		event.stopPropagation(); 
 		closeInputs();
 	});
-	            
-	$("#popupNom").click(function(event){  
+
+	$("#popupNom").click(function(event){
 		event.stopPropagation();     
 		closeInputs();
 		$(this).hide();
@@ -415,7 +409,7 @@ function setEditionControls() {
 		var outSec = $("#popupTCoutSec").val();
 		var TCin = (inMin*60)+(inSec*1);   
 		var TCout = (outMin*60)+(outSec*1);   
-		                                                                         
+
 		var endVideo = Math.ceil(rekall.videoPlayer.duration());
 		
 		if(TCin>TCout) 			openAlert("Start time must be set before end time", "ok"); 
@@ -439,9 +433,8 @@ function setEditionControls() {
 		$("#popupTCoutSec").val(TCout[1]);
 		closeInputs();  
 	});
-	           
-	
-	$("#popupLegende").click(function(event){  
+
+	$("#popupLegende").click(function(event){
 		event.stopPropagation();     
 		closeInputs();
 		$(this).hide();
@@ -466,15 +459,14 @@ function setEditionControls() {
 	$(".popupInput").click(function(event){
 		event.stopPropagation();
 	});   
-	 
-	
-	$("#popupNomInput").keyup(function(event){  
+
+	$("#popupNomInput").keyup(function(event){
 		event.stopPropagation();              
 		if(event.which == 13) {                                                      
 			closeInputs(); 
 		}
-	});    
-	 
+	});
+
 	//Validation du commentaire avec Entrée = désactivé
 	/*$("#popupLegendeInput").keyup(function(event){    
 		event.stopPropagation(); 
@@ -512,7 +504,7 @@ function setEditionControls() {
 			closeInputs(); 
 		}                                         
 	});
-	 
+
 	$("#popupSetHighlight").click(function(event){
 		event.stopPropagation();
 		var keyDoc = $(this).parent().attr("keydoc");
@@ -605,20 +597,20 @@ function openAlert(message, buttons) {
 		$("#popupAlertInput").val(buttons);
 		$("#popupAlertInput").show();           
 		$("#popupAlertTextarea").hide(); 
-		                                      
-		$("#popupAlertSpace").show();     
+
+		$("#popupAlertSpace").show();
 		$("#popupAlertInput").focus().select();
 		
 	} else if(message=="textarea"){  
 		$("#popupAlertMessage").html("Embed <i>"+rekall.project.metadata["Title"]+"</i> on your webpage");
 		$(".popupAlertButton").hide();  
 		$("#popupAlertButtonOk").show(); 
-		                                
+
 		$("#popupAlertTextarea").val(buttons);
 		$("#popupAlertInput").hide(); 
 		$("#popupAlertTextarea").show();               
-		                                  
-		$("#popupAlertSpace").show();         
+
+		$("#popupAlertSpace").show();
 		$("#popupAlertTextarea").focus().select();
 		
 	} else {            
@@ -656,8 +648,8 @@ function closeSettingsInputs() {
 	$.each($(".popupSettingsInput"), function() { 
 		if($(this).css("display") != "none") {
 			if($(this).attr("id")=="popupSettingsTitleInput") {                                           
-				                                                 
-				var newName = $(this).val().trim();        
+
+				var newName = $(this).val().trim();
 				$(this).val(newName);                                
 				setProjectMeta("Title", newName);
 
@@ -668,10 +660,10 @@ function closeSettingsInputs() {
 					$("#popupSettingsTitle").html("+ Add project name").addClass("empty").show();   
 					$("#popupSettingsTitleLabel").hide();
 				}
-				  
-			} else if($(this).attr("id")=="popupSettingsAuthorInput") {  
-				                                                 
-				var newAuthor = $(this).val().trim();    
+
+			} else if($(this).attr("id")=="popupSettingsAuthorInput") {
+
+				var newAuthor = $(this).val().trim();
 				$(this).val(newAuthor);                                                        
 				setProjectMeta("Author", newAuthor); 
 
@@ -682,10 +674,10 @@ function closeSettingsInputs() {
 					$("#popupSettingsAuthor").html("+ Add project author").addClass("empty").show();
 					$("#popupSettingsAuthorLabel").hide();   
 				}
-				   
-			} else if($(this).attr("id")=="popupSettingsEmailInput") {  
-				                                                    
-				var newEmail = $(this).val().trim();        
+
+			} else if($(this).attr("id")=="popupSettingsEmailInput") {
+
+				var newEmail = $(this).val().trim();
 				$(this).val(newEmail);                                 
 				setProjectMeta("Email", newEmail);
 
@@ -696,10 +688,10 @@ function closeSettingsInputs() {
 					$("#popupSettingsEmail").html("+ Add email address").addClass("empty").show(); 
 					$("#popupSettingsEmailLabel").hide();
 				}  
-				  
-			} else if($(this).attr("id")=="popupSettingsCreditsInput") {   
-			                                                  
-				var newCredits = $(this).val().trim();        
+
+			} else if($(this).attr("id")=="popupSettingsCreditsInput") {
+
+				var newCredits = $(this).val().trim();
 				$(this).val(newCredits);                               
 				setProjectMeta("Comments", newCredits);
 
@@ -715,8 +707,8 @@ function closeSettingsInputs() {
 		}
 		
 		//alert("ok"); 
-	});         
-   	$(".popupSettingsInput").hide();
+	});
+	$(".popupSettingsInput").hide();
 	$(".popupSettingsTxt").show();  
 }
 
@@ -732,8 +724,8 @@ function closeInputs() {
 
 				if(newName!="") $("#popupNom").html(newName).removeClass("empty"); 
 				else $("#popupNom").html("+ Add a name").addClass("empty");
-				  
-			} else if($(this).attr("id")=="popupLegendeInput") {  
+
+			} else if($(this).attr("id")=="popupLegendeInput") {
 				
 				var keyDoc = $(this).parent().attr("keydoc"); 
 				var newComment = $(this).val().trim();    
@@ -742,8 +734,8 @@ function closeInputs() {
 
 				if(newComment!="") $("#popupLegende").html(newComment.replace(/\n/gi, "<br/>")).removeClass("empty"); 
 				else $("#popupLegende").html("+ Add a comment").addClass("empty"); 
-				   
-			} else if($(this).attr("id")=="popupAuthorInput") {  
+
+			} else if($(this).attr("id")=="popupAuthorInput") {
 				
 				var keyDoc = $(this).parent().attr("keydoc"); 
 				var newAuthor = $(this).val().trim();        
@@ -752,14 +744,14 @@ function closeInputs() {
 
 				if(newAuthor!="") $("#popupAuthor").html(newAuthor).removeClass("empty"); 
 				else $("#popupAuthor").html("+ Add an author").addClass("empty");   
-				  
-			} else if($(this).attr("id")=="popupLinkInput") {   
+
+			} else if($(this).attr("id")=="popupLinkInput") {
 			
 				var keyDoc = $(this).parent().attr("keydoc"); 
 				var newLink = $(this).val().trim();    
 				
 				if(newLink!="") if(newLink.indexOf("http")!=0) newLink = "http://"+newLink;
-				    
+
 				$(this).val(newLink);
 				setMetaFromDom(keyDoc, "Rekall->Link", newLink); 
 
@@ -781,7 +773,7 @@ function closeInputs() {
 				var endVideo = Math.ceil(rekall.videoPlayer.duration());
                 
                 var isReturn = true;
-                                            				
+
 				if((inMin>=120)||(inSec>=60)||(outMin>=120)||(outSec>=60)||(inMin<0)||(inSec<0)||(outMin<0)||(outSec<0)) openAlert("Invalid time code", "ok");
 				else if(TCin>TCout) 			openAlert("Start time must be set before end time", "ok"); 
 				else if(TCout>endVideo)			openAlert("End time must not be set after " + convertToTime(endVideo) + " (end of the video)", "ok");  
@@ -797,7 +789,7 @@ function closeInputs() {
 		
 		//alert("ok"); 
 	});
-   	$(".popupInput").hide();
+	$(".popupInput").hide();
 	$(".popupRightItem").show();  
 	$("#popupTC").show();
 	$("#popupTCedit").hide();
@@ -843,8 +835,8 @@ function fillPopupEdit(tag) {
 		$("#popupImg").unbind( "click" );   
 		
 	} else {                
-		if(tag.thumbnail.url){        
-		   	$("#popupImg").attr("src",tag.thumbnail.url);
+		if(tag.thumbnail.url){
+			$("#popupImg").attr("src",tag.thumbnail.url);
 		} else {                   
 			var type = tag.getMetadata("Rekall->Type");
 			//alert(type);        
@@ -870,18 +862,18 @@ function fillPopupEdit(tag) {
 	}                        
 	
 	$("#popupNom").css("color",tag.color); 
-	 
-	$("#popupType").html(tag.getMetadata("Rekall->Type")).css("color",tag.color);         
+
+	$("#popupType").html(tag.getMetadata("Rekall->Type")).css("color",tag.color);
 	var name = tag.getMetadata("Rekall->Name");    
 	if(name!="") $("#popupNom").html(name).removeClass("empty");
 	else $("#popupNom").html("+ Add a name").addClass("empty");    
 
 	var startVerb = convertToTime(tag.getTimeStart());
 	$("#popupTCin").html(startVerb);       
-	                                                 
-	var endVerb = convertToTime(tag.getTimeEnd());  
-	$("#popupTCout").html(endVerb);                  
-	  
+
+	var endVerb = convertToTime(tag.getTimeEnd());
+	$("#popupTCout").html(endVerb);
+
 	var comments = tag.getMetadata("Rekall->Comments");
 	if((comments)&&(comments!="")) $("#popupLegende").html(comments).removeClass("empty");
 	else $("#popupLegende").html("+ Add a comment").addClass("empty"); 
@@ -896,13 +888,12 @@ function fillPopupEdit(tag) {
 		else $("#popupLink").html("<a href='"+link+"' target='_blank'>"+link+"</a>").removeClass("empty");
 	}
 	else $("#popupLink").html("+ Add a link").addClass("empty");      
-	
-	                                         
-	if(rekall_common.owner.canEdit) {       
+
+	if(rekall_common.owner.canEdit) {
 		if(tag.isMarker()==true) $("#popupEditSupprimer").html("Delete Note");  
 		else $("#popupEditSupprimer").html("Delete File");  
-		                                  
-    	$(".empty").show();            
+
+		$(".empty").show();
 		$(".displayMode").hide();
 		$("#popupNomInput").val(tag.getMetadata("Rekall->Name")); 
 		
diff --git a/capsule-prototype/js/rekall/Sorting.js b/capsule-prototype/js/rekall/Sorting.js
index a9a5377..720a489 100644
--- a/capsule-prototype/js/rekall/Sorting.js
+++ b/capsule-prototype/js/rekall/Sorting.js
@@ -141,7 +141,7 @@ Sorting.prototype.analyseAdd = function(tag, metadata, alwaysIncludeTags, useThi
 	}
 	else {
 		if(metadata == undefined)
-	 		metadata = tag.getMetadata(this.metadataKey);
+			metadata = tag.getMetadata(this.metadataKey);
 		var metadataRaw = metadata;
 //		if(metadataRaw == undefined) 
 //			metadataRaw = "Unknown";
@@ -154,7 +154,7 @@ Sorting.prototype.analyseAdd = function(tag, metadata, alwaysIncludeTags, useThi
 		if((metadata == Sorting.prefix) && (this.metadataKey != undefined) && (this.metadataKey != ""))
 			return false;
 		*/
- 		if((this.metadataSearch != undefined) && (this.metadataSearch != "") && (metadata.toLowerCase().indexOf(this.metadataSearch.toLowerCase()) < 0))
+		if((this.metadataSearch != undefined) && (this.metadataSearch != "") && (metadata.toLowerCase().indexOf(this.metadataSearch.toLowerCase()) < 0))
 			return false;
 		
 		if(useThisInsteadOfValue != undefined)
@@ -253,7 +253,7 @@ Sorting.prototype.analyseEnd = function(minTagCount) {
 						if((val <= valCompare) && (valCompare < (val+valStep)))
 							categoriesTmp[metadata].tags.push(this.categories[key].tags[keyIndex]);
 					}
-			    }
+				}
 			}
 		}
 		this.categories = categoriesTmp;
diff --git a/capsule-prototype/js/rekall/Source.js b/capsule-prototype/js/rekall/Source.js
index 4e1e128..7a1e631 100644
--- a/capsule-prototype/js/rekall/Source.js
+++ b/capsule-prototype/js/rekall/Source.js
@@ -28,7 +28,7 @@ function Source(hash) {
 
 Source.prototype.addDocument = function(document) {
 	if(document.key == undefined) {
-		document.key = this.mapPath(Utils.getLocalFilePath(document, "", true, true));;
+		document.key = this.mapPath(Utils.getLocalFilePath(document, "", true, true));
 		if(document.key == "")
 			document.key = "marker-" + CryptoJS.SHA1(moment() + random() + "").toString();
 	}
@@ -63,7 +63,7 @@ Source.prototype.mapPath = function(path) {
 	return retour;
 }
 Source.prototype.addMapping = function(path1, path2) {
-	var path1Exists = false, path2Exists = false;;
+	var path1Exists = false, path2Exists = false;
 	for (var pathSrc in this.mapping) {
 		var pathDst = this.mapping[pathSrc];
 		if((pathSrc == path1) || (pathDst == path1))
diff --git a/capsule-prototype/js/rekall/Utils.js b/capsule-prototype/js/rekall/Utils.js
index a97d64e..ba45f5f 100644
--- a/capsule-prototype/js/rekall/Utils.js
+++ b/capsule-prototype/js/rekall/Utils.js
@@ -45,7 +45,7 @@ Utils.sortObj = function(arr, valAreFloats) {
 		}
 		if (a < b)	return -1;
 		if (a > b)	return 1;
-  		return 0;
+		return 0;
 	});
 
 	//Reconstruct sorted obj based on keys
@@ -213,7 +213,7 @@ String.prototype.toHHMMSS = function (moduloHours, forceHours) {
     var time    = minus;
 	if((forceHours == true) || (hours > 0)) {
 		if(moduloHours)	hours = hours % 24;
-	    if (hours < 10)	time += "0"+hours + ":";
+		if (hours < 10)	time += "0"+hours + ":";
 		else			time += hours + ":";
 	}
     if (minutes < 10)	time += "0"+minutes + ":";
@@ -237,7 +237,7 @@ String.prototype.toHHMMSSmmm = function (forceHours) {
     var time    = minus;
 	if((forceHours == true) || (hours > 0)) {
 		if(moduloHours)	hours = hours % 24;
-	    if (hours < 10)	time += "0"+hours + ":";
+		if (hours < 10)	time += "0"+hours + ":";
 		else			time += hours + ":";
 	}
     if (minutes < 10)	time += "0"+minutes + ":";
-- 
GitLab