Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
voegeli martin extern - mvoegeli
pauljs
Commits
f6390e05
Commit
f6390e05
authored
Oct 17, 2019
by
weibel manuel - mweibel
Browse files
Update paul.js
Bugfix collapsible course-sections from Edwiser
parent
591aec21
Changes
1
Hide whitespace changes
Inline
Side-by-side
paul.js
View file @
f6390e05
<
script
type
=
"
text/javascript
"
>
<
script
type
=
"
text/javascript
"
>
// // // // //
// // // // //
// Version 2019/10/
0
1 by Wema
// Version 2019/10/1
7
by Wema
// // // // //
// // // // //
var
headers1
=
document
.
getElementsByTagName
(
'
h1
'
);
var
headers1
=
document
.
getElementsByTagName
(
'
h1
'
);
var
headers2
=
document
.
getElementsByTagName
(
'
h2
'
);
var
headers2
=
document
.
getElementsByTagName
(
'
h2
'
);
...
@@ -302,13 +302,31 @@ if(location.href.includes("user/index.php?")){
...
@@ -302,13 +302,31 @@ if(location.href.includes("user/index.php?")){
/* Wema Ende: Maintenance-Info */
/* Wema Ende: Maintenance-Info */
/* Wema Start: Expand collapsible course-sections by url (from Edwiser) */
/* Wema Start: Expand collapsible course-sections by url (from Edwiser) */
if
(
document
.
querySelector
(
'
body
'
).
id
==
'
page-course-view-remuiformat
'
)
{
if
(
document
.
body
.
id
==
'
page-course-view-remuiformat
'
)
{
window
.
onhashchange
=
function
()
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
var
elid
=
window
.
location
.
hash
;
var
list
=
document
.
querySelectorAll
(
'
.remui-format-list .section>.list-current
'
);
if
(
document
.
querySelector
(
elid
)
&&
document
.
querySelector
(
elid
).
querySelector
(
'
.fa-angle-down
'
))
{
var
openList
=
[];
document
.
querySelector
(
elid
).
querySelector
(
'
.fa-angle-down
'
).
click
();
if
(
list
.
length
!=
0
)
{
list
.
forEach
(
function
(
elem
,
index
)
{
openList
.
push
(
elem
.
parentElement
);
});
list
=
null
;
}
}
};
if
(
window
.
location
.
hash
!=
''
)
{
openList
.
push
(
document
.
querySelector
(
window
.
location
.
hash
));
}
openList
.
forEach
(
function
(
elem
)
{
elem
.
querySelector
(
'
.card-footer
'
).
classList
.
remove
(
'
collpase
'
);
elem
.
querySelector
(
'
.card-footer
'
).
classList
.
add
(
'
show
'
);
});
});
window
.
addEventListener
(
'
hashchange
'
,
function
()
{
if
(
window
.
location
.
hash
!=
''
&&
document
.
querySelector
(
window
.
location
.
hash
))
{
var
elem
=
document
.
querySelector
(
window
.
location
.
hash
);
elem
.
querySelector
(
'
.card-footer
'
).
classList
.
remove
(
'
collpase
'
);
elem
.
querySelector
(
'
.card-footer
'
).
classList
.
add
(
'
show
'
);
}
});
}
}
/* Wema Ende: Expand collapsible course-sections by url (from Edwiser) */
/* Wema Ende: Expand collapsible course-sections by url (from Edwiser) */
<
/script
>
<
/script
>
Write
Preview
Supports
Markdown
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