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
GIP RENATER
switch-wayf
Commits
0043d077
Commit
0043d077
authored
Sep 06, 2011
by
haemmer
Browse files
Corrected body onLoad issue so that focus now also works
parent
2cc95e41
Changes
1
Hide whitespace changes
Inline
Side-by-side
default-header.php
View file @
0043d077
<?php
// Copyright (c) 2011, SWITCH - Serving Swiss Universities ?>
<!
DOCTYPE
HTML
PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
<
html
><
head
>
<
html
>
<
head
>
<
title
><?
php
echo
getLocalString
(
'title'
)
?>
</title>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=utf-8"
>
<meta
name=
"keywords"
content=
"Discovery Service, WAYF, Shibboleth"
>
<meta
name=
"description"
content=
"Choose your home organization to authenticate"
>
<style
type=
"text/css"
>
<!
--
<?
printCSS
()
?>
--
>
</style>
</head>
<body
onLoad=
"preventIframeEmbedding(); setFocus();"
>
<script
language=
"JavaScript"
type=
"text/javascript"
>
<!--
function
preventIframeEmbedding
(){
if
(
top
!=
self
)
{
top
.
location
=
self
.
location
;
<script
language=
"JavaScript"
type=
"text/javascript"
>
<!--
// Prevent that WAYF is loaded in an IFRAME
function
preventIframeEmbedding
(){
if
(
top
!=
self
)
{
top
.
location
=
self
.
location
;
}
}
}
function
setFocus
(){
// Skip this if we cannot access the form elements
if
(
!
document
.
IdPList
||
!
document
.
IdPList
.
Select
){
return
;
// Set focus to submit button or drop down list
function
setFocus
(){
// Skip this if we cannot access the form elements
if
(
!
document
.
IdPList
||
!
document
.
IdPList
.
Select
){
return
;
}
if
(
document
.
IdPList
.
user_idp
&&
document
.
IdPList
.
user_idp
.
selectedIndex
==
0
){
// Set focus to select
document
.
IdPList
.
user_idp
.
focus
();
}
else
{
// Set focus to submit button
document
.
IdPList
.
Select
.
focus
();
}
}
// Set focus to submit button unless autofocus is supported
if
(
!
(
"
autofocus
"
in
document
.
createElement
(
"
input
"
)))
{
document
.
IdPList
.
Select
.
focus
();
// Confirm action
function
showConfirmation
(){
return
confirm
(
unescape
(
'
<?php
echo
getLocalString
(
'confirm_permanent_selection'
,
'js'
)
?>
'
));
}
}
function
showConfirmation
(){
return
confirm
(
unescape
(
'
<?php
echo
getLocalString
(
'confirm_permanent_selection'
,
'js'
)
?>
'
));
}
function
showPermanentConfirmation
(){
// Confirm permanent selection
function
showPermanentConfirmation
(){
return
alert
(
unescape
(
'
<?php
echo
getLocalString
(
'permanent_cookie_note'
,
'js'
)
?>
'
));
}
return
alert
(
unescape
(
'
<?php
echo
getLocalString
(
'permanent_cookie_note'
,
'js'
)
?>
'
));
}
function
checkForm
(){
if
(
document
.
IdPList
.
user_idp
&&
document
.
IdPList
.
user_idp
.
selectedIndex
==
0
){
alert
(
unescape
(
'
<?php
echo
getLocalString
(
'make_selection'
,
'js'
)
?>
'
));
return
false
;
}
else
{
if
(
document
.
IdPList
.
permanent
&&
document
.
IdPList
.
permanent
.
checked
){
return
showConfirmation
();
// Perform input validation on WAYF form
function
checkForm
(){
if
(
document
.
IdPList
.
user_idp
&&
document
.
IdPList
.
user_idp
.
selectedIndex
==
0
){
alert
(
unescape
(
'
<?php
echo
getLocalString
(
'make_selection'
,
'js'
)
?>
'
));
return
false
;
}
else
{
return
true
;
if
(
document
.
IdPList
.
permanent
&&
document
.
IdPList
.
permanent
.
checked
){
return
showConfirmation
();
}
else
{
return
true
;
}
}
}
}
//Setup the dom ready event
function
DomReady
(
func
){
if
(
document
.
addEventListener
){
//W3C
document
.
addEventListener
(
"
DOMContentLoaded
"
,
func
,
false
);
}
else
{
//IE
document
.
onreadystatechange
=
function
(){
readyState
(
func
)}
}
}
//IE ready execution function
function
readyState
(
func
){
//dom is ready for interaction
if
(
document
.
readyState
==
"
interactive
"
){
func
();
}
}
// Init WAYF
function
init
(){
preventIframeEmbedding
();
setFocus
();
}
// Add new DomReady function
window
.
onDomReady
=
DomReady
;
// Attach init function
window
.
onDomReady
(
init
);
-->
</script>
<style
type=
"text/css"
>
<!
--
<?
printCSS
()
?>
--
>
</style>
</head>
-->
</script>
<body>
<div
id=
"container"
>
<div
class=
"box"
>
...
...
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