help.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Opens or closes a section in the help page.
  3. *
  4. * If the currently openend section is toggled, it will just close. If another onw is toggled, it
  5. * will open, and any other currently open sections will be closed.
  6. *
  7. * @param id Id of the section to toggle.
  8. */
  9. function toggleHelp(id){
  10. var helps = document.getElementsByClassName("help");
  11. for (var i = 0; i < helps.length; i++) {
  12. if (helps[i].id == id){
  13. if (helps[i].classList.contains("selected")) helps[i].classList.remove("selected");
  14. else helps[i].classList.add("selected");
  15. }
  16. else helps[i].classList.remove("selected");
  17. }
  18. }
  19. /**
  20. * Hiddes the privacy policy.
  21. */
  22. function closePolicy(){
  23. document.getElementById('policy_cover').style.display = 'none';
  24. document.getElementById('policy').style.display = 'none';
  25. }
  26. /**
  27. * Shows the privacy policy.
  28. */
  29. function openPolicy(){
  30. document.getElementById('policy_cover').style.display = 'block';
  31. document.getElementById('policy').style.display = 'block';
  32. }