Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5225f341
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5225f341
编写于
7月 17, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Docs clean up.
上级
9212298b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
118 deletion
+43
-118
docs/index.html
docs/index.html
+43
-118
未找到文件。
docs/index.html
浏览文件 @
5225f341
...
...
@@ -26,7 +26,7 @@
</div>
<iframe></iframe>
<iframe
name=
"viewer"
></iframe>
<script
src=
"list.js"
></script>
...
...
@@ -44,11 +44,6 @@
var
categoryElements
=
[];
// ----------------------------------------------------------------------------
// Initialization
// ----------------------------------------------------------------------------
// Functionality for hamburger button (on small devices)
expandButton
.
onclick
=
function
(
event
)
{
...
...
@@ -79,28 +74,40 @@
};
// Activate content and title change on browser navigation
window
.
onpopstate
=
createNewIframe
;
// Create the navigation panel and configure the iframe
createNavigation
();
createNewIframe
();
// Navigation Panel
function
createLink
(
pageName
,
pageURL
)
{
var
link
=
document
.
createElement
(
'
a
'
);
link
.
href
=
pageURL
+
'
.html
'
;
link
.
textContent
=
pageName
;
link
.
setAttribute
(
'
target
'
,
'
viewer
'
);
link
.
addEventListener
(
'
click
'
,
function
(
event
)
{
// ----------------------------------------------------------------------------
// Navigation Panel
// ----------------------------------------------------------------------------
window
.
location
.
hash
=
pageURL
;
panel
.
classList
.
add
(
'
collapsed
'
);
}
);
return
link
;
}
function
createNavigation
()
{
function
createNavigation
()
{
// Create the navigation panel using data from list.js
var
navigation
=
createAndAppendDOMElement
(
{
type
:
'
div
'
,
parent
:
content
}
);
var
navigation
=
document
.
createElement
(
'
div
'
);
content
.
appendChild
(
navigation
);
for
(
var
section
in
list
)
{
...
...
@@ -108,7 +115,9 @@
var
categories
=
list
[
section
];
var
sectionHead
=
createAndAppendDOMElement
(
{
type
:
'
h2
'
,
parent
:
navigation
,
content
:
section
}
)
var
sectionHead
=
document
.
createElement
(
'
h2
'
);
sectionHead
.
textContent
=
section
;
navigation
.
appendChild
(
sectionHead
);
for
(
var
category
in
categories
)
{
...
...
@@ -116,9 +125,15 @@
var
pages
=
categories
[
category
];
var
categoryContainer
=
createAndAppendDOMElement
(
{
type
:
'
div
'
,
parent
:
navigation
}
);
var
categoryHead
=
createAndAppendDOMElement
(
{
type
:
'
h3
'
,
parent
:
categoryContainer
,
content
:
category
}
);
var
categoryContent
=
createAndAppendDOMElement
(
{
type
:
'
ul
'
,
parent
:
categoryContainer
}
);
var
categoryContainer
=
document
.
createElement
(
'
div
'
);
navigation
.
appendChild
(
categoryContainer
);
var
categoryHead
=
document
.
createElement
(
'
h3
'
);
categoryHead
.
textContent
=
category
;
categoryContainer
.
appendChild
(
categoryHead
);
var
categoryContent
=
document
.
createElement
(
'
ul
'
);
categoryContainer
.
appendChild
(
categoryContent
);
for
(
var
pageName
in
pages
)
{
...
...
@@ -126,14 +141,11 @@
var
pageURL
=
pages
[
pageName
];
var
listElement
=
createAndAppendDOMElement
(
{
type
:
'
li
'
,
parent
:
categoryContent
}
);
var
linkElement
=
createAndAppendDOMElement
(
{
type
:
'
a
'
,
parent
:
listElement
,
content
:
pageName
}
);
// The href attribute is only used for the option to create a new tab by right click
var
listElement
=
document
.
createElement
(
'
li
'
);
categoryContent
.
appendChild
(
listElement
);
linkElement
.
setAttribute
(
'
href
'
,
'
#
'
+
pageURL
);
addClickHandlers
(
linkElement
,
pageURL
);
var
linkElement
=
createLink
(
pageName
,
pageURL
)
listElement
.
appendChild
(
linkElement
);
// Gather the main properties for the current subpage
...
...
@@ -158,92 +170,15 @@
}
};
function
createAndAppendDOMElement
(
properties
)
{
// Helper function for creating and appending new DOM elements
var
newElement
=
document
.
createElement
(
properties
.
type
);
properties
.
parent
.
appendChild
(
newElement
);
if
(
properties
.
content
)
{
newElement
.
textContent
=
properties
.
content
;
}
return
newElement
;
}
function
addClickHandlers
(
linkElement
,
pageURL
)
{
// Helper function for adding ClickHandlers to the page links
linkElement
.
onclick
=
function
(
event
)
{
event
.
preventDefault
();
window
.
location
.
hash
=
pageURL
;
createNewIframe
();
panel
.
classList
.
add
(
'
collapsed
'
);
};
};
// ----------------------------------------------------------------------------
// Query Strings (optional)
// ----------------------------------------------------------------------------
// (uncomment the following lines and the first line in updateFilter(), if you want query strings):
// filterInput.value = extractFromQueryString();
// updateFilter();
//
//
// function extractFromQueryString() {
//
// var queryString = window.location.search;
//
// if ( queryString.indexOf( '?q=' ) === -1 ) return '';
//
// return queryString.substr( 3 );
//
// }
//
// function updateQueryString() {
//
// var searchString = filterInput.value;
// var query = '';
//
// if (searchString !== '') {
//
// query = '?q=' + searchString;
//
// }
//
// window.history.replaceState( {} , '', window.location.pathname + query + window.location.hash );
//
// }
// ----------------------------------------------------------------------------
// Filtering
// ----------------------------------------------------------------------------
// Filtering
function
updateFilter
()
{
//
(uncomment the following line and the "Query strings" section, if you want query strings):
//
updateQueryString();
//
(uncomment the following line and the "Query strings" section, if you want query strings):
//
updateQueryString();
var
regExp
=
new
RegExp
(
filterInput
.
value
,
'
gi
'
);
...
...
@@ -284,7 +219,6 @@
}
function
displayFilteredPanel
()
{
// Show/hide categories depending on their content
...
...
@@ -327,10 +261,7 @@
}
// ----------------------------------------------------------------------------
// Routing
// ----------------------------------------------------------------------------
// Routing
function
setUrlFragment
(
pageName
)
{
...
...
@@ -352,7 +283,6 @@
}
function
createNewIframe
()
{
// Change the content displayed in the iframe
...
...
@@ -391,11 +321,10 @@
}
function
decomposePageName
(
pageName
,
oldDelimiter
,
newDelimiter
)
{
function
decomposePageName
(
pageName
,
oldDelimiter
,
newDelimiter
)
{
// Helper function for separating the member (if existing) from the pageName
// For example: 'Geometry.morphTarget' can be converted to
// For example: 'Geometry.morphTarget' can be converted to
// ['Geometry', '.morphTarget'] or ['Geometry', '#morphTarget']
// Note: According RFC 3986 no '#' allowed inside of an URL fragment!
...
...
@@ -419,11 +348,7 @@
}
// ----------------------------------------------------------------------------
// ASCII Art ;-)
// ----------------------------------------------------------------------------
//
console
.
log
([
'
__ __
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录