User:Polygnotus/DuplicateReferences.js: Difference between revisions

Content deleted Content added
highlight on hover
No edit summary
Line 13:
style.textContent = `
li:target { border: 4px dotted red; padding: 2px;}
.duplicate-citation-highlight { background-color: #ffe6e6; }
.duplicate-citation-highlight { background-color: #ffcccc; }
`;
document.head.appendChild(style);
Line 281 ⟶ 280:
paragraphInfo.appendChild(link);
 
// Highlight only the duplicatespecific citations in theduplicates referenceon listhover
constlink.addEventListener('mouseover', citationElement() => document.getElementById(ref.citeNote);{
if refInfo.forEach(citationElement)duplicate => {
const citationElement = document.classList.addgetElementById('duplicate-citation'.citeNote);
link.addEventListener('mouseover', if (citationElement) => {
citationElement.classList.add('duplicate-citation-highlight');
}
});
});
link.addEventListener('mouseout', () => {
citationElementrefInfo.classList.removeforEach('duplicate-citation-highlight'); => {
const citationElement = document.getElementById(duplicate.citeNote);
if (citationElement) {
citationElement.classList.remove('duplicate-citation-highlight');
}
});
});
} else {
paragraphInfo.appendChild(document.createTextNode(ref.refNumber));