Mercurial > hgrepos > hgweb.cgi > s4
diff s4-main.js @ 659:a36a2c3b3056
GrpAction: Reverse selection and supplemental rcpt address
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 11 May 2020 20:08:29 +0900 |
parents | f480fa97fba6 |
children | 9ee0e242c25a |
line wrap: on
line diff
--- a/s4-main.js Mon May 11 19:46:57 2020 +0900 +++ b/s4-main.js Mon May 11 20:08:29 2020 +0900 @@ -54,7 +54,13 @@ textarea.value = lines.join("\n"); } } - function init() { + function reverseChecks() { + var names = collectElementsByNameAttr("input", "usel"); + for (let u of names) { + u.checked = !u.checked; + } + } + function initBlogs() { var el, check = collectElementsByNameAttr("input", "notifyto"); if (check) for (let i of check) { @@ -65,5 +71,16 @@ if (RegExp.lastMatch == i.innerHTML) i.addEventListener("click", insertRedirect, null) } + function initGrpAction() { + var rev = document.getElementById("reverse"); + if (rev && rev.tagName.match(/span/i)) { + rev.textContent = " 反転 "; + rev.addEventListener("click", reverseChecks, null); + } + } + function init() { + initGrpAction(); + initBlogs(); + } document.addEventListener('DOMContentLoaded', init, null); })();