Better message frormatting for mirrors

This commit is contained in:
Jaifroid 2024-12-02 06:29:42 +00:00
parent 4be89a276e
commit 539aea5ae4
2 changed files with 10 additions and 4 deletions

View File

@ -394,6 +394,12 @@ footer .btn-xs {
background: rgba(34,34,34,0.8) !important;
}
.console {
font-size: medium;
font-weight:bold;
font-family:consolas,monospace;
}
pre {
font-weight: bold;
}

View File

@ -513,13 +513,13 @@ function requestXhttpData (URL, lang, subj, kiwixDate) {
// Add event listener for click on return link, to go back to list of archives
document.getElementById('returnLink').addEventListener('click', submitSelectValues);
} else {
downloadLinks.innerHTML = '<span style="font-weight:bold;font-family:consolas,monospace;">' +
downloadLinks.innerHTML = '<div class="console">' +
'<p style="color:salmon;">Unable to access the server. Please see message below for reason.</p>' +
'<p>You can either try again or else open one of these mirror links in a new browser window:</p><ul>';
'<p>Try one of these mirror links (opens in a new browser window):</p><ul>';
params.kiwixDownloadMirrors.forEach(function (mirror) {
downloadLinks.innerHTML += '<li><a href="' + mirror + '"' + target + '>' + mirror + '</a></li>';
downloadLinks.innerHTML += '<li class="console"><a href="' + mirror + '"' + target + '>' + mirror.replace(/^([^/]+\/\/[^/]+).*/, '$1') + '</a></li>';
});
downloadLinks.innerHTML += '</ul></span><br />';
downloadLinks.innerHTML += '</ul></div><br />';
}
downloadLinks.style.display = 'block';
}