@@ -3,106 +3,105 @@ $( "#tabsSettings" ).tabs();
3
3
$ ( "#tabsSettings" ) . css ( 'display' , 'block' ) ;
4
4
$ ( "#tabsSettings" ) . show ( ) ;
5
5
6
- $ ( '#modifyPassword' ) . ajaxForm ( { beforeSubmit : validatePasswordChange , success : successPasswordChange } ) ;
6
+ $ ( '#modifyPassword' ) . ajaxForm ( { beforeSubmit : validatePasswordChange , success : successPasswordChange } ) ;
7
7
8
- $ ( '#modifyAccount' ) . ajaxForm ( { beforeSubmit : validateAccountChange , success : successAccountChange } ) ;
8
+ $ ( '#modifyAccount' ) . ajaxForm ( { beforeSubmit : validateAccountChange , success : successAccountChange } ) ;
9
9
10
- $ ( '#modifyPicture' ) . ajaxForm ( { beforeSubmit : validatePictureChange , success : successPictureChange } ) ;
10
+ $ ( '#modifyPicture' ) . ajaxForm ( { beforeSubmit : validatePictureChange , success : successPictureChange } ) ;
11
11
12
12
jsonSettings = jQuery . parseJSON ( $ ( 'div.jsonSettingsContent' ) . html ( ) ) ;
13
13
14
14
$ ( 'textarea#biography' ) . attr ( 'onkeyup' , 'this.value = this.value.slice(0, 255)' ) ;
15
15
$ ( 'textarea#biography' ) . attr ( 'onchange' , 'this.value = this.value.slice(0, 255)' ) ;
16
16
17
17
18
- function validatePasswordChange ( formData , jqForm , options ) {
19
-
20
- var form = jqForm [ 0 ] ;
21
- if ( form . newPassword . value . length < 2 )
22
- {
23
- createNotive ( jsonSettings . passwordErrorShort , 4000 ) ;
24
- return false ;
25
- }
26
- if ( form . newPassword . value . length < 2 || form . newPassword . value != form . newPasswordConfirmation . value ) {
27
- createNotive ( jsonSettings . passwordErrorMatch , 4000 ) ;
28
- return false ;
18
+ function validatePasswordChange ( formData , jqForm , options )
19
+ {
20
+ var form = jqForm [ 0 ] ;
21
+ if ( form . newPassword . value . length < 2 )
22
+ {
23
+ createNotice ( jsonSettings . passwordErrorShort , 4000 ) ;
24
+ return false ;
25
+ }
26
+ if ( form . newPassword . value . length < 2 || form . newPassword . value != form . newPasswordConfirmation . value )
27
+ {
28
+ createNotice ( jsonSettings . passwordErrorMatch , 4000 ) ;
29
+ return false ;
29
30
}
30
31
}
31
32
32
- function validatePictureChange ( formData , jqForm , options ) {
33
-
34
- var form = jqForm [ 0 ] ;
35
-
33
+ function validatePictureChange ( formData , jqForm , options )
34
+ {
35
+ var form = jqForm [ 0 ] ;
36
36
}
37
37
38
- function validateAccountChange ( formData , jqForm , options ) {
39
-
40
- var form = jqForm [ 0 ] ;
41
- if ( form . firstname . value . length < 1 )
42
- {
43
- createNotive ( jsonSettings . accountErrorFirstname , 4000 ) ;
44
- return false ;
45
- }
46
- if ( form . lastname . value . length < 1 )
47
- {
48
- createNotive ( jsonSettings . accountErrorLastname , 4000 ) ;
49
- return false ;
50
- }
38
+ function validateAccountChange ( formData , jqForm , options )
39
+ {
40
+ var form = jqForm [ 0 ] ;
41
+ if ( form . firstname . value . length < 1 )
42
+ {
43
+ createNotice ( jsonSettings . accountErrorFirstname , 4000 ) ;
44
+ return false ;
45
+ }
46
+ if ( form . lastname . value . length < 1 )
47
+ {
48
+ createNotice ( jsonSettings . accountErrorLastname , 4000 ) ;
49
+ return false ;
50
+ }
51
51
}
52
52
53
- function successPasswordChange ( responseText , statusText , xhr , $ form)
53
+ function successPasswordChange ( responseText , statusText , xhr , form )
54
54
{
55
55
jsonResponse = jQuery . parseJSON ( responseText ) ;
56
- if ( jsonResponse == null )
56
+ if ( jsonResponse == null )
57
57
{
58
- createNotive ( 'Error' , 4000 ) ;
59
- return ;
58
+ createNotice ( 'Error' , 4000 ) ;
59
+ return ;
60
60
}
61
61
if ( jsonResponse [ 0 ] )
62
62
{
63
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
63
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
64
64
}
65
65
else
66
66
{
67
- $ ( '#modifyPassword input[type=password]' ) . val ( '' ) ;
68
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
67
+ $ ( '#modifyPassword input[type=password]' ) . val ( '' ) ;
68
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
69
69
}
70
70
}
71
71
72
- function successAccountChange ( responseText , statusText , xhr , $ form)
72
+ function successAccountChange ( responseText , statusText , xhr , form )
73
73
{
74
74
jsonResponse = jQuery . parseJSON ( responseText ) ;
75
- if ( jsonResponse == null )
75
+ if ( jsonResponse == null )
76
76
{
77
- createNotive ( 'Error' , 4000 ) ;
78
- return ;
77
+ createNotice ( 'Error' , 4000 ) ;
78
+ return ;
79
79
}
80
80
if ( jsonResponse [ 0 ] )
81
81
{
82
- $ ( 'a#topUserName' ) . html ( $ ( '#modifyAccount input[name=firstname]' ) . val ( ) + ' ' + $ ( '#modifyAccount input[name=lastname]' ) . val ( ) + ' <img class="arrowUser" src="' + json . global . coreWebroot + '/public/images/icons/arrow-user.gif" alt ="" />' ) ;
83
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
82
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
84
83
}
85
84
else
86
85
{
87
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
86
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
88
87
}
89
88
}
90
89
91
- function successPictureChange ( responseText , statusText , xhr , $ form)
90
+ function successPictureChange ( responseText , statusText , xhr , form )
92
91
{
93
92
jsonResponse = jQuery . parseJSON ( responseText ) ;
94
- if ( jsonResponse == null )
93
+ if ( jsonResponse == null )
95
94
{
96
- createNotive ( 'Error' , 4000 ) ;
97
- return ;
95
+ createNotice ( 'Error' , 4000 ) ;
96
+ return ;
98
97
}
99
98
if ( jsonResponse [ 0 ] )
100
99
{
101
- $ ( 'img#userTopThumbnail' ) . attr ( 'src' , jsonResponse [ 2 ] ) ;
102
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
100
+ $ ( 'img#userTopThumbnail' ) . attr ( 'src' , jsonResponse [ 2 ] ) ;
101
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
103
102
}
104
103
else
105
104
{
106
- createNotive ( jsonResponse [ 1 ] , 4000 ) ;
105
+ createNotice ( jsonResponse [ 1 ] , 4000 ) ;
107
106
}
108
- }
107
+ }
0 commit comments