PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 3.16.5
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v3.16.5
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
profile-builder / features / content-restriction / assets / js / content-restriction.js

content-restriction.js in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 3.16.5, at features/content-restriction/assets/js/content-restriction.js

39 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery( function(){
2
3 /* Display custom redirect URL section if type of restriction is "Redirect" */
4 jQuery( 'input[type=radio][name=wppb-content-restrict-type]' ).on( "click", function() {
5 if( jQuery( this ).is(':checked') && jQuery( this ).val() == 'redirect' ){
6 jQuery( '#wppb-meta-box-fields-wrapper-restriction-redirect-url' ).addClass( 'wppb-content-restriction-enabled' );
7
8 // hide the custom restriction messages section (not needed for Redirect)
9 jQuery( '#wppb-meta-box-fields-wrapper-restriction-custom-messages' ).hide();
10 }
11 else {
12 jQuery( '#wppb-meta-box-fields-wrapper-restriction-redirect-url' ).removeClass( 'wppb-content-restriction-enabled' );
13
14 // this needs to be unchecked so that the Custom URL is properly disabled
15 jQuery( '#wppb-content-restrict-custom-redirect-url-enabled' ).prop( 'checked', false );
16 jQuery( '.wppb-meta-box-field-wrapper-custom-redirect-url' ).removeClass( 'wppb-content-restriction-enabled' );
17
18 // show the custom restriction messages section
19 jQuery( '#wppb-meta-box-fields-wrapper-restriction-custom-messages' ).show();
20 }
21 } );
22
23 /* Display custom redirect URL field */
24 jQuery( '#wppb-content-restrict-custom-redirect-url-enabled' ).on( "click", function() {
25 if( jQuery( this ).is( ':checked' ) )
26 jQuery( '.wppb-meta-box-field-wrapper-custom-redirect-url' ).addClass( 'wppb-content-restriction-enabled' );
27 else
28 jQuery( '.wppb-meta-box-field-wrapper-custom-redirect-url' ).removeClass( 'wppb-content-restriction-enabled' );
29 } );
30
31 /* Display custom messages editors */
32 jQuery( '#wppb-content-restrict-messages-enabled' ).on( "click", function() {
33 if( jQuery( this ).is( ':checked' ) )
34 jQuery( '.wppb-meta-box-field-wrapper-custom-messages' ).addClass( 'wppb-content-restriction-enabled' );
35 else
36 jQuery( '.wppb-meta-box-field-wrapper-custom-messages' ).removeClass( 'wppb-content-restriction-enabled' );
37 } );
38
39 } );