Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
31bedc5f
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
31bedc5f
编写于
11月 01, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor: Added project title.
上级
5cd32066
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
62 addition
and
40 deletion
+62
-40
editor/js/Config.js
editor/js/Config.js
+3
-1
editor/js/Menubar.File.js
editor/js/Menubar.File.js
+9
-3
editor/js/Sidebar.Project.js
editor/js/Sidebar.Project.js
+47
-33
editor/js/libs/app/index.html
editor/js/libs/app/index.html
+3
-3
未找到文件。
editor/js/Config.js
浏览文件 @
31bedc5f
...
...
@@ -8,13 +8,15 @@ var Config = function ( name ) {
'
autosave
'
:
true
,
'
theme
'
:
'
css/light.css
'
,
'
project/title
'
:
''
,
'
project/editable
'
:
false
,
'
project/renderer
'
:
'
WebGLRenderer
'
,
'
project/renderer/antialias
'
:
true
,
'
project/renderer/gammaInput
'
:
false
,
'
project/renderer/gammaOutput
'
:
false
,
'
project/renderer/shadows
'
:
true
,
'
project/editable
'
:
false
,
'
project/vr
'
:
false
,
'
settings/history
'
:
false
...
...
editor/js/Menubar.File.js
浏览文件 @
31bedc5f
...
...
@@ -14,6 +14,8 @@ Menubar.File = function ( editor ) {
//
var
config
=
editor
.
config
;
var
container
=
new
UI
.
Panel
();
container
.
setClass
(
'
menu
'
);
...
...
@@ -266,15 +268,19 @@ Menubar.File = function ( editor ) {
//
var
title
=
config
.
getKey
(
'
project/title
'
);
var
manager
=
new
THREE
.
LoadingManager
(
function
()
{
save
(
zip
.
generate
(
{
type
:
'
blob
'
}
),
'
download
.zip
'
);
save
(
zip
.
generate
(
{
type
:
'
blob
'
}
),
(
title
!==
''
?
title
:
'
untitled
'
)
+
'
.zip
'
);
}
);
var
loader
=
new
THREE
.
FileLoader
(
manager
);
loader
.
load
(
'
js/libs/app/index.html
'
,
function
(
content
)
{
content
=
content
.
replace
(
'
<!-- title -->
'
,
title
);
var
includes
=
[];
if
(
vr
)
{
...
...
@@ -287,12 +293,12 @@ Menubar.File = function ( editor ) {
var
editButton
=
''
;
if
(
editor
.
config
.
getKey
(
'
project/editable
'
)
)
{
if
(
config
.
getKey
(
'
project/editable
'
)
)
{
editButton
=
`
var button = document.createElement( 'a' );
button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json';
button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding:
7px 10px 6px 10px; color: #fff; border: 1px solid #fff
; text-decoration: none;';
button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding:
12px 14px; color: #fff; border: 1px solid #fff; border-radius: 4px
; text-decoration: none;';
button.target = '_blank';
button.textContent = 'EDIT';
document.body.appendChild( button );
...
...
editor/js/Sidebar.Project.js
浏览文件 @
31bedc5f
...
...
@@ -21,7 +21,49 @@ Sidebar.Project = function ( editor ) {
container
.
setBorderTop
(
'
0
'
);
container
.
setPaddingTop
(
'
20px
'
);
// class
// Title
var
titleRow
=
new
UI
.
Row
();
var
title
=
new
UI
.
Input
(
config
.
getKey
(
'
project/title
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/title
'
,
this
.
getValue
()
);
}
);
titleRow
.
add
(
new
UI
.
Text
(
'
Title
'
).
setWidth
(
'
90px
'
)
);
titleRow
.
add
(
title
);
container
.
add
(
titleRow
);
// Editable
var
editableRow
=
new
UI
.
Row
();
var
editable
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/editable
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/editable
'
,
this
.
getValue
()
);
}
);
editableRow
.
add
(
new
UI
.
Text
(
'
Editable
'
).
setWidth
(
'
90px
'
)
);
editableRow
.
add
(
editable
);
container
.
add
(
editableRow
);
// VR
var
vrRow
=
new
UI
.
Row
();
var
vr
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/vr
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/vr
'
,
this
.
getValue
()
);
}
);
vrRow
.
add
(
new
UI
.
Text
(
'
VR
'
).
setWidth
(
'
90px
'
)
);
vrRow
.
add
(
vr
);
container
.
add
(
vrRow
);
// Renderer
var
options
=
{};
...
...
@@ -55,7 +97,7 @@ Sidebar.Project = function ( editor ) {
}
//
antialiasing
//
Renderer / Antialias
var
rendererPropertiesRow
=
new
UI
.
Row
().
setMarginLeft
(
'
90px
'
);
...
...
@@ -67,7 +109,7 @@ Sidebar.Project = function ( editor ) {
}
);
rendererPropertiesRow
.
add
(
rendererAntialias
);
//
shadow
//
Renderer / Shadows
var
rendererShadows
=
new
UI
.
THREE
.
Boolean
(
config
.
getKey
(
'
project/renderer/shadows
'
),
'
shadows
'
).
onChange
(
function
()
{
...
...
@@ -79,7 +121,7 @@ Sidebar.Project = function ( editor ) {
rendererPropertiesRow
.
add
(
new
UI
.
Break
()
);
//
g
amma input
//
Renderer / G
amma input
var
rendererGammaInput
=
new
UI
.
THREE
.
Boolean
(
config
.
getKey
(
'
project/renderer/gammaInput
'
),
'
γ input
'
).
onChange
(
function
()
{
...
...
@@ -89,7 +131,7 @@ Sidebar.Project = function ( editor ) {
}
);
rendererPropertiesRow
.
add
(
rendererGammaInput
);
//
g
amma output
//
Renderer / G
amma output
var
rendererGammaOutput
=
new
UI
.
THREE
.
Boolean
(
config
.
getKey
(
'
project/renderer/gammaOutput
'
),
'
γ output
'
).
onChange
(
function
()
{
...
...
@@ -101,34 +143,6 @@ Sidebar.Project = function ( editor ) {
container
.
add
(
rendererPropertiesRow
);
// Editable
var
editableRow
=
new
UI
.
Row
();
var
editable
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/editable
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/editable
'
,
this
.
getValue
()
);
}
);
editableRow
.
add
(
new
UI
.
Text
(
'
Editable
'
).
setWidth
(
'
90px
'
)
);
editableRow
.
add
(
editable
);
container
.
add
(
editableRow
);
// VR
var
vrRow
=
new
UI
.
Row
();
var
vr
=
new
UI
.
Checkbox
(
config
.
getKey
(
'
project/vr
'
)
).
setLeft
(
'
100px
'
).
onChange
(
function
()
{
config
.
setKey
(
'
project/vr
'
,
this
.
getValue
()
);
}
);
vrRow
.
add
(
new
UI
.
Text
(
'
VR
'
).
setWidth
(
'
90px
'
)
);
vrRow
.
add
(
vr
);
container
.
add
(
vrRow
);
//
function
updateRenderer
()
{
...
...
editor/js/libs/app/index.html
浏览文件 @
31bedc5f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js
</title>
<title>
<!-- title -->
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"generator"
content=
"Three.js Editor"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<style>
body
{
font-family
:
Helvetica
,
Arial
,
sans-serif
;
font-size
:
1
2
px
;
font-family
:
sans-serif
;
font-size
:
1
3
px
;
background-color
:
#000
;
margin
:
0px
;
overflow
:
hidden
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录