Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
oncampus
Patterns and Frameworks
Commits
a9a5490c
Commit
a9a5490c
authored
Aug 15, 2019
by
Jens Ehlers
Browse files
#2
back and forward navigation
parent
9577511b
Pipeline
#8050
passed with stage
in 1 minute and 9 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
docs/index.html
View file @
a9a5490c
...
...
@@ -24,6 +24,11 @@
displayUnit
(
document
.
location
.
hash
);
$
(
"
.dropdown-item
"
).
on
(
"
click
"
,
function
()
{
displayUnit
(
'
#
'
+
$
(
this
).
attr
(
"
id
"
));
});
// back and forward navigation
window
.
onhashchange
=
function
()
{
displayUnit
(
document
.
location
.
hash
);
};
$
(
"
label
"
).
prepend
(
"
Abb.:
"
);
$
(
"
.source
"
).
each
(
function
()
{
var
source
=
$
(
this
).
html
();
...
...
@@ -41,7 +46,6 @@
var
filename
=
$
(
this
).
attr
(
'
id
'
);
$
(
this
).
load
(
filename
+
'
.html
'
,
function
()
{
// try this with $.get
Prism
.
highlightAll
();
$
(
"
.navigate
"
).
on
(
"
click
"
,
function
()
{
displayUnit
(
$
(
this
).
attr
(
"
href
"
));
});
// add repo links
$
(
"
#
"
+
filename
+
"
.repo-link
"
).
each
(
function
()
{
...
...
@@ -85,14 +89,6 @@
}
});
// literature links
$
(
document
).
on
(
'
click tap
'
,
'
a
'
,
function
()
{
var
href
=
$
(
this
).
attr
(
"
href
"
);
if
(
typeof
href
!==
"
undefined
"
&&
href
.
startsWith
(
"
#cite-
"
))
{
displayUnit
(
'
#unit-goals
'
);
}
});
// display all units for pdf export
var
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
if
(
urlParams
.
get
(
'
show
'
)
==
"
all
"
)
{
...
...
@@ -114,10 +110,14 @@
function
displayUnit
(
id
)
{
if
(
id
==
"
#undefined
"
)
return
;
document
.
location
.
hash
=
id
;
var
id_nohash
=
id
.
substring
(
1
);
$
(
"
[id^=content-unit-]
"
).
hide
();
var
id_nohash
=
id
.
substring
(
1
);
if
(
id
.
startsWith
(
"
#cite-
"
))
id_nohash
=
'
unit-goals
'
;
$
(
"
#content-
"
+
id_nohash
).
show
();
window
.
scrollTo
(
0
,
0
);
var
top
=
(
id
.
startsWith
(
"
#cite-
"
)
&&
$
(
id
).
offset
()
!==
undefined
)
?
$
(
id
).
offset
().
top
:
0
;
window
.
scrollTo
(
0
,
top
);
}
function
search
(
searchTerm
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment