Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Access Check - Account manager
Commits
f4749685
Commit
f4749685
authored
7 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
externalize custom javascript in dedicated file
parent
204cced2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/Makefile.am
+1
-0
1 addition, 0 deletions
resources/Makefile.am
resources/account-manager.js
+152
-0
152 additions, 0 deletions
resources/account-manager.js
templates/web/index.tt2.html
+2
-162
2 additions, 162 deletions
templates/web/index.tt2.html
with
155 additions
and
162 deletions
resources/Makefile.am
+
1
−
0
View file @
f4749685
...
...
@@ -36,6 +36,7 @@ nobase_www_DATA = \
images/favicon_geant.ico
\
images/favicon.png
\
images/geant_logo_rgb_300dpi.jpg
\
account-manager.js
\
jquery-1.11.1.min.js
\
jquery.cookie-1.4.1.min.js
\
jquery.steps.1.1.0.min.js
\
...
...
This diff is collapsed.
Click to expand it.
resources/account-manager.js
0 → 100644
+
152
−
0
View file @
f4749685
// To confirm on a link (A HREF)
function
request_confirm_link
(
my_url
,
my_message
)
{
question
=
confirm
(
my_message
);
if
(
question
!=
"
0
"
)
{
top
.
location
=
my_url
;
}
}
function
showhide
(
div
){
var
oDiv
=
document
.
getElementById
(
div
);
if
(
oDiv
.
style
.
display
==
"
none
"
){
oDiv
.
style
.
display
=
"
block
"
;
}
else
{
oDiv
.
style
.
display
=
"
none
"
;
}
}
function
hide
(
div
)
{
var
oDiv
=
document
.
getElementById
(
div
);
oDiv
.
style
.
display
=
"
none
"
;
}
jQuery
(
function
(
$
){
$
.
widget
(
"
custom.combobox
"
,
{
_create
:
function
()
{
this
.
wrapper
=
$
(
"
<span>
"
)
.
addClass
(
"
custom-combobox
"
)
.
insertAfter
(
this
.
element
);
this
.
element
.
hide
();
this
.
_createAutocomplete
();
this
.
_createShowAllButton
();
},
_createAutocomplete
:
function
()
{
var
selected
=
this
.
element
.
children
(
"
:selected
"
),
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
this
.
input
=
$
(
"
<input>
"
)
.
appendTo
(
this
.
wrapper
)
.
val
(
value
)
.
attr
(
"
title
"
,
""
)
.
addClass
(
"
custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left error required
"
)
.
autocomplete
({
delay
:
0
,
minLength
:
0
,
source
:
$
.
proxy
(
this
,
"
_source
"
)
})
.
tooltip
({
tooltipClass
:
"
ui-state-highlight
"
});
this
.
_on
(
this
.
input
,
{
autocompleteselect
:
function
(
event
,
ui
)
{
ui
.
item
.
option
.
selected
=
true
;
this
.
_trigger
(
"
select
"
,
event
,
{
item
:
ui
.
item
.
option
});
},
autocompletechange
:
"
_removeIfInvalid
"
});
},
_createShowAllButton
:
function
()
{
var
input
=
this
.
input
,
wasOpen
=
false
;
$
(
"
<a>
"
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
tooltip
()
.
appendTo
(
this
.
wrapper
)
.
button
({
icons
:
{
primary
:
"
ui-icon-triangle-1-s
"
},
text
:
false
})
.
removeClass
(
"
ui-corner-all
"
)
.
addClass
(
"
custom-combobox-toggle ui-corner-right
"
)
.
mousedown
(
function
()
{
wasOpen
=
input
.
autocomplete
(
"
widget
"
).
is
(
"
:visible
"
);
})
.
click
(
function
()
{
input
.
focus
();
// Close if already visible
if
(
wasOpen
)
{
return
;
}
// Pass empty string as value to search for, displaying all results
input
.
autocomplete
(
"
search
"
,
""
);
});
},
_source
:
function
(
request
,
response
)
{
var
matcher
=
new
RegExp
(
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
response
(
this
.
element
.
children
(
"
option
"
).
map
(
function
()
{
var
text
=
$
(
this
).
text
();
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
return
{
label
:
text
,
value
:
text
,
option
:
this
};
})
);
},
_removeIfInvalid
:
function
(
event
,
ui
)
{
// Selected an item, nothing to do
if
(
ui
.
item
)
{
return
;
}
// Search for a match (case-insensitive)
var
value
=
this
.
input
.
val
(),
valueLowerCase
=
value
.
toLowerCase
(),
valid
=
false
;
this
.
element
.
children
(
"
option
"
).
each
(
function
()
{
if
(
$
(
this
).
text
().
toLowerCase
()
===
valueLowerCase
)
{
this
.
selected
=
valid
=
true
;
return
false
;
}
});
// Found a match, nothing to do
if
(
valid
)
{
return
;
}
// Remove invalid value
this
.
input
.
val
(
""
)
.
attr
(
"
title
"
,
value
+
"
didn't match any item
"
)
.
tooltip
(
"
open
"
);
this
.
element
.
val
(
""
);
this
.
_delay
(
function
()
{
this
.
input
.
tooltip
(
"
close
"
).
attr
(
"
title
"
,
""
);
},
2500
);
this
.
input
.
autocomplete
(
"
instance
"
).
term
=
""
;
},
_destroy
:
function
()
{
this
.
wrapper
.
remove
();
this
.
element
.
show
();
}
});
});
This diff is collapsed.
Click to expand it.
templates/web/index.tt2.html
+
2
−
162
View file @
f4749685
...
...
@@ -8,11 +8,9 @@ html1/DTD/xhtml1-transitional.dtd">
<link
rel=
"icon"
type=
"image/png"
href=
"images/favicon.png"
/>
<!-- Foundation css -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"foundation/css/normalize.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"foundation/css/foundation.css"
>
<link
href=
"jquery.steps.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"jquery.steps.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"jquery-ui-1.11.1/jquery-ui.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/style.css"
/>
...
...
@@ -21,165 +19,7 @@ html1/DTD/xhtml1-transitional.dtd">
<script
type=
"text/javascript"
src=
"jquery.validate.1.13.0.min.js"
></script>
<script
type=
"text/javascript"
src=
"jquery.cookie-1.4.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"jquery.steps.1.1.0.min.js"
></script>
<script
TYPE=
"text/javascript"
>
<!--
// To confirm on a link (A HREF)
function
request_confirm_link
(
my_url
,
my_message
)
{
question
=
confirm
(
my_message
);
if
(
question
!=
"
0
"
)
{
top
.
location
=
my_url
;
}
}
function
showhide
(
div
){
var
oDiv
=
document
.
getElementById
(
div
);
if
(
oDiv
.
style
.
display
==
"
none
"
){
oDiv
.
style
.
display
=
"
block
"
;
}
else
{
oDiv
.
style
.
display
=
"
none
"
;
}
}
function
hide
(
div
)
{
var
oDiv
=
document
.
getElementById
(
div
);
oDiv
.
style
.
display
=
"
none
"
;
}
jQuery
(
function
(
$
){
$
.
widget
(
"
custom.combobox
"
,
{
_create
:
function
()
{
this
.
wrapper
=
$
(
"
<span>
"
)
.
addClass
(
"
custom-combobox
"
)
.
insertAfter
(
this
.
element
);
this
.
element
.
hide
();
this
.
_createAutocomplete
();
this
.
_createShowAllButton
();
},
_createAutocomplete
:
function
()
{
var
selected
=
this
.
element
.
children
(
"
:selected
"
),
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
this
.
input
=
$
(
"
<input>
"
)
.
appendTo
(
this
.
wrapper
)
.
val
(
value
)
.
attr
(
"
title
"
,
""
)
.
addClass
(
"
custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left error required
"
)
.
autocomplete
({
delay
:
0
,
minLength
:
0
,
source
:
$
.
proxy
(
this
,
"
_source
"
)
})
.
tooltip
({
tooltipClass
:
"
ui-state-highlight
"
});
this
.
_on
(
this
.
input
,
{
autocompleteselect
:
function
(
event
,
ui
)
{
ui
.
item
.
option
.
selected
=
true
;
this
.
_trigger
(
"
select
"
,
event
,
{
item
:
ui
.
item
.
option
});
},
autocompletechange
:
"
_removeIfInvalid
"
});
},
_createShowAllButton
:
function
()
{
var
input
=
this
.
input
,
wasOpen
=
false
;
$
(
"
<a>
"
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
tooltip
()
.
appendTo
(
this
.
wrapper
)
.
button
({
icons
:
{
primary
:
"
ui-icon-triangle-1-s
"
},
text
:
false
})
.
removeClass
(
"
ui-corner-all
"
)
.
addClass
(
"
custom-combobox-toggle ui-corner-right
"
)
.
mousedown
(
function
()
{
wasOpen
=
input
.
autocomplete
(
"
widget
"
).
is
(
"
:visible
"
);
})
.
click
(
function
()
{
input
.
focus
();
// Close if already visible
if
(
wasOpen
)
{
return
;
}
// Pass empty string as value to search for, displaying all results
input
.
autocomplete
(
"
search
"
,
""
);
});
},
_source
:
function
(
request
,
response
)
{
var
matcher
=
new
RegExp
(
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
response
(
this
.
element
.
children
(
"
option
"
).
map
(
function
()
{
var
text
=
$
(
this
).
text
();
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
return
{
label
:
text
,
value
:
text
,
option
:
this
};
})
);
},
_removeIfInvalid
:
function
(
event
,
ui
)
{
// Selected an item, nothing to do
if
(
ui
.
item
)
{
return
;
}
// Search for a match (case-insensitive)
var
value
=
this
.
input
.
val
(),
valueLowerCase
=
value
.
toLowerCase
(),
valid
=
false
;
this
.
element
.
children
(
"
option
"
).
each
(
function
()
{
if
(
$
(
this
).
text
().
toLowerCase
()
===
valueLowerCase
)
{
this
.
selected
=
valid
=
true
;
return
false
;
}
});
// Found a match, nothing to do
if
(
valid
)
{
return
;
}
// Remove invalid value
this
.
input
.
val
(
""
)
.
attr
(
"
title
"
,
value
+
"
didn't match any item
"
)
.
tooltip
(
"
open
"
);
this
.
element
.
val
(
""
);
this
.
_delay
(
function
()
{
this
.
input
.
tooltip
(
"
close
"
).
attr
(
"
title
"
,
""
);
},
2500
);
this
.
input
.
autocomplete
(
"
instance
"
).
term
=
""
;
},
_destroy
:
function
()
{
this
.
wrapper
.
remove
();
this
.
element
.
show
();
}
});
});
//-->
</script>
<script
type=
"text/javascript"
src=
"account-manager.js"
></script>
<title>
[% title %]
</title>
...
...
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