Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
f1ef2821
Commit
f1ef2821
authored
Mar 17, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cookie warning (+email legend)
parent
48501051
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
5 deletions
+81
-5
comex.css
static/css/comex.css
+21
-0
comex_lib_elts.js
static/js/comex_lib_elts.js
+51
-4
base_layout.html
templates/base_layout.html
+8
-0
registration_super_short_form.html
templates/registration_super_short_form.html
+1
-1
No files found.
static/css/comex.css
View file @
f1ef2821
...
...
@@ -152,6 +152,27 @@ div.my-centering-box > * {
color
:
#910
;
}
/* cookie panel */
.cookie-panel
{
bottom
:
0
;
width
:
100%
;
position
:
fixed
;
margin-bottom
:
0
;
display
:
block
;
opacity
:
1
;
-webkit-transition
:
opacity
.2s
ease-out
;
z-index
:
3
;
/*-webkit-transition: height .2s ease-out;*/
/*overflow: visible;*/
}
.framed-text
{
padding
:
3px
3px
2px
3px
;
border
:
solid
1.25px
#333
;
border-radius
:
2px
;
}
/* operation buttons for instance add middle name, remove box, etc */
.operation
{
color
:
#ffc
;
...
...
static/js/comex_lib_elts.js
View file @
f1ef2821
...
...
@@ -117,7 +117,8 @@ var cmxClt = (function(cC) {
}
// our self-made modal open/close function
cC
.
elts
.
box
.
toggleBox
=
function
(
boxId
)
{
// optional dontOpacifyPage (default false)
cC
.
elts
.
box
.
toggleBox
=
function
(
boxId
,
dontOpacifyPage
)
{
var
laBox
=
document
.
getElementById
(
boxId
)
if
(
laBox
)
{
if
(
laBox
.
style
.
display
==
'none'
)
{
...
...
@@ -126,7 +127,7 @@ var cmxClt = (function(cC) {
laBox
.
style
.
opacity
=
1
// opacify .page element
if
(
cC
.
elts
.
elPage
)
cC
.
elts
.
elPage
.
style
.
opacity
=
.
2
if
(
cC
.
elts
.
elPage
&&
!
dontOpacifyPage
)
cC
.
elts
.
elPage
.
style
.
opacity
=
.
2
}
else
{
// remove box
...
...
@@ -134,7 +135,7 @@ var cmxClt = (function(cC) {
setTimeout
(
function
(){
laBox
.
style
.
display
=
'none'
},
300
)
// show .page
if
(
cC
.
elts
.
elPage
)
cC
.
elts
.
elPage
.
style
.
opacity
=
''
if
(
cC
.
elts
.
elPage
&&
!
dontOpacifyPage
)
cC
.
elts
.
elPage
.
style
.
opacity
=
''
}
}
else
{
...
...
@@ -347,7 +348,53 @@ var cmxClt = (function(cC) {
okBtn
.
onclick
=
functionOnOk
}
// /generic message box ------------------------------------------------
// cookie warning ------------------------------------------------------
// NB we use localStorage (kept "forever") to not re-display to same browser
// POSS use sessionStorage instead
cC
.
elts
.
box
.
closeCookieOnceForAll
=
function
()
{
cmxClt
.
elts
.
box
.
toggleBox
(
'cookie-div'
,
true
)
localStorage
[
'comex_cookie_warning_done'
]
=
1
}
// to create an html message panel with the legal cookie warning
// no params (FIXME div id is hard-coded)
//
cC
.
elts
.
box
.
addCookieBox
=
function
()
{
// in a new div
var
myDiv
=
document
.
createElement
(
'div'
)
myDiv
.
innerHTML
=
`
<div id="cookie-div" class="panel panel-success cookie-panel" role="dialog">
<div class="panel-body">
<h4 class="center">
This website uses cookies to adapt the display to your navigation.
</h4>
<p class="center">
Press <span class="framed-text">SPACE</span> to accept or click here:
<button type="button" class="btn btn-primary"
onclick="cmxClt.elts.box.closeCookieOnceForAll()">
OK
</button>
</p>
</div>
</div>`
// append on body (no positioning: fixed overlay)
var
body
=
document
.
querySelector
(
'body'
)
body
.
insertBefore
(
myDiv
,
body
.
lastChild
)
// add a closing action to spacebar
window
.
onkeydown
=
function
(
evt
)
{
if
(
!
localStorage
[
'comex_cookie_warning_done'
])
{
if
(
evt
.
keyCode
==
32
)
{
cmxClt
.
elts
.
box
.
closeCookieOnceForAll
()
// console.log('space toggleBox')
}
}
}
}
return
cC
...
...
templates/base_layout.html
View file @
f1ef2821
...
...
@@ -252,5 +252,13 @@
{% block last_imports %}
{% endblock %}
<script
type=
"text/javascript"
>
// shown once: a cookie warning
if
(
!
localStorage
[
'comex_cookie_warning_done'
])
{
cmxClt
.
elts
.
box
.
addCookieBox
()
}
</script>
</body>
</html>
templates/registration_super_short_form.html
View file @
f1ef2821
...
...
@@ -38,7 +38,7 @@
<div
class=
"question"
>
<!-- POSS login within modal like comex_test_modal -->
<p
class=
"legend"
>
Your email will also be your login for the ISC services.
</p>
<p
class=
"legend"
>
Your email will also be your login for the ISC services.
Institutional email is preferred.
</p>
<div
class=
"input-group"
>
<!-- email validation onblur/onchange is done by cmxClt.uauth in comex_user_shared_auth.js -->
<label
for=
"email"
class=
"smlabel input-group-addon"
>
* Email
</label>
...
...
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