Browse Source

Docs: added button that opens github's editor.
We'll see if this works out :P

Mr.doob 13 years ago
parent
commit
7114e1a840
1 changed files with 26 additions and 1 deletions
  1. 26 1
      docs/index.html

+ 26 - 1
docs/index.html

@@ -95,17 +95,42 @@
 					background-color: #f9f9f9;
 					background-color: #f9f9f9;
 					overflow: auto;
 					overflow: auto;
 				}
 				}
+
+			#button {
+				position: fixed;
+				top: 20px;
+				right: 30px;
+				padding: 8px;
+				color: #fff;
+				background-color: #555;
+				opacity: 0.5;
+			}
+
+				#button:hover {
+					cursor: pointer;
+					opacity: 1;
+				}
 		</style>
 		</style>
 	</head>
 	</head>
 	<body>
 	<body>
 		<div id="panel"></div>
 		<div id="panel"></div>
 		<div id="viewer"></div>
 		<div id="viewer"></div>
+		<div id="button">Edit this page</div>
 
 
 		<script>
 		<script>
 			var REVISION = '49dev';
 			var REVISION = '49dev';
 
 
+			var path = null;
+
 			var panel = document.getElementById( 'panel' );
 			var panel = document.getElementById( 'panel' );
 			var viewer = document.getElementById( 'viewer' );
 			var viewer = document.getElementById( 'viewer' );
+			var button = document.getElementById( 'button' );
+
+			button.addEventListener( 'click', function ( event ) {
+
+				window.open( 'https://github.com/mrdoob/three.js/edit/dev/docs/api/' + path + '.html' );
+
+			} );
 
 
 			var pages = {
 			var pages = {
 				"Integer": "Integer",
 				"Integer": "Integer",
@@ -333,7 +358,7 @@
 
 
 			function goTo( name ) {
 			function goTo( name ) {
 
 
-				var path = pages[ name ];
+				path = pages[ name ];
 
 
 				window.location.hash = name;
 				window.location.hash = name;
 				viewer.innerHTML = '';
 				viewer.innerHTML = '';