Content deleted Content added
Polygnotus (talk | contribs) ←Created page with '// Wikipedia Highlighted Comments Navigator // Add to your common.js to navigate through unread highlighted comments $(document).ready(function() { // Wait a bit for the page to fully load and highlights to be applied setTimeout(function() { initCommentNavigator(); }, 1000); }); function initCommentNavigator() { const highlights = $('.ext-discussiontools-init-highlight'); if (highlights.length === 0) { return; // N...' Tag: Recreated |
Polygnotus (talk | contribs) No edit summary |
||
Line 41:
</div>
<div style="display: flex; justify-content: space-between;">
<button id="prev-comment" type="button" style="
background: #0645ad;
color: white;
Line 50:
font-size: 11px;
">← Prev</button>
<button id="next-comment" type="button" style="
background: #0645ad;
color: white;
Line 61:
</div>
<div style="margin-top: 8px; text-align: center;">
<button id="close-navigator" type="button" style="
background: #a2a9b1;
color: #222;
Line 102:
// Event handlers
$('#prev-comment').click(function(e) {
e.preventDefault();
e.stopPropagation();
if (currentIndex > 0) {
currentIndex--;
updateSelection(currentIndex);
}
return false;
});
$('#next-comment').click(function(e) {
e.preventDefault();
e.stopPropagation();
if (currentIndex < highlights.length - 1) {
currentIndex++;
updateSelection(currentIndex);
}
return false;
});
$('#close-navigator').click(function(e) {
e.preventDefault();
e.stopPropagation();
// Remove outlines and hide navigator
highlights.css('outline', '');
$('#comment-navigator').remove();
return false;
});
|