123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>three.js - documentation</title>
- <style>
- @font-face {
- font-family: 'inconsolata';
- src: url('files/inconsolata.woff') format('woff');
- font-weight: normal;
- font-style: normal;
- }
- html {
- height: 100%;
- }
- body {
- background-color: #ffffff;
- margin: 0;
- padding: 0 0 0 260px;
- height: 100%;
- color: #555;
- font-family: 'inconsolata';
- font-size: 15px;
- line-height: 18px;
- overflow: hidden;
- }
- a {
- color: #2194CE;
- text-decoration: none;
- }
- #panel {
- position: fixed;
- left: 0px;
- width: 260px;
- height: 100%;
- overflow: auto;
- background: #fafafa;
- }
- #panel h1 {
- margin-top: 30px;
- margin-bottom: 40px;
- margin-left: 20px;
- font-size: 25px;
- font-weight: normal;
- }
- #panel h2 {
- color: #454545;
- font-size: 18px;
- font-weight: normal;
- margin-top: 20px;
- margin-left: 20px;
- }
- #panel h3 {
- color: #666;
- font-size: 16px;
- font-weight: normal;
- margin-top: 20px;
- margin-left: 20px;
- }
- #panel ul {
- list-style-type: none;
- padding: 0px;
- margin-left: 20px;
- }
- #viewer {
- border: 0px;
- width: 100%;
- height: 100%;
- overflow: auto;
- }
- </style>
- </head>
- <body>
- <div id="panel"></div>
- <iframe id="viewer"></iframe>
- <script src="list.js"></script>
- <script>
- var panel = document.getElementById( 'panel' );
- var viewer = document.getElementById( 'viewer' );
- var html = '<h1><a href="http://threejs.org">three.js</a> / docs</h1>';
- var DELIMITER = '/';
- var nameCategoryMap = {};
- for ( var section in list ) {
- html += '<h2>' + section + '</h2>';
- html += '<ul>';
- for ( var category in list[ section ] ) {
- html += '<h3>' + category + '</h3>';
- html += '<ul>';
- for ( var i = 0; i < list[ section ][ category ].length; i ++ ) {
- var page = list[ section ][ category ][ i ];
- html += '<li><a href="javascript:goTo(\'' + section + '\', \'' + category + '\', \'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>';
- nameCategoryMap[page[0]] = {
- section: section,
- category: category,
- name: page[0]
- };
- }
- html += '</ul>';
- }
- html += '</ul>';
- }
- panel.innerHTML += html;
- function encodeUrl( path ) {
- return path.replace(/\ \/\ /g, '.').replace(/\ /g, '_');
- }
- function decodeUrl( path ) {
- return path.replace(/_/g, ' ').replace(/\./g, ' / ');
- }
- // Page loading
- function goTo( section, category, name ) {
- // Fully resolve links that only provide a name
- if(arguments.length == 1) {
- var location = nameCategoryMap[section];
- section = location.section;
- category = location.category;
- name = location.name;
- }
- var title = 'three.js - documentation - ' + section + ' - ' + name;
- var url = encodeUrl(section) + DELIMITER + encodeUrl( category ) + DELIMITER + encodeUrl(name);
- window.location.hash = url;
- window.document.title = title;
- viewer.src = pages[ section ][ category ][ name ] + '.html';
- }
- function goToHash() {
- var hash = window.location.hash.substring( 1 ).split(DELIMITER);
- goTo( decodeUrl(hash[0]), decodeUrl(hash[1]), decodeUrl(hash[2]) );
- }
- window.addEventListener( 'hashchange', goToHash, false );
- if ( window.location.hash.length > 0 ) goToHash();
- </script>
- </body>
- </html>
|