Website: Add links to responsibilities headings on department handbook pages. (#23159)

Closes: #22995

Changes:
- Updated the handbook's page script to add an unordered list of links
to headings for responsibilities on department handbook pages.
This commit is contained in:
Eric 2024-10-24 17:00:27 -05:00 committed by GitHub
parent d694d0572f
commit f916871b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,6 +123,13 @@ parasails.registerPage('basic-handbook', {
let startValue = parseInt(ol.getAttribute('start'), 10) - 1;
ol.style.counterReset = 'custom-counter ' + startValue;
});
// Add links to the responsibilities under the responsibilities heading.
if($('#responsibilities')){
let responsibilitiesLinksHtml = '<ul>\n';
$('h3').each((unused, el)=>{ responsibilitiesLinksHtml += '<li><a href="#'+_.escape($(el).attr('id'))+'">'+_.escape($(el).text())+'</a></li>\n'; });
responsibilitiesLinksHtml+= '</ul>';
$('#responsibilities + p').after(responsibilitiesLinksHtml);
}
},
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗