Update anomaly navigation badge functionality and localization, increment version code to 4.72.771
This commit enhances the anomaly navigation badge by updating the label format to include a count of items to review. The JavaScript and PHP files are modified to support this new format, improving user feedback on the number of anomalies. Additionally, new localization keys are added for the formatted label in both French and English. The version code is incremented to 4.72.771 to reflect these updates.
This commit is contained in:
@ -478,7 +478,7 @@
|
||||
if (toolId === 'anomalies') {
|
||||
var anomCount = panel.querySelector('.bib-anomalies-count');
|
||||
var destBadge = dest.querySelector('[data-bib-anomalies-nav-badge]');
|
||||
var strTodo = bibJs('jsAnomaliesNavTodo') || 'Élément à valider';
|
||||
var strTodoFmt = bibJs('jsAnomaliesNavTodoFmt') || 'Élément à valider : %d';
|
||||
var intCount = 0;
|
||||
var blnPending = true;
|
||||
|
||||
@ -492,13 +492,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
function bibAnomaliesNavBadgeLabel(count) {
|
||||
return strTodoFmt.replace(/%d/g, String(count));
|
||||
}
|
||||
|
||||
if (!destBadge) {
|
||||
dest.innerHTML = '';
|
||||
if (!blnPending && intCount > 0) {
|
||||
var strLabel = bibAnomaliesNavBadgeLabel(intCount);
|
||||
dest.innerHTML = '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
|
||||
+ ' data-bib-anomalies-nav-badge="1"'
|
||||
+ ' title="' + strTodo.replace(/"/g, '"') + '">'
|
||||
+ strTodo
|
||||
+ ' data-bib-anomalies-nav-count="' + intCount + '"'
|
||||
+ ' title="' + strLabel.replace(/"/g, '"') + '">'
|
||||
+ strLabel
|
||||
+ '</span>';
|
||||
}
|
||||
return;
|
||||
@ -508,11 +514,14 @@
|
||||
destBadge.classList.add('bib-ui-hidden');
|
||||
destBadge.setAttribute('aria-hidden', 'true');
|
||||
destBadge.textContent = '';
|
||||
destBadge.removeAttribute('data-bib-anomalies-nav-count');
|
||||
} else {
|
||||
var strBadgeLabel = bibAnomaliesNavBadgeLabel(intCount);
|
||||
destBadge.classList.remove('bib-ui-hidden');
|
||||
destBadge.removeAttribute('aria-hidden');
|
||||
destBadge.textContent = strTodo;
|
||||
destBadge.setAttribute('title', strTodo);
|
||||
destBadge.textContent = strBadgeLabel;
|
||||
destBadge.setAttribute('title', strBadgeLabel);
|
||||
destBadge.setAttribute('data-bib-anomalies-nav-count', String(intCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user