comparison s4-main.js @ 1003:5bd1b5125049 draft

Direct link to lshandoutall in group home for grp-admin
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 11 Dec 2022 17:19:32 +0859
parents 47b3e770372d
children 1ffaa8b2b1bf
comparison
equal deleted inserted replaced
1002:47b3e770372d 1003:5bd1b5125049
1187 if (mathjax && MathJax.startup) 1187 if (mathjax && MathJax.startup)
1188 MathJax.startup.promise.then(()=>rewriteReplyHover()); 1188 MathJax.startup.promise.then(()=>rewriteReplyHover());
1189 else 1189 else
1190 rewriteReplyHover(); 1190 rewriteReplyHover();
1191 } 1191 }
1192 var getHandoutCSV;
1193 function initGetHandoutCSV() {
1194 getHandoutCSV = document.getElementById("gethandoutcsv");
1195 if (!getHandoutCSV) return;
1196 document.getElementById("bommsg").innerText =
1197 `Excelで開く場合は上記CSVリンクをCtrlを押しながら。
1198 You need to click CSV link above with Ctrl-key when you handle CSV with Excel`;
1199 getHandoutCSV.addEventListener("click", (e) => {
1200 e.preventDefault(); // Stop visiting link
1201 let bom = e.ctrlKey;
1202 let csv = document.getElementById("totalcsv");
1203 if (!csv || !csv.textContent) return;
1204 let fn = "report-count", plus=myurl.lastIndexOf("+");
1205 if (plus) fn += ("-"+myurl.substring(1+plus));
1206 fn = fn.replace(/#.*/, "");
1207 downloadFile(fn+".csv", csv.textContent, bom);
1208 });
1209 }
1192 function init() { 1210 function init() {
1193 isOlderJS = !("insertAdjacentElement" in document.body); 1211 isOlderJS = !("insertAdjacentElement" in document.body);
1194 initGrpAction(); 1212 initGrpAction();
1195 initBlogs(); 1213 initBlogs();
1196 initFileInput(); 1214 initFileInput();
1197 initTextarea(); 1215 initTextarea();
1198 initGrphome(); 1216 initGrphome();
1199 initMath(); 1217 initMath();
1200 initReplyHover(); 1218 initReplyHover();
1219 initGetHandoutCSV();
1201 } 1220 }
1202 document.addEventListener('DOMContentLoaded', init, null); 1221 document.addEventListener('DOMContentLoaded', init, null);
1203 })(); 1222 })();

yatex.org