Skip to content

Commit

Permalink
15167 -Icon for External Links - Issue Fix Done
Browse files Browse the repository at this point in the history
  • Loading branch information
ofcom-ramakrishnan committed Jan 3, 2025
1 parent 1de343e commit 143752c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6833,6 +6833,12 @@ input::-webkit-date-and-time-value {
margin-bottom: 10px;
}

.external-link::after {
content: "\f08e";
font-family: FontAwesome;
padding-left: 3px;
}

@media (forced-colors: active) {
.info-card .svg-arrow {
fill: aliceblue;
Expand Down
14 changes: 14 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1426,4 +1426,18 @@ $(document).ready(function () {
}
});
});
});

$(document).ready(function() {
// Get the current domain
var currentDomain = window.location.hostname;
// Iterate over each <a> tag
$('a').each(function() {
var href = $(this).attr('href');
// Check if href is valid and not the same as the current domain
if (href && (href.startsWith('http://') || href.startsWith('https://')) && !href.includes(currentDomain)) {
// Add the class 'external-link' to the <a> tag itself
$(this).addClass('external-link');
}
});
});

0 comments on commit 143752c

Please sign in to comment.