Match Kiwix JS coding for API panel

Former-commit-id: 77d4b0aac60bae01e768d6df4fdfa3c5f798c08b
This commit is contained in:
Jaifroid 2022-12-22 15:05:06 +00:00
parent 3f7c059774
commit a2bc2a7516

View File

@ -837,7 +837,7 @@ define(rqDef, function(util) {
params.decompressorAPI.assemblerMachineType = assemblerMachineType; params.decompressorAPI.assemblerMachineType = assemblerMachineType;
params.decompressorAPI.errorStatus = 'Error loading ' + decoderType + ' decompressor!'; params.decompressorAPI.errorStatus = 'Error loading ' + decoderType + ' decompressor!';
var decompAPI = document.getElementById('decompressorAPIStatus'); var decompAPI = document.getElementById('decompressorAPIStatus');
decompAPI.innerHTML = 'Decompressor API: ' + params.decompressorAPI.errorStatus; decompAPI.textContent = 'Decompressor API: ' + params.decompressorAPI.errorStatus;
decompAPI.className = 'apiBroken'; decompAPI.className = 'apiBroken';
document.getElementById('apiStatusDiv').className = 'panel panel-danger'; document.getElementById('apiStatusDiv').className = 'panel panel-danger';
} }
@ -845,9 +845,11 @@ define(rqDef, function(util) {
// Reports the search provider to the API Status Panel // Reports the search provider to the API Status Panel
function reportSearchProviderToAPIStatusPanel(provider) { function reportSearchProviderToAPIStatusPanel(provider) {
var providerAPI = document.getElementById('searchProviderStatus'); var providerAPI = document.getElementById('searchProviderStatus');
providerAPI.innerHTML = 'Search Provider: ' + (/^fulltext/.test(provider) ? 'Title + Xapian [' + provider + ']' : if (providerAPI) { // NB we need this so that tests don't fail
/^title/.test(provider) ? 'Title only [' + provider + ']' : 'Not initialized'); providerAPI.textContent = 'Search Provider: ' + (/^fulltext/.test(provider) ? 'Title + Xapian [' + provider + ']' :
providerAPI.className = /^fulltext/.test(provider) ? 'apiAvailable' : !/ERROR/.test(provider) ? 'apiUnavailable' : 'apiBroken'; /^title/.test(provider) ? 'Title only [' + provider + ']' : 'Not initialized');
providerAPI.className = /^fulltext/.test(provider) ? 'apiAvailable' : !/ERROR/.test(provider) ? 'apiUnavailable' : 'apiBroken';
}
} }
/** /**