Skip to content

Commit

Permalink
add aria-label attribute to links that open in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
atn38 authored May 14, 2021
1 parent 8731923 commit 08630cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/pasta.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function buildHtml(citations) {
var date = (citation["pub_year"]) ? " Published " + citation["pub_year"] + "" : "";
// default ESIP formatting has trailing period after DOI
var link = (citation["doi"]) ? citation["doi"].slice(0, -1) : "https://portal.edirepository.org/nis/mapbrowse?packageid=" + citation["pid"];
var title = '<a rel="external noopener" href="' + link + '" target="_blank">' + citation["title"] + '</a>';
var title = '<a rel="external noopener" href="' + link + '" target="_blank" aria-label="open data in new tab">' + citation["title"] + '</a>';
var row = '<p><span class="dataset-title">' + title +
'</span><br><span class="dataset-author">' + authors + date +
'</span></p>';
Expand Down Expand Up @@ -131,7 +131,7 @@ function buildCitationsFromPasta(pastaDocs) {
link = ("https://portal.edirepository.org/nis/mapbrowse?packageid=" +
doc.getElementsByTagName("packageid")[0].childNodes[0].nodeValue);
}
var title = '<a rel="external noopener" href="' + link + '" target="_blank">' +
var title = '<a rel="external noopener" href="' + link + '" target="_blank" aria-label="open data in new tab">' +
doc.getElementsByTagName("title")[0].childNodes[0].nodeValue.trim() + '</a>';
var row = '<p><span class="dataset-title">' + title +
'</span><br><span class="dataset-author">' + names + date +
Expand Down Expand Up @@ -539,4 +539,4 @@ window.onload = function () {
makeAutocomplete("creator", PASTA_LOOKUP["author"]);
makeAutocomplete("taxon", PASTA_LOOKUP["taxonomic"]);
}
};
};

0 comments on commit 08630cc

Please sign in to comment.