acls.tx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Visibility<br />
  2. <select id="<: $post.id :>-visibility" class="cooltext" name="visibility">
  3. : for $post_visibilities -> $visibility {
  4. <option <: $post.visibility == $visibility ? 'selected' : '' :> value="<: $visibility :>"><: $visibility :></option>
  5. : }
  6. </select>
  7. <div id="<: $post.id :>-aclselect" style="display:none;" >
  8. ACLs / Series<br/ >
  9. <select multiple class="cooltext" name="acls">
  10. : for $acls -> $acl {
  11. : if ($acl.aclname != 'public' && $acl.aclname != 'private' && $acl.aclname != 'unlisted') {
  12. <option value="<: $acl.aclname :>"><: $acl.data :></option>
  13. : }
  14. : }
  15. </select>
  16. </div>
  17. <script type="text/javascript">
  18. document.addEventListener("DOMContentLoaded", function(event) {
  19. var viselect = document.getElementById("<: $post.id :>-visibility");
  20. if (viselect.value == 'private') {
  21. switchMenu("<: $post.id :>-aclselect");
  22. }
  23. viselect.addEventListener("change", function(event) {
  24. var el = document.getElementById("<: $post.id :>-aclselect");
  25. var shown = el.style.display != 'none'
  26. if (shown) {
  27. if (this.value != 'private') {
  28. switchMenu("<: $post.id :>-aclselect");
  29. }
  30. return;
  31. }
  32. if (this.value == 'private') {
  33. switchMenu("<: $post.id :>-aclselect");
  34. }
  35. });
  36. });
  37. </script>