User:Polygnotus/Scripts/ReferenceHighlighter.js: Difference between revisions

Content deleted Content added
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1:
//perhaps add this to duplicatereferences
 
// Wikipedia Reference Highlighter
$(function() {
Line 16 ⟶ 18:
// Highlight all the "Jump up to" links in the current reference
citationElement.find('.mw-cite-backlink a[href^="#cite_ref-' + baseId + '"]').each(function() {
$(this).addClass('reference-highlight');
});
// Highlight the clicked element differently
$(clickedElement).closest('sup, li, a').addClass('reference-highlight-clicked');
}
Line 42 ⟶ 44:
e.preventDefault();
var href = $(this).attr('href');
var baseId = href$(this).splitclosest('-li').attr('id')[1].split('-')[01];
highlightReferences(baseId, this);