@@ -6,7 +6,23 @@ $(document).ready(function(){
66
77 var urlParams = new URLSearchParams ( location . search ) ;
88 var formSubmitted = urlParams . get ( 'form_submitted' ) ;
9+ var formType = urlParams . get ( 'form_type' ) ;
910 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 ) ;
1026 $ ( '.form-submission-popup' ) . css ( 'display' , 'block' ) ;
1127 }
1228
@@ -23,7 +39,7 @@ $(document).ready(function(){
2339
2440 function check_user_authenticated_or_not ( ) {
2541 if ( Cookies . get ( 'authenticated' ) ) {
26- modify_html_elements ( 'none' , 'none' , 'block' , 'block' ) ;
42+ modify_html_elements ( 'none' , 'none' , 'block' , 'block' , 'block' ) ;
2743 }
2844 }
2945
@@ -39,11 +55,13 @@ $(document).ready(function(){
3955
4056 function modify_html_elements ( popup_form_display , login_option_display ,
4157 profile_option_display ,
42- logout__option_display ) {
58+ logout__option_display ,
59+ form_option_display ) {
4360 $ ( '.form-popup' ) . css ( 'display' , popup_form_display ) ;
4461 login_user_el . css ( 'display' , login_option_display ) ;
4562 $ ( '.user-profile' ) . css ( 'display' , profile_option_display ) ;
4663 logout_user_el . css ( 'display' , logout__option_display ) ;
64+ $ ( '.forms-dropdown-option' ) . css ( 'display' , form_option_display ) ;
4765 }
4866
4967 function manipulate_web_page_data ( oauth_provider , http_response_text ) {
@@ -52,7 +70,7 @@ $(document).ready(function(){
5270 // Cookies expires in 3 days
5371 Cookies . set ( 'authenticated' , true , { expires : 3 } ) ;
5472 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' ) ;
5674 }
5775 else {
5876 display_error_message ( oauth_provider , json_data . message ) ;
@@ -110,12 +128,13 @@ $(document).ready(function(){
110128 $ ( '.form-popup' ) . css ( 'display' , 'none' ) ;
111129 $ ( '.form-submission-popup' ) . css ( 'display' , 'none' ) ;
112130 $ ( '.oauth-error' ) . css ( 'display' , 'none' ) ;
131+ $ ( '.community-form' ) . css ( 'display' , 'none' ) ;
113132 } ) ;
114133
115134 logout_user_el . click ( function ( ) {
116135 Cookies . remove ( 'authenticated' ) ;
117136 Cookies . remove ( 'username' ) ;
118- modify_html_elements ( 'none' , 'block' , 'none' , 'none' ) ;
137+ modify_html_elements ( 'none' , 'block' , 'none' , 'none' , 'none' ) ;
119138 } ) ;
120139
121140 $ ( '.login-with-github' ) . click ( function ( e ) {
0 commit comments