pymunk.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $(function (){
  2. console.log("There!")
  3. var createList = function(selector){
  4. var ul = $('<ul>');
  5. var selected = $(selector);
  6. console.log(selected.length);
  7. if (selected.length === 0){
  8. return;
  9. }
  10. selected.clone().each(function (i,e){
  11. var p = $(e).children('.descclassname');
  12. var n = $(e).children('.descname');
  13. var l = $(e).children('.headerlink');
  14. var a = $('<a>');
  15. a.attr('href',l.attr('href')).attr('title', 'Link to this definition');
  16. a.append(p).append(n);
  17. var entry = $('<li>').append(a);
  18. ul.append(entry);
  19. });
  20. return ul;
  21. }
  22. var c = $('<div style="float:left; min-width: 300px;">');
  23. var ul0 = c.clone().append($('.submodule-index'))
  24. customIndex = $('.custom-index');
  25. customIndex.empty();
  26. customIndex.append(ul0);
  27. var x = [];
  28. x.push(['Classes','dl.class > dt']);
  29. x.push(['Functions','dl.function > dt']);
  30. x.push(['Variables','dl.data > dt']);
  31. x.forEach(function (e){
  32. var l = createList(e[1]);
  33. if (l) {
  34. var ul = c.clone()
  35. .append('<p class="rubric">'+e[0]+'</p>')
  36. .append(l);
  37. }
  38. customIndex.append(ul);
  39. });
  40. });