topic_sub.js 646 B

1234567891011121314151617181920
  1. "use strict";
  2. function opennamu_thread_blind() {
  3. let do_true = 0;
  4. for(let for_a = 0; for_a < document.getElementsByClassName("opennamu_blind_button").length; for_a++) {
  5. let id = document.getElementsByClassName("opennamu_blind_button")[for_a].id;
  6. id = id.replace(/^opennamu_blind_/, '');
  7. id = id.split('_');
  8. let checked = document.getElementsByClassName("opennamu_blind_button")[for_a].checked;
  9. if(checked) {
  10. fetch("/thread/" + id[0] + '/comment/' + id[1] + '/blind', { method : 'GET' });
  11. do_true = 1;
  12. }
  13. }
  14. if(do_true === 1) {
  15. history.go(0);
  16. }
  17. }