@@ -6,7 +6,23 @@ $(document).ready(function(){
6
6
7
7
var urlParams = new URLSearchParams ( location . search ) ;
8
8
var formSubmitted = urlParams . get ( 'form_submitted' ) ;
9
+ var formType = urlParams . get ( 'form_type' ) ;
9
10
if ( formSubmitted === 'True' ) {
11
+ var message = '' ;
12
+ if ( formType === 'login' ) {
13
+ message = 'You request to join community, form has been' +
14
+ ' submitted! You will receive an invite email within 24hrs, if' +
15
+ ' all the validation checks are passed. Else, you will receive' +
16
+ ' an email with the information regarding what all checks got' +
17
+ ' failed!' ;
18
+ }
19
+ else if ( formType === 'community' ) {
20
+ message = 'Your request has been received and will be soon' +
21
+ ' processed. You will receive an email notifying you whether' +
22
+ ' the validation checks are passed or not. If not, the email' +
23
+ ' will contain the validation errors. Correct them, if any' ;
24
+ }
25
+ $ ( '.important-message' ) . text ( message ) ;
10
26
$ ( '.form-submission-popup' ) . css ( 'display' , 'block' ) ;
11
27
}
12
28
@@ -23,7 +39,7 @@ $(document).ready(function(){
23
39
24
40
function check_user_authenticated_or_not ( ) {
25
41
if ( Cookies . get ( 'authenticated' ) ) {
26
- modify_html_elements ( 'none' , 'none' , 'block' , 'block' ) ;
42
+ modify_html_elements ( 'none' , 'none' , 'block' , 'block' , 'block' ) ;
27
43
}
28
44
}
29
45
@@ -39,11 +55,13 @@ $(document).ready(function(){
39
55
40
56
function modify_html_elements ( popup_form_display , login_option_display ,
41
57
profile_option_display ,
42
- logout__option_display ) {
58
+ logout__option_display ,
59
+ form_option_display ) {
43
60
$ ( '.form-popup' ) . css ( 'display' , popup_form_display ) ;
44
61
login_user_el . css ( 'display' , login_option_display ) ;
45
62
$ ( '.user-profile' ) . css ( 'display' , profile_option_display ) ;
46
63
logout_user_el . css ( 'display' , logout__option_display ) ;
64
+ $ ( '.forms-dropdown-option' ) . css ( 'display' , form_option_display ) ;
47
65
}
48
66
49
67
function manipulate_web_page_data ( oauth_provider , http_response_text ) {
@@ -52,7 +70,7 @@ $(document).ready(function(){
52
70
// Cookies expires in 3 days
53
71
Cookies . set ( 'authenticated' , true , { expires : 3 } ) ;
54
72
Cookies . set ( 'username' , json_data . user , { expires : 3 } ) ;
55
- modify_html_elements ( 'none' , 'none' , 'block' , 'block' ) ;
73
+ modify_html_elements ( 'none' , 'none' , 'block' , 'block' , 'block' ) ;
56
74
}
57
75
else {
58
76
display_error_message ( oauth_provider , json_data . message ) ;
@@ -110,12 +128,13 @@ $(document).ready(function(){
110
128
$ ( '.form-popup' ) . css ( 'display' , 'none' ) ;
111
129
$ ( '.form-submission-popup' ) . css ( 'display' , 'none' ) ;
112
130
$ ( '.oauth-error' ) . css ( 'display' , 'none' ) ;
131
+ $ ( '.community-form' ) . css ( 'display' , 'none' ) ;
113
132
} ) ;
114
133
115
134
logout_user_el . click ( function ( ) {
116
135
Cookies . remove ( 'authenticated' ) ;
117
136
Cookies . remove ( 'username' ) ;
118
- modify_html_elements ( 'none' , 'block' , 'none' , 'none' ) ;
137
+ modify_html_elements ( 'none' , 'block' , 'none' , 'none' , 'none' ) ;
119
138
} ) ;
120
139
121
140
$ ( '.login-with-github' ) . click ( function ( e ) {
0 commit comments