Enhance bib tool navigation and detail functionality, update version code to 4.72.766

This commit refines the bib tool navigation layout by implementing a grid-based structure and adding a detail panel for tool descriptions. New CSS styles improve the visual presentation and responsiveness of the tool buttons. Additionally, JavaScript functions are introduced to manage tool detail titles and keyboard interactions, enhancing user experience. The version code is incremented to 4.72.766 to reflect these updates.
This commit is contained in:
2026-07-08 14:46:25 -04:00
parent 74700fcc19
commit 545cbe5dd4
4 changed files with 145 additions and 68 deletions

View File

@ -411,6 +411,23 @@
});
}
function bibSetToolDetailTitle(toolId) {
var titleEl = document.getElementById('bib-tool-detail-title');
if (!titleEl) {
return;
}
if (!toolId) {
titleEl.textContent = '';
return;
}
var btn = moduleBib.querySelector('.bib-tool-btn[data-bib-tool="' + toolId + '"]');
titleEl.textContent = btn
? (btn.getAttribute('data-bib-tool-label') || '')
: '';
}
function bibCloseTool() {
if (!bibActiveTool) {
return;
@ -420,6 +437,7 @@
bibInvalidateToolSlot(bibActiveTool);
bibActiveTool = null;
bibSetActiveToolButton(null);
bibSetToolDetailTitle(null);
var detail = document.getElementById('bib-tool-detail');
var detailBody = document.getElementById('bib-tool-detail-body');
@ -521,10 +539,12 @@
bibActiveTool = toolId;
bibSetActiveToolButton(toolId);
bibSetToolDetailTitle(toolId);
var detail = document.getElementById('bib-tool-detail');
if (detail) {
detail.classList.remove('bib-ui-hidden');
detail.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
if (toolId === 'global_batch') {
@ -882,6 +902,18 @@
});
}
moduleBib.addEventListener('keydown', function (e) {
if (e.key !== 'Enter' && e.key !== ' ') {
return;
}
var toolBtn = e.target.closest('.bib-tool-btn[role="button"]');
if (!toolBtn || !moduleBib.contains(toolBtn)) {
return;
}
e.preventDefault();
bibOpenTool(toolBtn.getAttribute('data-bib-tool'));
});
moduleBib.addEventListener('click', function (e) {
var toolBtn = e.target.closest('.bib-tool-btn');
if (toolBtn && moduleBib.contains(toolBtn)) {