topic.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. function opennamu_do_remove_blind_thread() {
  3. const style = document.querySelector('#opennamu_remove_blind');
  4. if(style !== null) {
  5. if(style.innerHTML !== "") {
  6. style.innerHTML = '';
  7. } else {
  8. style.innerHTML = `
  9. .opennamu_comment_blind_js {
  10. display: none;
  11. }
  12. `;
  13. }
  14. }
  15. }
  16. function opennamu_thread_blind() {
  17. let do_true = 0;
  18. for(let for_a = 0; for_a < document.getElementsByClassName("opennamu_blind_button").length; for_a++) {
  19. let id = document.getElementsByClassName("opennamu_blind_button")[for_a].id;
  20. id = id.replace(/^opennamu_blind_/, '');
  21. id = id.split('_');
  22. let checked = document.getElementsByClassName("opennamu_blind_button")[for_a].checked;
  23. if(checked) {
  24. fetch("/thread/" + id[0] + '/comment/' + id[1] + '/blind', { method : 'GET' });
  25. do_true = 1;
  26. }
  27. }
  28. if(do_true === 1) {
  29. history.go(0);
  30. }
  31. }