|
1 |
| -<div class="index-wrapper" style="top: {{ sidebarTop }};"> |
| 1 | +<nav class="sidebar"> |
2 | 2 | <ul class="toc">
|
| 3 | + <!-- Redacted documents --> |
3 | 4 | {% assign parent = page.path | first %}
|
4 | 5 | {% for title in sidebar.titles %}
|
5 |
| - <li>{% renderTitle title, parent %}</li> |
| 6 | + {% renderTitle title, parent %} |
6 | 7 | {% endfor %}
|
7 |
| - </ul> |
8 |
| - |
9 |
| - <script> |
10 |
| - function clickToc(elem, currentPage) { |
11 |
| - var sibling = elem.parentElement.children[1]; |
12 |
| - if (sibling.style.display === "" || sibling.style.display === "none") |
13 |
| - sibling.style.display = "block"; |
14 |
| - else |
15 |
| - sibling.style.display = ""; |
16 |
| - } |
17 |
| - |
18 |
| - (function() { |
19 |
| - var activeEntry = document.querySelector("#active-toc-entry") |
20 |
| - |
21 |
| - while (activeEntry != null && activeEntry.tagName.toLowerCase() === "ul") { |
22 |
| - activeEntry.style.display = "block"; |
23 |
| - activeEntry = activeEntry.parentElement.parentElement; |
24 |
| - } |
25 |
| - })(); |
26 |
| - </script> |
27 |
| - |
28 |
| - <ul class="index-entities"> |
29 |
| - {% if docs.size > 0 %} |
30 |
| - <li class="index-title"> |
31 |
| - <span>API</span> |
32 |
| - </li> |
33 |
| - <li> |
34 |
| - <input id="search-api-input" type="text" placeholder="Search API"/> |
35 |
| - <script> |
36 |
| - var input = document.getElementById("search-api-input"); |
37 |
| - input.onkeydown = function(evt) { |
38 |
| - evt = evt || window.event; |
39 |
| - if (evt.keyCode == 13) window.location = ( |
40 |
| - "{{ site.baseurl }}/api/search.html?" + |
41 |
| - "searchTerm=" + input.value + |
42 |
| - "&previousUrl=" + encodeURI(window.location) |
43 |
| - ); |
44 |
| - }; |
45 |
| - </script> |
46 |
| - </li> |
47 |
| - {% endif %} |
48 |
| - {% for pkg in docs %} |
49 |
| - <li class="index-entity entity-package"> |
50 |
| - <h1><a class="entity-name" href="{{ site.baseurl }}/api/{{ pkg.path | join: "/" }}/index.html">{{ pkg.name }}</a></h1> |
51 |
| - <ul class="package-entities"> |
52 |
| - <div id="cover-block"></div> |
53 |
| - {% for member in pkg.children %} |
54 |
| - {% if member.kind == "object" and member.hasCompanion %} |
55 |
| - {% elsif member.kind != "package" %} |
56 |
| - |
57 |
| - {% if forloop.index == 6 and forloop.length > 7 %} |
58 |
| - <li id="show-hidden-by-default" onclick="toggleHiddenByDefault(this);">+ expand rest</li> |
59 |
| - <li class="hidden-by-default {% if member.hasCompanion %} with-companion {% endif %}"> |
60 |
| - {% elsif forloop.index > 6 and forloop.length > 7 %} |
61 |
| - <li class="hidden-by-default {% if member.hasCompanion %} with-companion {% endif %}"> |
62 |
| - {% else %} |
63 |
| - <li class="{% if member.hasCompanion %} with-companion {% endif %}"> |
64 |
| - {% endif %}<!-- end li setter --> |
65 |
| - |
66 |
| - <div class="entity-kinds"> |
67 |
| - {% if member.hasCompanion %} |
68 |
| - <a class="letter-anchor object" href="{{ site.baseurl }}/api/{{ member.companionPath | join: "/" }}.html">O</a> |
69 |
| - {% endif %} |
70 |
| - <a class="letter-anchor {{ member.kind }}" href="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html">{{ member.kind | first | capitalize }}</a> |
71 |
| - </div> |
72 |
| - <a class="entity-name" href="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html">{{ member.name }}</a> |
| 8 | + <!-- API documentation --> |
| 9 | + {% if docs.size > 0 %} |
| 10 | + <li class="index-entities section"> |
| 11 | + <a onclick="toggleSection(this);">API</a> |
| 12 | + <ul> |
| 13 | + {% for pkg in docs %} |
| 14 | + <li class="index-entity entity-package section"> |
| 15 | + <a class="package-toggle" onclick="toggleSection(this);"> |
| 16 | + <i class="fas fa-plus"></i> |
| 17 | + </a> |
| 18 | + <a class="entity-name" href="{{ site.baseurl }}/api/{{ pkg.path | join: "/" }}/index.html"> |
| 19 | + {{ pkg.name }} |
| 20 | + </a> |
| 21 | + <ul class="package-entities"> |
| 22 | + {% for member in pkg.children %} |
| 23 | + {% if member.kind == "object" and member.hasCompanion %} <!-- ignore: companions are handled below --> |
| 24 | + {% elsif member.kind != "package" %} |
| 25 | + |
| 26 | + <li class="{% if member.hasCompanion %} with-companion {% endif %}"> |
| 27 | + <div class="entity-kinds"> |
| 28 | + {% if member.hasCompanion %} |
| 29 | + <a class="letter-anchor object" href="{{ site.baseurl }}/api/{{ member.companionPath | join: "/" }}.html">O</a> |
| 30 | + {% endif %} |
| 31 | + <a class="letter-anchor {{ member.kind }}" href="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html">{{ member.kind | first | capitalize }}</a> |
| 32 | + </div> |
| 33 | + <a class="entity-name" href="{{ site.baseurl }}/api/{{ member.path | join: "/" }}.html">{{ member.name }}</a> |
| 34 | + </li> |
| 35 | + {% endif %} |
| 36 | + |
| 37 | + {% endfor %} |
| 38 | + </ul> |
73 | 39 | </li>
|
74 |
| - |
75 |
| - {% if forloop.last and forloop.index > 6 %} |
76 |
| - <li id="hide-hidden-by-default" onclick="toggleHiddenByDefault(this);">- collapse members</li> |
77 |
| - {% endif %} |
78 |
| - |
79 |
| - {% endif %} <!-- end != "package" --> |
80 |
| - |
81 | 40 | {% endfor %}
|
82 | 41 | </ul>
|
83 | 42 | </li>
|
84 |
| - {% endfor %} |
| 43 | + {% endif %} |
85 | 44 | </ul>
|
86 |
| -</div> |
87 |
| -<script> |
88 |
| - function toggleHiddenByDefault(li) { |
89 |
| - var ul = li.parentElement; |
90 |
| - |
91 |
| - for (var i = 0; i < ul.children.length; i++) { |
92 |
| - var childLi = ul.children[i]; |
93 |
| - if (childLi.classList.contains('hidden-by-default') || childLi.id == "hide-hidden-by-default" || childLi.id == "show-hidden-by-default") { |
94 |
| - childLi.classList.toggle('toggled'); |
95 |
| - } |
96 |
| - } |
97 |
| - } |
98 |
| -</script> |
| 45 | +</nav> |
| 46 | +<script src="{{ site.baseurl }}/js/sidebar.js"></script> |
0 commit comments