FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
imace.github.com/javascripts/script.js at master · imace/imace.github.com · GitHub
imace
/
imace.github.com
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
imace.github.com
/
javascripts
/
script.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (46 loc) · 1.54 KB
Breadcrumbs
imace.github.com
/
javascripts
/
script.js
Copy path
File metadata and controls
52 lines (46 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(
function
(
$
)
{
$
(
document
)
.
ready
(
function
(
)
{
// putting lines by the pre blocks
$
(
"pre"
)
.
each
(
function
(
)
{
var
pre
=
$
(
this
)
.
text
(
)
.
split
(
"\n"
)
;
var
lines
=
new
Array
(
pre
.
length
+
1
)
;
for
(
var
i
=
0
;
i
<
pre
.
length
;
i
++
)
{
var
wrap
=
Math
.
floor
(
pre
[
i
]
.
split
(
""
)
.
length
/
70
)
if
(
pre
[
i
]
==
""
&&
i
==
pre
.
length
-
1
)
{
lines
.
splice
(
i
,
1
)
;
}
else
{
lines
[
i
]
=
i
+
1
;
for
(
var
j
=
0
;
j
<
wrap
;
j
++
)
{
lines
[
i
]
+=
"\n"
;
}
}
}
$
(
this
)
.
before
(
"<pre class='lines'>"
+
lines
.
join
(
"\n"
)
+
"</pre>"
)
;
}
)
;
var
headings
=
[
]
;
var
collectHeaders
=
function
(
)
{
headings
.
push
(
{
"top"
:
$
(
this
)
.
offset
(
)
.
top
-
15
,
"text"
:
$
(
this
)
.
text
(
)
}
)
;
}
if
(
$
(
".markdown-body h1"
)
.
length
>
1
)
$
(
".markdown-body h1"
)
.
each
(
collectHeaders
)
else
if
(
$
(
".markdown-body h2"
)
.
length
>
1
)
$
(
".markdown-body h2"
)
.
each
(
collectHeaders
)
else
if
(
$
(
".markdown-body h3"
)
.
length
>
1
)
$
(
".markdown-body h3"
)
.
each
(
collectHeaders
)
$
(
window
)
.
scroll
(
function
(
)
{
if
(
headings
.
length
==
0
)
return
true
;
var
scrolltop
=
$
(
window
)
.
scrollTop
(
)
||
0
;
if
(
headings
[
0
]
&&
scrolltop
<
headings
[
0
]
.
top
)
{
$
(
".current-section"
)
.
css
(
{
"opacity"
:
0
,
"visibility"
:
"hidden"
}
)
;
return
false
;
}
$
(
".current-section"
)
.
css
(
{
"opacity"
:
1
,
"visibility"
:
"visible"
}
)
;
for
(
var
i
in
headings
)
{
if
(
scrolltop
>=
headings
[
i
]
.
top
)
{
$
(
".current-section .name"
)
.
text
(
headings
[
i
]
.
text
)
;
}
}
}
)
;
$
(
".current-section a"
)
.
click
(
function
(
)
{
$
(
window
)
.
scrollTop
(
0
)
;
return
false
;
}
)
}
)
;
}
)
(
jQuery
)
Back
|
FazBrowse Home
|
New Git URL