Update setHints.js

This commit is contained in:
CalamitousFelicitousness
2025-08-19 23:57:05 +01:00
committed by GitHub
parent 482da0211e
commit 0a047cbb0e
+25
View File
@@ -122,6 +122,27 @@ async function tooltipShow(e) {
content += `<div class="long-content"><div class="separator"></div>${e.target.dataset.longHint}</div>`;
}
// Add reload notice if needed
if (e.target.dataset.reload) {
const reloadType = e.target.dataset.reload;
let reloadText = '';
if (reloadType === 'model') {
reloadText = 'Requires model reload';
} else if (reloadType === 'server') {
reloadText = 'Requires server restart';
}
if (reloadText) {
content += `
<div class="tooltip-reload-notice">
<div class="separator"></div>
<span class="tooltip-reload-text">${reloadText}</span>
</div>
`;
}
}
localeData.hint.innerHTML = content;
localeData.hint.classList.add('tooltip-show');
@@ -302,6 +323,10 @@ async function setHints(analyze = false) {
if (found.longHint && found.longHint.length > 0) {
el.dataset.longHint = found.longHint;
}
// Set reload type if available
if (found.reload && found.reload.length > 0) {
el.dataset.reload = found.reload;
}
el.addEventListener('mouseover', tooltipShow);
el.addEventListener('mouseout', tooltipHide);
} else {