A book about the command line for humans.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
837 B

9 years ago
  1. <script>
  2. $(document).ready(function () {
  3. // ☜ ☝ ☞ ☟ ☆ ✠ ✡ ✢ ✣ ✤ ✥ ✦ ✧ ✩ ✪
  4. var closed_sigil = 'show';
  5. var open_sigil = 'hide';
  6. var togglesigil = function (elem) {
  7. var sigil = $(elem).html();
  8. if (sigil === closed_sigil) {
  9. $(elem).html(open_sigil);
  10. } else {
  11. $(elem).html(closed_sigil);
  12. }
  13. };
  14. $(".details").each(function () {
  15. var $this = $(this);
  16. var $button = $('<button class=clicker-button>' + closed_sigil + '</button>');
  17. var $details_full = $(this).find('.full');
  18. $button.click(function (e) {
  19. e.preventDefault();
  20. $details_full.toggle({
  21. duration: 550
  22. });
  23. togglesigil(this);
  24. });
  25. $(this).find('.clicker').append($button);
  26. $button.show();
  27. });
  28. $('.details .full').hide();
  29. });
  30. </script>
  31. </body>
  32. </html>