浏览代码

Docs: Improved page titles.

Mr.doob 7 年之前
父节点
当前提交
8a0440fa90
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      docs/index.html
  2. 2 2
      docs/page.js

+ 2 - 2
docs/index.html

@@ -307,7 +307,7 @@
 				if(hash) {
 				if(hash) {
 
 
 					iframe.src = splitHash[ 0 ] + '.html' + splitHash[ 1 ];
 					iframe.src = splitHash[ 0 ] + '.html' + splitHash[ 1 ];
-					subtitle = ' - ' + titles[ splitHash[ 0 ] ] + splitHash[ 1 ];
+					subtitle = titles[ splitHash[ 0 ] ] + splitHash[ 1 ] + ' - ';
 
 
 				} else {
 				} else {
 
 
@@ -317,7 +317,7 @@
 				}
 				}
 
 
 				document.body.replaceChild( iframe, oldIframe );
 				document.body.replaceChild( iframe, oldIframe );
-				document.title = 'three.js docs' + subtitle;
+				document.title = subtitle + 'three.js docs';
 
 
 			}
 			}
 
 

+ 2 - 2
docs/page.js

@@ -24,7 +24,7 @@ if ( !window.frameElement && window.location.protocol !== 'file:' ) {
 }
 }
 
 
 
 
-var onDocumentLoad = function ( event ) {
+function onDocumentLoad( event ) {
 
 
 	var path;
 	var path;
 	var pathname = window.location.pathname;
 	var pathname = window.location.pathname;
@@ -69,7 +69,7 @@ var onDocumentLoad = function ( event ) {
 	text = text.replace( /\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
 	text = text.replace( /\[example:([\w\_]+)\]/gi, "[example:$1 $1]" ); // [example:name] to [example:name title]
 	text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, "<a href=\"../examples/#$1\"  target=\"_blank\">$2</a>" ); // [example:name title]
 	text = text.replace( /\[example:([\w\_]+) ([\w\:\/\.\-\_ \s]+)\]/gi, "<a href=\"../examples/#$1\"  target=\"_blank\">$2</a>" ); // [example:name title]
 
 
-	
+
 	document.body.innerHTML = text;
 	document.body.innerHTML = text;
 
 
 	// handle code snippets formatting
 	// handle code snippets formatting