News
document.addEventListener("DOMContentLoaded", function() {
// Website ke sabhi PDF links ko target karein
var pdfLinks = document.querySelectorAll('a[href*=".pdf"]');
pdfLinks.forEach(function(link) {
var originalText = link.textContent.trim();
// Agar pehle se text mein PDF nahi likha hai
if (!originalText.toLowerCase().includes('pdf')) {
// 1. Screen readers aur WAVE tool ke liye aria-label set karein (Mandatory for IS 17802)
link.setAttribute('aria-label', originalText + ' (PDF Document)');
// 2. Normal users ko screen par saaf-saaf bold mein dikhane ke liye
link.innerHTML = link.innerHTML + '
(PDF)';
}
});
});
// External link click listener
document.querySelectorAll('a').forEach(function(link) {
if (link.hostname && link.hostname !== window.location.hostname) {
link.addEventListener('click', function(e) {
var confirmLeave = confirm("You are leaving the official website of Embassy of India and moving to an external link. Do you want to proceed?");
if (!confirmLeave) {
e.preventDefault();
}
});
}
});