# HG changeset patch # User HIROSE Yuuji # Date 1653778544 -32400 # Node ID ec5cb1790119ffe954a7ef1948763dfe25b29fc3 # Parent 39ef64b5654de3745a6f586fe9ef78800d21b9a3 Apply referring hover to td ajax-posted diff -r 39ef64b5654d -r ec5cb1790119 s4-main.js --- a/s4-main.js Sat May 28 23:18:43 2022 +0900 +++ b/s4-main.js Sun May 29 07:55:44 2022 +0900 @@ -184,6 +184,7 @@ localntr.classList.remove("dissolving"); localntr.classList.add("emerging"); }, 100); + initReplyHover(ntr); cnt++; } mathjaxUpdate(newids); @@ -1033,7 +1034,7 @@ }); ta.parentNode.appendChild(btn); } - function initReplyHover() { + function initReplyHover(unit) { function getTextById(id) { let repltd = document.getElementById(id); if (repltd) { @@ -1046,7 +1047,8 @@ } else return ""; } - for (let td of document.querySelectorAll("td.repl")) { + unit = unit||document; + for (let td of unit.querySelectorAll("td.repl")) { let text = td.innerHTML; if (text.startsWith("\>#")) { let newline = text.indexOf("\n"); @@ -1056,8 +1058,9 @@ /#([0-9]+)/g, (match, start, whole) => { let id = RegExp.$1 - return '' - + match + ''; + return '' + match + ''; } ) + rest; }