1. Refactored javascript includes for person level page to reuse the code instead of duplicating it between coauthorship & copiship.
2. Fixed "back to profile" link. 3. Removed now redundant js files.
This commit is contained in:
parent
bfaa8887aa
commit
98a4887065
6 changed files with 196 additions and 618 deletions
|
@ -0,0 +1,78 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
var collaboratorTableMetadata = {
|
||||
tableID: "coauthorships_table",
|
||||
tableContainer: "coauth_table_container",
|
||||
tableCaption: "Co-authors ",
|
||||
tableColumnTitle1: "Author",
|
||||
tableColumnTitle2: "Publications with <br />",
|
||||
tableCSVFileLink: egoCoAuthorsListDataFileURL,
|
||||
jsonNumberWorksProperty: "number_of_authored_works"
|
||||
};
|
||||
|
||||
var visType = "coauthorship";
|
||||
var visKeyForFlash = "CoAuthor";
|
||||
|
||||
function renderStatsOnNodeClicked(json){
|
||||
|
||||
var obj = jQuery.parseJSON(json);
|
||||
|
||||
var works = "";
|
||||
var persons = "";
|
||||
var relation = "";
|
||||
var earliest_work = "";
|
||||
var latest_work = "";
|
||||
var number_of_works = "";
|
||||
|
||||
works = "Publication(s)";
|
||||
persons = "Co-author(s)";
|
||||
relation = "coauthorship"
|
||||
earliest_work = obj.earliest_publication;
|
||||
latest_work = obj.latest_publication;
|
||||
number_of_works = obj.number_of_authored_works;
|
||||
|
||||
$("#dataPanel").attr("style","visibility:visible");
|
||||
$("#works").empty().append(number_of_works);
|
||||
|
||||
/*
|
||||
* 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');
|
||||
$('#num_works > .author_stats_text').text(works);
|
||||
$('#num_authors > .author_stats_text').text(persons);
|
||||
|
||||
} else {
|
||||
|
||||
$("#authorName").addClass('neutral_author_name').removeClass('author_name');
|
||||
$('#num_works > .author_stats_text').text('Joint ' + works);
|
||||
$('#num_authors > .author_stats_text').text('Joint ' + persons);
|
||||
|
||||
}
|
||||
|
||||
$("#profileUrl").attr("href", getWellFormedURLs(obj.url, "profile"));
|
||||
$("#coAuthorshipVisUrl").attr("href", getWellFormedURLs(obj.url, relation));
|
||||
processProfileInformation("authorName",
|
||||
"profileMoniker",
|
||||
"profileImage",
|
||||
jQuery.parseJSON(getWellFormedURLs(obj.url, "profile_info")),
|
||||
true,
|
||||
true);
|
||||
|
||||
|
||||
|
||||
} else{
|
||||
$("#profileUrl").attr("href","#");
|
||||
$("#coAuthorshipVisUrl").attr("href","#");
|
||||
}
|
||||
|
||||
$("#coAuthors").empty().append(obj.noOfCorelations);
|
||||
|
||||
$("#firstPublication").empty().append(earliest_work);
|
||||
(earliest_work)?$("#fPub").attr("style","visibility:visible"):$("#fPub").attr("style","visibility:hidden");
|
||||
$("#lastPublication").empty().append(latest_work);
|
||||
(latest_work)?$("#lPub").attr("style","visibility:visible"):$("#lPub").attr("style","visibility:hidden");
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue