accurator/commit

Removed redundant header of recently annotated cluster.

authorChris Dijkshoorn
Tue Apr 5 17:32:57 2016 +0200
committerChris Dijkshoorn
Tue Apr 5 17:32:57 2016 +0200
commit04711aa160ae6a5add25bcb6ac5ea2e87a81ff5a
treecad2f0f092ac690a880a55d75d0bc3fca080d8a9
parente9908d04b470fdcdb174845ade9b95f5aeab517b
Diff style: patch stat
diff --git a/web/html/profile.html b/web/html/profile.html
index 0c39c07..73e8f4b 100644
--- a/web/html/profile.html
+++ b/web/html/profile.html
@@ -84,10 +84,6 @@
 
 		<!-- Already annotated -->
 		<div class="row" id="profileDivLastAnnotated">
-			<div class="col-md-12" id="profileDivHdrLastAnnotated">
-				<h4 id="profileLblLastAnnotated">
-				</h4>
-			</div>
 		</div>
 	</div>
 
@@ -129,10 +125,10 @@
 	<script type="text/javascript" src="js/lib/jquery.min.js"></script>
 	<script type="text/javascript" src="js/lib/bootstrap.min.js"></script>
 	<script type="text/javascript" src="js/lib/laconic.js"></script>
-	<script type="text/javascript" src="js/components/cluster.js"></script>
-	<script type="text/javascript" src="js/components/path.js"></script>
 	<script type="text/javascript" src="js/components/pagination.js"></script>
 	<script type="text/javascript" src="js/components/thumbnail.js"></script>
+	<script type="text/javascript" src="js/components/path.js"></script>
+	<script type="text/javascript" src="js/components/cluster.js"></script>
 	<script type="text/javascript" src="js/components/utilities.js"></script>
 	<script type="text/javascript" src="js/profile.js"></script>
 	<script>profileInit();</script>
diff --git a/web/js/profile.js b/web/js/profile.js
index d4f56ff..506f4d1 100644
--- a/web/js/profile.js
+++ b/web/js/profile.js
@@ -31,21 +31,22 @@ function profileInit() {
 
 		setLinkLogo("profile");
 		populateNavbar(userName, [], locale);
-		populateRecentlyAnnotated(user);
+
 
 		domainSettings(domain)
 		.then(function(domainData) {
 			return getLabels(locale, domainData.ui + "profile");
 		})
-		.then(function(labels) {
+		.then(function(labelData) {
 			addButtonEvents(user);
-			initLabels(labels);
+			var labels = initLabels(labelData);
 			initDomains(locale, domain, labels);
+			populateRecentlyAnnotated(user, labels);
 		});
 	}
 }
 
-function populateRecentlyAnnotated(user) {
+function populateRecentlyAnnotated(user, labels) {
 	$.getJSON("annotations", {
 		uri:user,
 		type:"user"
@@ -56,7 +57,12 @@ function populateRecentlyAnnotated(user) {
 		} else {
 			//TODO: limit length of uris (faster if someone annotated a bunch)?
 			var noRecentlyAnnotatedItems = 6;
-			var cluster = new Cluster("profileDivCluster", uris, "Recently tagged");
+
+			var cluster = new Cluster(
+				"profileDivCluster",
+				uris,
+				labels.profileLblLastAnnotated
+			);
 
 			cluster.init(noRecentlyAnnotatedItems)
 			.then(function() {
@@ -66,23 +72,26 @@ function populateRecentlyAnnotated(user) {
 	});
 }
 
-function initLabels(labels) {
+function initLabels(labelData) {
 	// add retrieved labels to html elements
-	document.title = labels.profilePageTitle;
+	document.title = labelData.profilePageTitle;
+
+	var labels = {profileLblLastAnnotated: labelData.profileLblLastAnnotated};
 
 	// check if real name is available
 	if (typeof realName !== 'undefined') {
-		$("#profileHdrSlogan").prepend(labels.profileHdrSlogan + " " + realName + " ");
+		$("#profileHdrSlogan").prepend(labelData.profileHdrSlogan + " " + realName + " ");
 	} else {
-		$("#profileHdrSlogan").prepend(labels.profileHdrSlogan);
+		$("#profileHdrSlogan").prepend(labelData.profileHdrSlogan);
 	}
-	$("#profileTxtSubSlogan").prepend(labels.profileTxtSubSlogan);
-	$("#profileTxtStartAnnotating").append(labels.profileTxtStartAnnotating);
-	$("#navbarBtnRecommend").append(labels.navbarBtnRecommend);
-	$("#profileBtnChangeExpertise").append(labels.profileBtnChangeExpertise);
-	$("#navbarBtnSearch").append(labels.navbarBtnSearch);
-	$("#profileBtnDomain").prepend(labels.profileBtnDomain);
-	$("#profileLblLastAnnotated").append(labels.profileLblLastAnnotated);
+	$("#profileTxtSubSlogan").prepend(labelData.profileTxtSubSlogan);
+	$("#profileTxtStartAnnotating").append(labelData.profileTxtStartAnnotating);
+	$("#navbarBtnRecommend").append(labelData.navbarBtnRecommend);
+	$("#profileBtnChangeExpertise").append(labelData.profileBtnChangeExpertise);
+	$("#navbarBtnSearch").append(labelData.navbarBtnSearch);
+	$("#profileBtnDomain").prepend(labelData.profileBtnDomain);
+
+	return labels;
 }
 
 function initDomains(locale, domain, labels) {