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