comparison s4-main.js @ 981:eb51a80f73c2 draft

Divide task of ReplyHover()
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 31 May 2022 11:59:33 +0900
parents f0b63223cb80
children f5a7fbd6c0d0
comparison
equal deleted inserted replaced
980:f0b63223cb80 981:eb51a80f73c2
182 let localntr = ntr; 182 let localntr = ntr;
183 setTimeout(() => { 183 setTimeout(() => {
184 localntr.classList.remove("dissolving"); 184 localntr.classList.remove("dissolving");
185 localntr.classList.add("emerging"); 185 localntr.classList.add("emerging");
186 }, 100); 186 }, 100);
187 initReplyHover(ntr); 187 rewriteReplyHover(ntr);
188 cnt++; 188 cnt++;
189 } 189 }
190 mathjaxUpdate(newids); 190 mathjaxUpdate(newids);
191 console.log("Update "+cnt+"rows"); 191 console.log("Update "+cnt+"rows");
192 if (cnt>0 && ntr.scrollIntoView) { 192 if (cnt>0 && ntr.scrollIntoView) {
1032 ta.focus(); 1032 ta.focus();
1033 helpMarkdownPreview(ta); 1033 helpMarkdownPreview(ta);
1034 }); 1034 });
1035 ta.parentNode.appendChild(btn); 1035 ta.parentNode.appendChild(btn);
1036 } 1036 }
1037 function initReplyHover(unit) { 1037 function rewriteReplyHover(unit) {
1038 function getTextById(id) { 1038 function getTextById(id) {
1039 let repltd = document.getElementById(id); 1039 let repltd = document.getElementById(id);
1040 if (repltd) { 1040 if (repltd) {
1041 let txt = repltd.innerText, 1041 let txt = repltd.innerText,
1042 authtd = repltd.parentNode.getElementsByTagName("td")[0], 1042 authtd = repltd.parentNode.getElementsByTagName("td")[0],
1069 } 1069 }
1070 ) + rest; 1070 ) + rest;
1071 } 1071 }
1072 } 1072 }
1073 } 1073 }
1074 function initReplyHover(unit) {
1075 if (mathjax && MathJax.startup)
1076 MathJax.startup.promise.then(()=>rewriteReplyHover());
1077 else
1078 rewriteReplyHover();
1079 }
1074 function init() { 1080 function init() {
1075 isOlderJS = !("insertAdjacentElement" in document.body); 1081 isOlderJS = !("insertAdjacentElement" in document.body);
1076 initGrpAction(); 1082 initGrpAction();
1077 initBlogs(); 1083 initBlogs();
1078 initFileInput(); 1084 initFileInput();
1079 initTextarea(); 1085 initTextarea();
1080 initGrphome(); 1086 initGrphome();
1081 initMath(); 1087 initMath();
1082 if (mathjax && MathJax.startup) 1088 initReplyHover();
1083 MathJax.startup.promise.then(()=>initReplyHover());
1084 else
1085 initReplyHover();
1086 } 1089 }
1087 document.addEventListener('DOMContentLoaded', init, null); 1090 document.addEventListener('DOMContentLoaded', init, null);
1088 })(); 1091 })();

yatex.org