Skip to content

Commit

Permalink
Fixes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kraker committed Jan 20, 2017
1 parent 5d2b57c commit 65cb464
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions vis/js/io.js
Expand Up @@ -20,11 +20,18 @@ IO.prototype = {
})
},

convertToFirstNameLastName: function (authors) {
var authors = authors.split(";");
convertToFirstNameLastName: function (authors_string) {
var authors = authors_string.split(";");

for(var i = authors.length - 1; i >= 0; i--) {
if(authors[i] === "") {
authors.splice(i, 1);
}
}

var authors_string = "";
var authors_short_string = "";
for (var i = 0; i < authors.length - 1; i++) {
for (var i = 0; i < authors.length; i++) {
var names = authors[i].trim().split(",");
var last_name = names[0].trim();
if (names.length > 1) {
Expand All @@ -36,7 +43,7 @@ IO.prototype = {
authors_short_string += last_name;
}

if (i != authors.length - 2) {
if (i < (authors.length - 1)) {
authors_string += ", ";
authors_short_string += ", ";
}
Expand Down

0 comments on commit 65cb464

Please sign in to comment.