1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**we have all
* @fileoverview
* Profile 1/overview and 2/completing
* @todo
* - package.json
*
* @version 1
* @copyright ISCPIF-CNRS 2016
* @author romain.loth@iscpif.fr
*
* @requires comex_user_shared
* @requires comex_user_shared_auth
*
* NB The uinfo variable should be set to template's user.json_info value.
*
* 2 forms here:
* 1/ The consultation of legacy profile is simply a copy of
* comex_page_profile_controllers with the old input re-fills
* iff present but without the new input validations
*
* 2/ The "re-create your account" form is a doors-auth of register type
*/
// the "re-create this account" form
// initialize "createlogin form" controllers
var returnForm = cmxClt.uauth.AuthForm(
'comex_createlogin_form',
miniregValidate,
{
'type': "doorsRegister",
// if email validation, captcha perhaps too much?
'validateCaptcha': false,
'validateEmail': false
}
)
// the email is readonly
function miniregValidate(self) {
self.elSubmitBtn.disabled = !self.passStatus
}
function showMessageAndSubmit() {
returnForm.elMainMessage.style.display = "block"
returnForm.elMainMessage.innerHTML = "Registering with the test login portal<br/> and sending validation email..."
returnForm.elForm.submit()
}
// trigger auth changes (email always autocompleted for return_user)
returnForm.elEmail.dispatchEvent(new CustomEvent('change'))
// vertical adjust of rCol
var lCol = document.getElementById('leftcol')
var rCol = document.getElementById('rightcol')
var neededAdjustment = Math.round((lCol.offsetHeight - rCol.offsetHeight) / 2)
rCol.style.marginTop = neededAdjustment
console.log("profile controllers load OK")