浏览代码

Merge pull request #5383 from alexan0308/highlighting

Patch to a way to a scripts with an Syntax highlighting
Mr.doob 10 年之前
父节点
当前提交
9c1e9b911b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      docs/page.js

+ 3 - 3
docs/page.js

@@ -62,18 +62,18 @@ var onDocumentLoad = function ( event ) {
 	// Syntax highlighting
 
 	var styleBase = document.createElement( 'link' );
-	styleBase.href = '../../prettify/prettify.css';
+	styleBase.href = pathname.substring( 0, pathname.indexOf( 'docs' ) + 4 ) + '/prettify/prettify.css';
 	styleBase.rel = 'stylesheet';
 
 	var styleCustom = document.createElement( 'link' );
-	styleCustom.href = '../../prettify/threejs.css';
+	styleCustom.href = pathname.substring( 0, pathname.indexOf( 'docs' ) + 4 ) + '/prettify/threejs.css';
 	styleCustom.rel = 'stylesheet';
 
 	document.head.appendChild( styleBase );
 	document.head.appendChild( styleCustom );
 
 	var prettify = document.createElement( 'script' );
-	prettify.src = '../../prettify/prettify.js';
+	prettify.src = pathname.substring( 0, pathname.indexOf( 'docs' ) + 4 ) + '/prettify/prettify.js';
 
 	prettify.onload = function () {