Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
833b7186
Commit
833b7186
authored
3 years ago
by
Tim van Dijen
Browse files
Options
Downloads
Patches
Plain Diff
Convert language selector to native JS
parent
f6bda0aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/js/bundle.js
+41
-16
41 additions, 16 deletions
src/js/bundle.js
with
41 additions
and
16 deletions
src/js/bundle.js
+
41
−
16
View file @
833b7186
...
...
@@ -8,33 +8,58 @@ import json from "highlight.js/lib/languages/json";
window
.
readyHandlers
=
[];
window
.
ready
=
function
ready
(
handler
)
{
window
.
readyHandlers
.
push
(
handler
);
handleState
();
window
.
readyHandlers
.
push
(
handler
);
handleState
();
};
window
.
handleState
=
function
handleState
()
{
if
(
document
.
readyState
===
'
interactive
'
||
document
.
readyState
===
"
complete
"
)
{
while
(
window
.
readyHandlers
.
length
>
0
)
{
(
window
.
readyHandlers
.
shift
())();
if
(
document
.
readyState
===
'
interactive
'
||
document
.
readyState
===
"
complete
"
)
{
while
(
window
.
readyHandlers
.
length
>
0
)
{
(
window
.
readyHandlers
.
shift
())();
}
}
}
};
document
.
onreadystatechange
=
window
.
handleState
;
$
(
document
).
ready
(
function
()
{
$
(
'
#language-selector
'
).
on
(
'
change
'
,
function
()
{
$
(
"
#language-form
"
).
submit
();
});
ready
(
function
()
{
// Language selector
var
languageSelector
=
document
.
getElementById
(
"
language-selector
"
);
languageSelector
.
onchange
=
function
()
{
var
languageForm
=
document
.
getElementById
(
"
language-form
"
);
languageForm
.
submit
();
return
true
;
};
// side menu
$
(
'
#menuLink
'
).
click
(
function
(
e
)
{
// Side menu
var
menuLink
=
document
.
getElementById
(
"
menuLink
"
);
menuLink
.
onclick
=
function
(
e
)
{
e
.
preventDefault
();
$
(
'
#layout
'
).
toggleClass
(
'
active
'
);
$
(
'
#foot
'
).
toggleClass
(
'
active
'
);
$
(
this
).
toggleClass
(
'
active
'
);
});
var
layout
=
document
.
getElementById
(
"
layout
"
);
if
(
layout
.
className
.
match
(
/
(?:
^|
\s)
active
(?!\S)
/
))
{
layout
.
className
=
layout
.
className
.
replace
(
/
(?:
^|
\s)
active
(?!\S)
/g
,
''
);
}
else
{
layout
.
className
+=
"
active
"
;
}
var
foot
=
document
.
getElementById
(
"
foot
"
);
if
(
foot
.
className
.
match
(
/
(?:
^|
\s)
active
(?!\S)
/
))
{
foot
.
className
=
foot
.
className
.
replace
(
/
(?:
^|
\s)
active
(?!\S)
/g
,
''
);
}
else
{
foot
.
className
+=
"
active
"
;
}
if
(
menuLink
.
className
.
match
(
/
(?:
^|
\s)
active
(?!\S)
/
))
{
menuLink
.
className
=
menuLink
.
className
.
replace
(
/
(?:
^|
\s)
active
(?!\S)
/g
,
''
);
}
else
{
menuLink
.
className
+=
"
active
"
;
}
};
});
$
(
document
).
ready
(
function
()
{
// expander boxes
$
(
'
.expandable > .expander
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment