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
debe2e30
Commit
debe2e30
authored
Jan 05, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix registration form namespace issues that came up after js refactoring
parent
dbb64780
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
comex_page_reg_controllers.js
static/js/comex_page_reg_controllers.js
+6
-7
comex_user_shared_auth.js
static/js/comex_user_shared_auth.js
+13
-5
No files found.
static/js/comex_page_reg_controllers.js
View file @
debe2e30
...
@@ -112,7 +112,7 @@ function testDoorsUserExists(emailValue) {
...
@@ -112,7 +112,7 @@ function testDoorsUserExists(emailValue) {
function
registerDoorsAndSubmit
(){
function
registerDoorsAndSubmit
(){
mainMessage
.
innerHTML
=
"Registering with ISCPIF Doors..."
cmxClt
.
uform
.
mainMessage
.
innerHTML
=
"Registering with ISCPIF Doors..."
// all values from the form have now been validated
// all values from the form have now been validated
var
emailValue
=
cmxClt
.
uauth
.
email
.
value
var
emailValue
=
cmxClt
.
uauth
.
email
.
value
...
@@ -129,7 +129,7 @@ function registerDoorsAndSubmit(){
...
@@ -129,7 +129,7 @@ function registerDoorsAndSubmit(){
// REGISTERING ON THE DOORS -------------------------------------
// REGISTERING ON THE DOORS -------------------------------------
// /!\ async
// /!\ async
callDoors
(
c
mxClt
.
uauth
.
c
allDoors
(
"register"
,
"register"
,
[
emailValue
,
passValue
,
wholenameValue
],
[
emailValue
,
passValue
,
wholenameValue
],
...
@@ -152,8 +152,7 @@ function addUidThenSubmit(doorsResp) {
...
@@ -152,8 +152,7 @@ function addUidThenSubmit(doorsResp) {
}
}
else
{
else
{
// fill in the answer we got
// fill in the answer we got
// £TODO fix scope uauth and uform ?
ccModule
.
uauth
.
uidInput
.
value
=
doorsUid
uidInput
.
value
=
doorsUid
console
.
info
(
"form was validated and registered@doors: submitting now"
)
console
.
info
(
"form was validated and registered@doors: submitting now"
)
...
@@ -187,7 +186,7 @@ function validateAndMsg() {
...
@@ -187,7 +186,7 @@ function validateAndMsg() {
if
(
jobDate
.
value
.
length
)
jobDate
.
value
=
(
new
Date
(
jobDate
.
value
)).
toISOString
()
if
(
jobDate
.
value
.
length
)
jobDate
.
value
=
(
new
Date
(
jobDate
.
value
)).
toISOString
()
// objectify the form
// objectify the form
cmxClt
.
uform
.
wholeFormData
=
new
FormData
(
theForm
);
cmxClt
.
uform
.
wholeFormData
=
new
FormData
(
cmxClt
.
uform
.
theForm
);
var
missingFields
=
[]
var
missingFields
=
[]
var
toolongFields
=
[]
var
toolongFields
=
[]
...
@@ -246,8 +245,8 @@ function validateAndMsg() {
...
@@ -246,8 +245,8 @@ function validateAndMsg() {
// RESULTS
// RESULTS
if
(
valid
)
{
if
(
valid
)
{
// add
the captchaCheck inside the form (TODO should be automatic via realperson or uauth submodules)
// add
s the captchaCheck inside the form
c
mxClt
.
uauth
.
captchaCheck
.
value
=
$
(
captcha
).
realperson
(
'getHash'
)
c
cModule
.
uauth
.
collectCaptcha
(
)
cmxClt
.
uform
.
mainMessage
.
innerHTML
=
"Form is valid... Will register and submit..."
cmxClt
.
uform
.
mainMessage
.
innerHTML
=
"Form is valid... Will register and submit..."
cmxClt
.
uform
.
mainMessage
.
style
.
display
=
'block'
cmxClt
.
uform
.
mainMessage
.
style
.
display
=
'block'
...
...
static/js/comex_user_shared_auth.js
View file @
debe2e30
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
// cmxClt module augmentation
// cmxClt module augmentation
// POSS remove ccModule.auth. namespace prefix from local scope vars
cmxClt
=
(
function
(
ccModule
)
{
cmxClt
=
(
function
(
ccModule
)
{
// common vars to authenticating/registering in user area
// common vars to authenticating/registering in user area
ccModule
.
uauth
=
{}
ccModule
.
uauth
=
{}
...
@@ -30,18 +31,25 @@ cmxClt = (function(ccModule) {
...
@@ -30,18 +31,25 @@ cmxClt = (function(ccModule) {
// str of the form: doors_hostname:doors_port
// str of the form: doors_hostname:doors_port
ccModule
.
uauth
.
doorsConnectParam
=
document
.
getElementById
(
'doors_connect'
).
value
ccModule
.
uauth
.
doorsConnectParam
=
document
.
getElementById
(
'doors_connect'
).
value
// captcha
Hash should be appended by itself if normal submit,
// captcha
//
but we may need to do it ourselves (TODO test)
//
-------
ccModule
.
uauth
.
captcha
=
document
.
getElementById
(
'my-captcha'
)
ccModule
.
uauth
.
captcha
=
document
.
getElementById
(
'my-captcha'
)
ccModule
.
uauth
.
captchaCheck
=
document
.
getElementById
(
'my-captchaHash'
)
// param for generation & validation
// param for generation & validation
ccModule
.
uauth
.
realCaptchaLength
=
5
ccModule
.
uauth
.
realCaptchaLength
=
5
// initialize pseudo captcha
// captcha init
$
(
'#my-captcha'
).
realperson
({
length
:
ccModule
.
uauth
.
realCaptchaLength
});
$
(
cmxClt
.
uauth
.
captcha
).
realperson
({
length
:
ccModule
.
uauth
.
realCaptchaLength
})
// captchaHash should be appended by itself if normal submit,
// but otherwise we need to do it ourselves with collectCaptcha()
ccModule
.
uauth
.
captchaCheck
=
document
.
getElementById
(
'my-captchaHash'
)
ccModule
.
uauth
.
collectCaptcha
=
function
()
{
ccModule
.
uauth
.
captchaCheck
.
value
=
$
(
cmxClt
.
uauth
.
captcha
).
realperson
(
'getHash'
)
}
// doors-related html elements
// doors-related html elements
// ---------------------------
ccModule
.
uauth
.
doorsMessage
=
document
.
getElementById
(
'doors_ret_message'
)
ccModule
.
uauth
.
doorsMessage
=
document
.
getElementById
(
'doors_ret_message'
)
ccModule
.
uauth
.
doorsIconMessage
=
document
.
getElementById
(
'doors_ret_icon_msg'
)
ccModule
.
uauth
.
doorsIconMessage
=
document
.
getElementById
(
'doors_ret_icon_msg'
)
ccModule
.
uauth
.
doorsIcon
=
document
.
getElementById
(
'doors_ret_icon'
)
ccModule
.
uauth
.
doorsIcon
=
document
.
getElementById
(
'doors_ret_icon'
)
...
...
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