Skip to content

Commit

Permalink
Merge pull request #8 from BLE-LTER/aria-label
Browse files Browse the repository at this point in the history
add aria-label attribute to links that open in new tab
  • Loading branch information
twhiteaker authored May 14, 2021
2 parents 8731923 + 08630cc commit c8ecf1f
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 c8ecf1f

Please sign in to comment.