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

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