From f0912387317e5c0b4a7d236de9bcbe17fe6427df Mon Sep 17 00:00:00 2001 From: cdtank Date: Tue, 13 Jul 2010 17:01:10 +0000 Subject: [PATCH] 1. Added code to color the author names in sidebar (in person level vis) depending whether they are ego or not --- .../js/visualization/personlevel/person_level.js | 15 +++++++++++++-- .../web/templates/visualization/person_level.jsp | 1 - .../visualization/person_level_inject_head.jsp | 5 ++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/webapp/web/js/visualization/personlevel/person_level.js b/webapp/web/js/visualization/personlevel/person_level.js index 3a9920d96..5ad46a7ec 100644 --- a/webapp/web/js/visualization/personlevel/person_level.js +++ b/webapp/web/js/visualization/personlevel/person_level.js @@ -1,5 +1,3 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - function getWellFormedURLs(given_uri, type) { // general best practice is to put javascript code inside document.ready @@ -231,6 +229,17 @@ function nodeClickedJS(json){ * Here obj.url points to the uri of that individual */ if(obj.url){ + + if (obj.url == egoURI) { + + $("#authorName").addClass('author_name').removeClass('neutral_author_name'); + + } else { + + $("#authorName").addClass('neutral_author_name').removeClass('author_name'); + + } + $("#profileUrl").attr("href", getWellFormedURLs(obj.url, "profile")); $("#coAuthorshipVisUrl").attr("href", getWellFormedURLs(obj.url, "coauthorship")); processProfileInformation("", @@ -238,6 +247,8 @@ function nodeClickedJS(json){ "profileImage", jQuery.parseJSON(getWellFormedURLs(obj.url, "profile_info")), true); + + } else{ $("#profileUrl").attr("href","#"); diff --git a/webapp/web/templates/visualization/person_level.jsp b/webapp/web/templates/visualization/person_level.jsp index 0ccde7b76..d0bfa8295 100644 --- a/webapp/web/templates/visualization/person_level.jsp +++ b/webapp/web/templates/visualization/person_level.jsp @@ -1,4 +1,3 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> <%@ page import="edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.SparklineVOContainer"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> diff --git a/webapp/web/templates/visualization/person_level_inject_head.jsp b/webapp/web/templates/visualization/person_level_inject_head.jsp index 66e6eeaff..63289e825 100644 --- a/webapp/web/templates/visualization/person_level_inject_head.jsp +++ b/webapp/web/templates/visualization/person_level_inject_head.jsp @@ -1,5 +1,3 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> @@ -45,6 +43,7 @@ var requiredRevision = 0; var swfLink = "${swfLink}"; +var egoURI = "${requestScope.egoURIParam}"; var egoCoAuthorshipDataFeederURL = "${egoCoAuthorshipDataFeederURL}"; var egoCoAuthorsListDataFileURL = "${egoCoAuthorsListDataFileURL}"; var contextPath = "${contextPath}"; @@ -58,4 +57,4 @@ var contextPath = "${contextPath}"; - + \ No newline at end of file