bootstrap.min.js
4 years ago
linedtextarea.js
4 years ago
popper.min.js
4 years ago
script.js
4 years ago
select2.min.js
4 years ago
script.js
48 lines
| 1 | jQuery( document ).ready( function( $ ) |
| 2 | { |
| 3 | $( ".new_line_number" ).linedtextarea({ |
| 4 | selectedLine: 1 |
| 5 | }); |
| 6 | |
| 7 | $( "#wpcmp_new_post_category" ).select2(); |
| 8 | |
| 9 | $( "#wpcmp_new_post_type" ).change( function( event ) |
| 10 | { |
| 11 | if ( $( this ).val() !== 'post' ) |
| 12 | { |
| 13 | $( "#wpcmp_new_post_category" ).prop( 'disabled', 'disabled' ); |
| 14 | } |
| 15 | else |
| 16 | { |
| 17 | $( "#wpcmp_new_post_category" ).removeAttr( 'disabled' ); |
| 18 | } |
| 19 | }); |
| 20 | |
| 21 | $( "#wpcmp_posts_titles" ).keyup( function( event ) |
| 22 | { |
| 23 | if ( $(this).val() == '' ) |
| 24 | { |
| 25 | $( "#wpcmp_new_post_type" ).prop( 'disabled', 'disabled' ); |
| 26 | |
| 27 | $( "#wpcmp_new_post_status" ).prop( 'disabled', 'disabled' ); |
| 28 | |
| 29 | $( "#wpcmp_new_post_author" ).prop( 'disabled', 'disabled' ); |
| 30 | |
| 31 | $( "#wpcmp_new_post_category" ).prop( 'disabled', 'disabled' ); |
| 32 | |
| 33 | $( "#wpcmp_submit_for_create_posts" ).prop( 'disabled', 'disabled' ); |
| 34 | } |
| 35 | else |
| 36 | { |
| 37 | $( "#wpcmp_new_post_type" ).removeAttr( 'disabled' ); |
| 38 | |
| 39 | $( "#wpcmp_new_post_status" ).removeAttr( 'disabled' ); |
| 40 | |
| 41 | $( "#wpcmp_new_post_author" ).removeAttr( 'disabled' ); |
| 42 | |
| 43 | $( "#wpcmp_new_post_category" ).removeAttr( 'disabled' ); |
| 44 | |
| 45 | $( "#wpcmp_submit_for_create_posts" ).removeAttr( 'disabled' ); |
| 46 | } |
| 47 | }); |
| 48 | }); |