// ==UserScript== // @name Add post numbers to Reactor // @namespace http://tampermonkey.net/ // @version 2024-08-22 // @description Brings back the post numbers on comments // @author OpenAI and Strahan // @match https://reactormag.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=reactormag.com // @grant none // @require https://code.jquery.com/jquery-3.7.1.min.js // ==/UserScript== /* global $ */ (function() { 'use strict'; let debounceTimer; function updatePostNumbers() { $(".wpd-comment-author").each(function(index) { let $this = $(this); if (!$this.data('numbered')) { $this.text((index + 1) + " - " + $this.text()); $this.data('numbered', true); } }); } function debouncedUpdate() { clearTimeout(debounceTimer); debounceTimer = setTimeout(updatePostNumbers, 100); } const targetNode = document.querySelector(".wpd-thread-list"); if (targetNode) { const observer = new MutationObserver(debouncedUpdate); observer.observe(targetNode, { childList: true, subtree: true, }); updatePostNumbers(); } })();