An unfinished system to manage all your paper documentation in an easy way.
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.

autodoc.js 814B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* AutoDoc Javascript */
  2. var conf = {
  3. "default_hash": "home"
  4. };
  5. $(document).ready(function() {
  6. change_page();
  7. });
  8. $(window).bind('hashchange', function() {
  9. change_page();
  10. });
  11. function change_page() {
  12. var hash = document.location.hash.substr(1) || conf.default_hash;
  13. if ( ! $("#autodoc_tab_"+hash).length ) {
  14. hash = conf.default_hash;
  15. }
  16. /* change menu highlights and content visibility */
  17. $('#autodoc_navbar').find("a").each(function(id, obj) {
  18. var curhash = $(obj).attr('href').substr(1);
  19. if ( curhash == hash ) {
  20. console.log("add " + curhash);
  21. $(obj).parent().addClass('active');
  22. $('#autodoc_tab_'+curhash).removeClass('d-none');
  23. }
  24. else {
  25. console.log("remove " + curhash);
  26. $(obj).parent().removeClass('active');
  27. $('#autodoc_tab_'+curhash).addClass('d-none');
  28. }
  29. });
  30. }