Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
482ccfbd
Z
zui
项目概览
易企天创
/
zui
大约 1 年 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
482ccfbd
编写于
4月 19, 2015
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* change document UI.
上级
4d7e7c1b
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
1012 addition
and
680 deletion
+1012
-680
docs/2/css/doc.css
docs/2/css/doc.css
+2
-2
docs/2/css/doc.css.map
docs/2/css/doc.css.map
+1
-1
docs/2/css/doc.min.css
docs/2/css/doc.min.css
+2
-2
docs/2/js/doc.js
docs/2/js/doc.js
+99
-24
docs/2/js/doc.min.js
docs/2/js/doc.min.js
+2
-2
docs/css/zui.css
docs/css/zui.css
+495
-321
docs/css/zui.css.map
docs/css/zui.css.map
+1
-1
docs/css/zui.min.css
docs/css/zui.min.css
+2
-2
docs/fonts/zenicon.eot
docs/fonts/zenicon.eot
+0
-0
docs/fonts/zenicon.svg
docs/fonts/zenicon.svg
+322
-283
docs/fonts/zenicon.ttf
docs/fonts/zenicon.ttf
+0
-0
docs/fonts/zenicon.woff
docs/fonts/zenicon.woff
+0
-0
docs/js/zui.js
docs/js/zui.js
+1
-1
docs/js/zui.min.js
docs/js/zui.min.js
+1
-1
src/js/doc.js
src/js/doc.js
+77
-38
src/js/store.js
src/js/store.js
+6
-1
src/less/doc.less
src/less/doc.less
+1
-1
未找到文件。
docs/2/css/doc.css
浏览文件 @
482ccfbd
/*!
* ZUI - v1.
2.1
- 2015-04-18
* ZUI - v1.
3.0
- 2015-04-18
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2015 cnezsoft.com; Licensed MIT
...
...
@@ -397,7 +397,7 @@ body {
margin-bottom
:
10px
;
background-color
:
#fff
;
border-color
:
#fff
;
border-radius
:
2px
;
border-radius
:
0
;
-webkit-box-shadow
:
none
;
box-shadow
:
none
;
-webkit-transition
:
all
.1s
cubic-bezier
(
.175
,
.885
,
.32
,
1
);
...
...
docs/2/css/doc.css.map
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/2/css/doc.min.css
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/2/js/doc.js
浏览文件 @
482ccfbd
/*!
* ZUI - v1.
2.1 - 2015-04-17
* ZUI - v1.
3.0 - 2015-04-18
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2015 cnezsoft.com; Licensed MIT
...
...
@@ -51,8 +51,9 @@
var
LAST_QUERY_ID
=
'
LAST_QUERY_ID
'
;
var
INDEX_JSON
=
'
index.json
'
;
var
UNDEFINED
=
undefined
;
var
PAGE_SHOW_FULL
=
'
page-show-full
'
;
var
dataset
=
{
'
index.json
'
:
null
//
'index.json': null
};
if
(
debug
)
window
.
dataset
=
dataset
;
...
...
@@ -61,7 +62,7 @@
var
$body
,
$window
,
$grid
,
$sectionTemplate
,
$queryInput
,
$chapters
,
$chaptersCols
,
$choosedSection
,
$page
,
$pageHeader
,
$pageContent
,
$pageContainer
,
$pageBody
,
$pageContainer
,
$pageBody
,
$navbar
,
$header
,
$sections
,
$chapterHeadings
;
// elements
var
checkScrollbar
=
function
()
...
...
@@ -76,24 +77,26 @@
$body
[
0
].
removeChild
(
scrollDiv
);
}
console
.
log
(
'
checkScrollbar
'
,
scrollBarWidth
);
if
(
scrollBarWidth
)
{
var
bodyPad
=
parseInt
((
$body
.
css
(
'
padding-right
'
)
||
0
),
10
);
$body
.
css
(
'
padding-right
'
,
bodyPad
+
scrollBarWidth
);
$navbar
.
css
(
'
padding-right
'
,
scrollBarWidth
);
}
};
var
resetScrollbar
=
function
()
{
$body
.
css
(
'
padding-right
'
,
''
);
$navbar
.
css
(
'
padding-right
'
,
''
);
};
var
loadData
=
function
(
url
,
callback
,
forceLoad
)
{
var
data
=
dataset
[
url
];
var
isFirstLoad
=
data
===
UNDEFINED
||
data
===
null
;
if
(
isFirstLoad
)
{
data
=
$
.
store
.
get
(
url
,
null
);
console
.
log
(
url
,
data
);
dataset
[
url
]
=
data
;
if
(
data
!==
null
)
{
if
(
debug
)
{
...
...
@@ -163,10 +166,11 @@
if
(
eachSection
(
function
(
chapter
,
section
,
$sectionList
){
var
chapterName
=
chapter
.
id
;
section
.
chapter
=
chapterName
;
var
$tpl
=
$sectionTemplate
.
clone
().
attr
(
'
id
'
,
'
section-
'
+
chapterName
+
'
-
'
+
section
.
id
).
data
(
'
section
'
,
section
);
var
id
=
chapterName
+
'
-
'
+
section
.
id
;
var
$tpl
=
$sectionTemplate
.
clone
().
attr
(
'
id
'
,
'
section-
'
+
id
).
data
(
'
section
'
,
section
);
$tpl
.
attr
(
'
data-id
'
,
section
.
id
).
attr
(
'
data-chapter
'
,
chapterName
).
attr
(
'
data-order
'
,
order
++
);
var
$head
=
$tpl
.
children
(
'
.card-heading
'
);
$head
.
find
(
'
.name
'
).
text
(
section
.
name
);
$head
.
find
(
'
.name
'
).
text
(
section
.
name
)
.
attr
(
'
href
'
,
'
#
'
+
id
)
;
$head
.
children
(
'
.desc
'
).
text
(
section
.
desc
);
displaySectionIcon
(
$head
.
children
(
'
.icon
'
),
section
);
var
$topics
=
$tpl
.
find
(
'
.topics
'
);
...
...
@@ -615,13 +619,13 @@
};
var
closePage
=
function
()
{
if
(
$body
.
hasClass
(
'
page-
show
'
))
{
if
(
$body
.
hasClass
(
'
page-
open
'
))
{
var
style
=
$page
.
data
(
'
trans-style
'
);
style
[
'
max-height
'
]
=
''
;
$page
.
css
(
style
);
$body
.
removeClass
(
'
page-show-in
'
);
$body
.
addClass
(
'
page-show-out
'
).
removeClass
(
'
page-open
page-show-in
'
);
setTimeout
(
function
(){
$body
.
removeClass
(
'
page-show
'
);
$body
.
removeClass
(
'
page-show
page-show-out
'
);
resetScrollbar
();
},
300
);
return
true
;
...
...
@@ -630,43 +634,59 @@
};
var
openPage
=
function
(
$section
,
section
,
topic
)
{
var
pageId
=
section
.
chapter
+
'
-
'
+
section
.
id
;
if
(
$body
.
hasClass
(
'
page-open
'
)
&&
pageId
===
$body
.
attr
(
'
data-page
'
))
{
if
(
debug
)
console
.
error
(
'
The page already showed.
'
);
return
;
}
chooseSection
(
$section
,
false
,
true
);
closePage
();
$body
.
attr
(
'
data-page-chapter
'
,
section
.
chapter
);
displaySectionIcon
(
$pageHeader
.
children
(
'
.icon
'
),
section
);
$pageHeader
.
find
(
'
.name
'
).
text
(
section
.
name
);
window
.
location
.
hash
=
'
#
'
+
pageId
;
$body
.
attr
(
'
data-page-chapter
'
,
section
.
chapter
).
attr
(
'
data-page
'
,
pageId
);
displaySectionIcon
(
$pageHeader
.
find
(
'
.icon
'
),
section
);
$pageHeader
.
find
(
'
.name
'
).
text
(
section
.
name
).
attr
(
'
href
'
,
'
#
'
+
section
.
chapter
+
'
-
'
+
section
.
id
);
$pageHeader
.
children
(
'
.desc
'
).
text
(
section
.
desc
);
$pageContent
.
html
(
''
);
$page
.
addClass
(
'
loading
'
);
var
$loader
=
$page
.
addClass
(
'
loading
'
).
find
(
'
.loader
'
)
.
addClass
(
'
loading
'
);
loadData
(
section
.
url
,
function
(
data
){
$page
.
removeClass
(
'
loading
'
);
$loader
.
removeClass
(
'
loading
'
);
$pageContent
.
html
(
data
);
$queryInput
.
blur
();
$pageBody
.
scrollTop
(
0
);
});
if
(
$body
.
hasClass
(
'
page-open
'
))
{
if
(
debug
)
console
.
log
(
'
open section in open page
'
,
section
);
return
;
}
$body
.
addClass
(
'
page-open
'
);
toggleCompactMode
(
true
,
function
(){
var
offset
=
$section
.
offset
();
var
sectionHeight
=
$section
.
outerHeight
();
var
style
=
{
left
:
offset
.
left
-
$grid
.
children
(
'
.container
'
).
offset
().
left
-
6
,
top
:
offset
.
top
-
$window
.
scrollTop
()
-
8
0
,
top
:
offset
.
top
-
$window
.
scrollTop
()
-
8
1
,
width
:
$section
.
outerWidth
(),
height
:
sectionHeight
,
'
max-height
'
:
sectionHeight
};
$page
.
css
(
style
).
data
(
'
trans-style
'
,
style
);
$pageBody
.
css
(
'
width
'
,
bestPageWidth
);
checkScrollbar
();
$body
.
addClass
(
'
page-show
'
);
$page
.
css
(
style
).
data
(
'
trans-style
'
,
style
);
$pageBody
.
css
(
'
width
'
,
bestPageWidth
);
setTimeout
(
function
(){
$body
.
addClass
(
'
page-show-in
'
);
if
(
$page
.
hasClass
(
'
loading
'
))
$page
.
addClass
(
'
openning
'
).
css
(
'
height
'
,
380
);
$pageBody
.
scrollTop
(
0
);
setTimeout
(
function
(){
$page
.
removeClass
(
'
openning
'
);
bestPageWidth
=
$pageBody
.
css
(
'
width
'
,
''
).
width
()
+
40
;
resizePage
();
},
310
);
},
10
);
});
...
...
@@ -676,6 +696,34 @@
section
=
section
||
$choosedSection
;
var
$section
;
if
(
$
.
isArray
(
section
))
{
var
docIndex
=
dataset
[
INDEX_JSON
];
if
(
docIndex
&&
section
.
length
>
1
)
{
var
sectionId
=
section
[
1
];
var
sections
=
docIndex
.
chapters
[
section
[
0
]].
sections
;
var
ok
=
false
;
for
(
var
i
in
sections
)
{
var
s
=
sections
[
i
];
if
(
s
.
id
===
sectionId
)
{
if
(
section
.
length
>
2
)
{
topic
=
section
[
2
];
}
section
=
s
;
ok
=
true
;
break
;
}
}
if
(
!
ok
)
{
console
.
error
(
"
Open section failed: can't find the section with id
"
+
section
.
join
(
'
-
'
));
return
;
}
}
else
{
if
(
debug
)
{
console
.
error
(
"
Open section stop by null docIndex or wrong section value.
"
);
}
return
;
}
}
if
(
$
.
isPlainObject
(
section
))
{
$section
=
$
(
'
#section-
'
+
section
.
chapter
+
'
-
'
+
section
.
id
);
}
else
{
...
...
@@ -704,9 +752,18 @@
}
};
window
.
openS
=
openSection
;
var
resizePage
=
function
()
{
if
(
!
$body
.
hasClass
(
'
page-show-in
'
)
||
$page
.
hasClass
(
'
loading
'
))
return
;
$page
.
css
(
'
height
'
,
Math
.
min
(
$pageContainer
.
outerHeight
(),
$pageHeader
.
outerHeight
()
+
$pageContent
.
outerHeight
()
+
50
));
if
(
$body
.
hasClass
(
'
page-show-out
'
)
||
$page
.
hasClass
(
'
loading
'
))
return
;
var
height
;
if
(
$body
.
hasClass
(
PAGE_SHOW_FULL
))
{
height
=
$window
.
height
();
$pageBody
.
toggleClass
(
'
with-scrollbar
'
,
$pageContent
.
outerHeight
()
>
(
height
-
40
-
$pageHeader
.
outerHeight
()));
}
else
{
height
=
Math
.
min
(
$pageContainer
.
outerHeight
(),
$pageHeader
.
outerHeight
()
+
$pageContent
.
outerHeight
()
+
50
);
}
$page
.
css
(
'
height
'
,
height
);
};
$
(
function
()
{
...
...
@@ -716,6 +773,7 @@
$window
=
$
(
window
);
$body
=
$
(
'
body
'
);
$navbar
=
$
(
'
#navbar
'
);
$grid
=
$
(
'
#grid
'
);
$header
=
$
(
'
#header
'
);
$chaptersCols
=
$grid
.
find
(
'
.col
'
);
...
...
@@ -735,8 +793,19 @@
chapter
.
$sections
=
$
(
'
#sections-
'
+
chapterId
);
});
bestPageWidth
=
$grid
.
children
(
'
.container
'
).
outerWidth
();
loadData
(
INDEX_JSON
,
displaySection
)
$body
.
toggleClass
(
PAGE_SHOW_FULL
,
$
.
store
.
get
(
PAGE_SHOW_FULL
,
false
));
loadData
(
INDEX_JSON
,
function
(
data
){
displaySection
(
data
);
var
hash
=
window
.
location
.
hash
if
(
hash
)
{
hash
=
hash
.
substr
(
1
);
setTimeout
(
function
(){
openSection
(
hash
.
split
(
'
-
'
));
},
300
);
}
else
{
$queryInput
.
focus
();
}
});
// Bind events
$
(
document
).
on
(
'
click
'
,
function
(
e
){
...
...
@@ -777,6 +846,10 @@
$pageHeader
.
on
(
'
click
'
,
'
.path-close-btn
'
,
function
(){
closePage
();
}).
on
(
'
click
'
,
'
.path-max-btn
'
,
function
(){
$body
.
toggleClass
(
PAGE_SHOW_FULL
);
setTimeout
(
resizePage
,
300
);
$
.
store
.
set
(
PAGE_SHOW_FULL
,
$body
.
hasClass
(
PAGE_SHOW_FULL
));
});
var
scrollHeight
=
$
(
'
#navbar
'
).
outerHeight
();
...
...
@@ -799,7 +872,7 @@
}
}).
on
(
'
keydown
'
,
function
(
e
){
var
code
=
e
.
which
;
console
.
log
(
'
keydown
'
,
code
);
//
console.log('keydown', code);
var
isPageNotShow
=
!
$body
.
hasClass
(
'
page-show
'
);
if
(
code
===
13
)
{
// Enter
if
(
isPageNotShow
&&
isChoosedSection
())
{
...
...
@@ -828,12 +901,14 @@
}
else
if
(
code
===
38
)
{
// Top
if
(
isPageNotShow
)
{
choosePrevSection
();
e
.
preventDefault
();
}
else
{
scrollToThis
(
$pageBody
,
'
up
'
);
}
}
else
if
(
code
===
40
)
{
// Down
if
(
isPageNotShow
)
{
chooseNextSection
();
e
.
preventDefault
();
}
else
{
scrollToThis
(
$pageBody
);
}
...
...
docs/2/js/doc.min.js
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/css/zui.css
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/css/zui.css.map
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/css/zui.min.css
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/fonts/zenicon.eot
浏览文件 @
482ccfbd
无法预览此类型文件
docs/fonts/zenicon.svg
浏览文件 @
482ccfbd
此差异已折叠。
点击以展开。
docs/fonts/zenicon.ttf
浏览文件 @
482ccfbd
无法预览此类型文件
docs/fonts/zenicon.woff
浏览文件 @
482ccfbd
无法预览此类型文件
docs/js/zui.js
浏览文件 @
482ccfbd
/*!
* ZUI - v1.
2.1 - 2015-04-17
* ZUI - v1.
3.0 - 2015-04-18
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2015 cnezsoft.com; Licensed MIT
...
...
docs/js/zui.min.js
浏览文件 @
482ccfbd
/*!
* ZUI - v1.
2.1 - 2015-04-17
* ZUI - v1.
3.0 - 2015-04-18
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2015 cnezsoft.com; Licensed MIT
...
...
src/js/doc.js
浏览文件 @
482ccfbd
...
...
@@ -45,11 +45,14 @@
var
INDEX_JSON
=
'
index.json
'
;
var
UNDEFINED
=
undefined
;
var
PAGE_SHOW_FULL
=
'
page-show-full
'
;
var
dataVersion
;
var
storageEnable
;
var
dataset
=
{
// 'index.json': null
};
if
(
debug
)
window
.
dataset
=
dataset
;
var
sectionsShowed
;
var
scrollBarWidth
=
-
1
;
var
bestPageWidth
=
1120
;
var
$body
,
$window
,
$grid
,
$sectionTemplate
,
...
...
@@ -58,6 +61,13 @@
$pageContainer
,
$pageBody
,
$navbar
,
$header
,
$sections
,
$chapterHeadings
;
// elements
var
limitString
=
function
(
str
,
len
)
{
if
(
str
&&
str
.
length
>
len
)
{
return
str
.
substr
(
0
,
len
)
+
'
...[
'
+
str
.
length
+
'
]
'
;
}
return
str
;
};
var
checkScrollbar
=
function
()
{
if
(
document
.
body
.
clientWidth
>=
window
.
innerWidth
)
return
;
...
...
@@ -70,8 +80,6 @@
$body
[
0
].
removeChild
(
scrollDiv
);
}
console
.
log
(
'
checkScrollbar
'
,
scrollBarWidth
);
if
(
scrollBarWidth
)
{
var
bodyPad
=
parseInt
((
$body
.
css
(
'
padding-right
'
)
||
0
),
10
);
$body
.
css
(
'
padding-right
'
,
bodyPad
+
scrollBarWidth
);
...
...
@@ -85,42 +93,57 @@
$navbar
.
css
(
'
padding-right
'
,
''
);
};
var
loadData
=
function
(
url
,
callback
,
forceLoad
)
{
var
data
=
dataset
[
url
];
var
isFirstLoad
=
data
===
UNDEFINED
||
data
===
null
;
if
(
isFirstLoad
)
{
data
=
$
.
store
.
get
(
url
,
null
);
dataset
[
url
]
=
data
;
if
(
data
!==
null
)
{
if
(
debug
)
{
console
.
log
(
'
Load data from storage:
'
,
url
,
'
, size:
'
,
data
.
length
);
var
loadData
=
function
(
url
,
callback
)
{
var
cacheData
=
dataset
[
url
];
var
isHasCache
=
cacheData
&&
cacheData
.
version
;
var
isIndexJson
=
url
===
INDEX_JSON
;
if
(
!
isHasCache
&&
storageEnable
)
{
var
storedData
=
$
.
store
.
get
(
'
//
'
+
url
,
null
);
if
(
storedData
!==
null
)
{
var
storedVersion
=
$
.
store
.
get
(
'
//
'
+
url
+
'
::V
'
);
if
(
storedVersion
)
{
cacheData
=
{
data
:
storedData
,
version
:
storedVersion
};
dataset
[
url
]
=
cacheData
;
isHasCache
=
true
;
if
(
debug
)
console
.
log
(
'
Load
'
,
url
,
'
from storage:
'
,
cacheData
);
}
callback
(
data
);
}
}
else
if
(
data
!==
null
)
{
if
(
debug
)
console
.
log
(
'
Load data from cache:
'
,
url
,
'
, size:
'
,
data
.
length
);
callback
(
data
);
}
if
(
isFirstLoad
||
data
===
null
||
forceLoad
||
isFirstLoad
||
(
!
saveTraffic
))
{
var
dataType
=
url
.
endsWith
(
'
.json
'
)
?
'
json
'
:
'
html
'
;
$
.
get
(
url
,
function
(
remoteData
){
if
(
!
debug
&&
data
!==
null
)
{
if
(
dataType
===
'
json
'
&&
$
.
isPlainObject
(
remoteData
)
&&
data
.
version
&&
remoteData
.
version
&&
remoteData
.
version
===
data
.
version
)
return
;
if
(
dataType
===
'
html
'
&&
data
===
remoteData
)
return
;
}
dataset
[
url
]
=
remoteData
;
if
(
debug
)
{
console
.
log
(
'
Load data from remote:
'
,
url
,
'
, size:
'
,
remoteData
.
length
);
}
callback
(
remoteData
);
$
.
store
.
set
(
url
,
remoteData
);
},
dataType
);
if
(
isHasCache
&&
(
isIndexJson
||
cacheData
.
version
===
dataVersion
))
{
if
(
debug
)
console
.
log
(
'
Load
'
,
url
,
'
from cache:
'
,
cacheData
);
callback
(
cacheData
.
data
);
if
(
!
isIndexJson
)
return
;
}
var
dataType
=
url
.
endsWith
(
'
.json
'
)
?
'
json
'
:
'
html
'
;
$
.
get
(
url
,
function
(
data
){
if
(
data
!==
null
)
{
if
(
isIndexJson
)
{
dataVersion
=
data
.
version
;
}
cacheData
=
{
data
:
data
,
version
:
dataVersion
};
dataset
[
url
]
=
cacheData
;
$
.
store
.
set
(
'
//
'
+
url
,
data
);
$
.
store
.
set
(
'
//
'
+
url
+
'
::V
'
,
dataVersion
);
if
(
debug
)
console
.
log
(
'
Load
'
,
url
,
'
from remote:
'
,
cacheData
);
callback
(
data
);
}
else
if
(
isHasCache
&&
!
isIndexJson
)
{
if
(
debug
)
console
.
log
(
'
Failed load
'
,
url
,
'
from remote, instead load cache:
'
,
cacheData
);
callback
(
cacheData
.
data
);
}
},
dataType
).
error
(
function
(){
if
(
debug
)
console
.
error
(
"
Ajax error:
"
,
url
);
if
(
isHasCache
&&
!
isIndexJson
)
{
if
(
debug
)
console
.
log
(
'
Failed load
'
,
url
,
'
from remote with error, instead load cache:
'
,
cacheData
);
callback
(
cacheData
.
data
);
}
});
};
var
eachSection
=
function
(
callback
,
eachChapterCallback
)
{
var
docIndex
=
dataset
[
INDEX_JSON
];
var
docIndex
=
dataset
[
INDEX_JSON
]
.
data
;
if
(
!
docIndex
)
{
console
.
error
(
"
Document index is empty.
"
);
return
false
;
...
...
@@ -177,18 +200,21 @@
$topics
.
remove
(
'
.card-content
'
);
$tpl
.
addClass
(
'
without-topics
'
);
}
$sectionList
.
append
(
$tpl
.
addClass
(
'
show
'
));
$sectionList
.
append
(
$tpl
.
addClass
(
'
show
'
+
(
sectionsShowed
?
'
in
'
:
''
)
));
},
function
(
chapter
,
sections
){
var
$sectionList
=
chapter
.
$sections
;
$sectionList
.
children
().
remove
();
return
$sectionList
;
}))
{
$body
.
children
(
'
.loader
'
).
removeClass
(
'
loading
'
);
clearTimeout
(
$grid
.
data
(
LAST_RELOAD_ANIMATE_ID
));
$grid
.
data
(
LAST_RELOAD_ANIMATE_ID
,
setTimeout
(
function
(){
$sections
=
$grid
.
find
(
'
.section
'
).
addClass
(
'
in
'
);
$chapterHeadings
.
addClass
(
'
in
'
);
},
100
));
if
(
!
sectionsShowed
)
{
clearTimeout
(
$grid
.
data
(
LAST_RELOAD_ANIMATE_ID
));
$grid
.
data
(
LAST_RELOAD_ANIMATE_ID
,
setTimeout
(
function
(){
$sections
=
$grid
.
find
(
'
.section
'
).
addClass
(
'
in
'
);
$chapterHeadings
.
addClass
(
'
in
'
);
},
100
));
sectionsShowed
=
true
;
}
}
else
if
(
debug
)
{
console
.
error
(
"
Display sections failed.
"
);
}
...
...
@@ -662,7 +688,7 @@
var
sectionHeight
=
$section
.
outerHeight
();
var
style
=
{
left
:
offset
.
left
-
$grid
.
children
(
'
.container
'
).
offset
().
left
-
6
,
top
:
offset
.
top
-
$window
.
scrollTop
()
-
8
0
,
top
:
offset
.
top
-
$window
.
scrollTop
()
-
8
1
,
width
:
$section
.
outerWidth
(),
height
:
sectionHeight
,
'
max-height
'
:
sectionHeight
...
...
@@ -690,7 +716,7 @@
var
$section
;
if
(
$
.
isArray
(
section
))
{
var
docIndex
=
dataset
[
INDEX_JSON
];
var
docIndex
=
dataset
[
INDEX_JSON
]
.
data
;
if
(
docIndex
&&
section
.
length
>
1
)
{
var
sectionId
=
section
[
1
];
var
sections
=
docIndex
.
chapters
[
section
[
0
]].
sections
;
...
...
@@ -785,8 +811,21 @@
chapter
.
id
=
chapterId
;
chapter
.
$sections
=
$
(
'
#sections-
'
+
chapterId
);
});
bestPageWidth
=
$grid
.
children
(
'
.container
'
).
outerWidth
();
$body
.
toggleClass
(
PAGE_SHOW_FULL
,
$
.
store
.
get
(
PAGE_SHOW_FULL
,
false
));
// check storage
storageEnable
=
$
.
store
&&
$
.
store
.
enable
;
// Get document version
// dataVersion = $body.data('version');
// Setup ajax
$
.
ajaxSetup
({
cache
:
false
});
// Load index.json
loadData
(
INDEX_JSON
,
function
(
data
){
displaySection
(
data
);
var
hash
=
window
.
location
.
hash
...
...
src/js/store.js
浏览文件 @
482ccfbd
...
...
@@ -131,7 +131,12 @@
Store
.
prototype
.
get
=
function
(
key
,
defaultValue
)
{
var
val
=
this
.
deserialize
(
this
.
getItem
(
key
));
return
(
defaultValue
!==
undefined
&&
(
typeof
val
===
'
undefined
'
||
val
===
null
||
val
===
undefined
))
?
defaultValue
:
val
;
if
(
typeof
val
===
'
undefined
'
||
val
===
null
)
{
if
(
typeof
defaultValue
!==
'
undefined
'
)
{
return
defaultValue
;
}
}
return
val
;
};
/* Get item key by index and deserialize it */
...
...
src/less/doc.less
浏览文件 @
482ccfbd
...
...
@@ -521,7 +521,7 @@ body {
background-color: #fff;
.transition-quickly();
display: none;
border-radius:
2px
;
border-radius:
0
;
margin-bottom: 10px;
border-color: #fff;
box-shadow: none;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录