|
52 | 52 | }
|
53 | 53 |
|
54 | 54 | #panel h2 {
|
| 55 | + color: #454545; |
| 56 | + font-size: 18px; |
| 57 | + font-weight: normal; |
| 58 | + |
| 59 | + margin-top: 20px; |
| 60 | + margin-left: 20px; |
| 61 | + } |
| 62 | + |
| 63 | + #panel h3 { |
55 | 64 | color: #666;
|
56 | 65 | font-size: 16px;
|
57 | 66 | font-weight: normal;
|
|
91 | 100 |
|
92 | 101 | var html = '<h1>three.js<span style="font-size: 50%; vertical-align: super;"> r' + REVISION + '</span></h1>';
|
93 | 102 |
|
94 |
| - for ( var category in list ) { |
| 103 | + for ( var section in list ) { |
95 | 104 |
|
96 |
| - html += '<h2>' + category + '</h2>'; |
| 105 | + html += '<h2>' + section + '</h2>'; |
97 | 106 |
|
98 | 107 | html += '<ul>';
|
99 | 108 |
|
100 |
| - for ( var i = 0; i < list[ category ].length; i ++ ) { |
| 109 | + for ( var category in list[ section ] ) { |
| 110 | + |
| 111 | + html += '<h3>' + category + '</h3>'; |
| 112 | + |
| 113 | + html += '<ul>'; |
| 114 | + |
| 115 | + for ( var i = 0; i < list[ section ][ category ].length; i ++ ) { |
| 116 | + |
| 117 | + var page = list[ section ][ category ][ i ]; |
| 118 | + |
| 119 | + html += '<li><a href="javascript:goTo(\'' + section + '\', \'' + category + '\', \'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>'; |
101 | 120 |
|
102 |
| - var page = list[ category ][ i ]; |
| 121 | + } |
103 | 122 |
|
104 |
| - html += '<li><a href="javascript:goTo(\'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>'; |
| 123 | + html += '</ul>'; |
105 | 124 |
|
106 | 125 | }
|
107 | 126 |
|
|
113 | 132 |
|
114 | 133 | // Page loading
|
115 | 134 |
|
116 |
| - function goTo( name ) { |
| 135 | + function goTo( section, category, name ) { |
117 | 136 |
|
118 |
| - var path = pages[ name ]; |
| 137 | + var path = pages[ section ][ category ][ name ]; |
119 | 138 |
|
120 |
| - window.document.title = 'three.js - documentation - ' + name; |
| 139 | + window.document.title = 'three.js - documentation - ' + section + ': ' + name; |
121 | 140 |
|
122 |
| - window.location.hash = name; |
123 |
| - viewer.src = 'api/' + path + '.html'; |
| 141 | + window.location.hash = section + '/' + category + '/' + name; |
| 142 | + section = section.toLowerCase(); |
| 143 | + viewer.src = section + '/' + path + '.html'; |
124 | 144 |
|
125 | 145 | }
|
126 | 146 |
|
127 | 147 | function goToHash() {
|
128 | 148 |
|
129 |
| - goTo( window.location.hash.substring( 1 ) ); |
| 149 | + var hash = window.location.hash.substring( 1 ).split('/'); |
| 150 | + goTo( hash[0], hash[1], hash[2] ); |
130 | 151 |
|
131 | 152 | }
|
132 | 153 |
|
|
0 commit comments