@@ -6,7 +6,24 @@ $(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' ) ;
10+
911 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 ) ;
1027 $ ( '.form-submission-popup' ) . css ( 'display' , 'block' ) ;
1128 }
1229
@@ -23,7 +40,7 @@ $(document).ready(function(){
2340
2441 function check_user_authenticated_or_not ( ) {
2542 if ( Cookies . get ( 'authenticated' ) ) {
26- modify_html_elements ( 'none' , 'none' , 'block' ) ;
43+ modify_html_elements ( 'none' , 'none' , 'block' , 'block' ) ;
2744 }
2845 }
2946
@@ -38,10 +55,12 @@ $(document).ready(function(){
3855 }
3956
4057 function modify_html_elements ( popup_form_display , login_option_display ,
41- logout__option_display ) {
58+ logout__option_display ,
59+ form_option_display ) {
4260 $ ( '.form-popup' ) . css ( 'display' , popup_form_display ) ;
4361 login_user_el . css ( 'display' , login_option_display ) ;
4462 logout_user_el . css ( 'display' , logout__option_display ) ;
63+ $ ( '.forms-dropdown-option' ) . css ( 'display' , form_option_display ) ;
4564 }
4665
4766 function manipulate_web_page_data ( oauth_provider , http_response_text ) {
@@ -50,7 +69,7 @@ $(document).ready(function(){
5069 // Cookies expires in 3 days
5170 Cookies . set ( 'authenticated' , true , { expires : 3 } ) ;
5271 Cookies . set ( 'username' , json_data . user , { expires : 3 } ) ;
53- modify_html_elements ( 'none' , 'none' , 'block' ) ;
72+ modify_html_elements ( 'none' , 'none' , 'block' , 'block' ) ;
5473 }
5574 else {
5675 display_error_message ( oauth_provider , json_data . message ) ;
@@ -108,12 +127,13 @@ $(document).ready(function(){
108127 $ ( '.form-popup' ) . css ( 'display' , 'none' ) ;
109128 $ ( '.form-submission-popup' ) . css ( 'display' , 'none' ) ;
110129 $ ( '.oauth-error' ) . css ( 'display' , 'none' ) ;
130+ $ ( '.community-form' ) . css ( 'display' , 'none' ) ;
111131 } ) ;
112132
113133 logout_user_el . click ( function ( ) {
114134 Cookies . remove ( 'authenticated' ) ;
115135 Cookies . remove ( 'username' ) ;
116- modify_html_elements ( 'none' , 'block' , 'none' ) ;
136+ modify_html_elements ( 'none' , 'block' , 'none' , 'none' ) ;
117137 } ) ;
118138
119139 $ ( '.login-with-github' ) . click ( function ( e ) {
0 commit comments