wp/wp-admin/includes/options.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    16 	?>
    16 	?>
    17 	<script>
    17 	<script>
    18 	(function($){
    18 	(function($){
    19 		var parent = $( '#show_avatars' ),
    19 		var parent = $( '#show_avatars' ),
    20 			children = $( '.avatar-settings' );
    20 			children = $( '.avatar-settings' );
    21 		parent.change(function(){
    21 		parent.on( 'change', function(){
    22 			children.toggleClass( 'hide-if-js', ! this.checked );
    22 			children.toggleClass( 'hide-if-js', ! this.checked );
    23 		});
    23 		});
    24 	})(jQuery);
    24 	})(jQuery);
    25 	</script>
    25 	</script>
    26 	<?php
    26 	<?php
    47 			}
    47 			}
    48 
    48 
    49 			$siteName.text( title );
    49 			$siteName.text( title );
    50 		});
    50 		});
    51 
    51 
    52 		$( 'input[name="date_format"]' ).click( function() {
    52 		$( 'input[name="date_format"]' ).on( 'click', function() {
    53 			if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )
    53 			if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )
    54 				$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    54 				$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    55 		});
    55 		});
    56 
    56 
    57 		$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    57 		$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    58 			$( '#date_format_custom_radio' ).prop( 'checked', true );
    58 			$( '#date_format_custom_radio' ).prop( 'checked', true );
    59 		});
    59 		});
    60 
    60 
    61 		$( 'input[name="time_format"]' ).click( function() {
    61 		$( 'input[name="time_format"]' ).on( 'click', function() {
    62 			if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )
    62 			if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )
    63 				$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    63 				$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    64 		});
    64 		});
    65 
    65 
    66 		$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
    66 		$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
    87 				}
    87 				}
    88 			}, 500 ) );
    88 			}, 500 ) );
    89 		} );
    89 		} );
    90 
    90 
    91 		var languageSelect = $( '#WPLANG' );
    91 		var languageSelect = $( '#WPLANG' );
    92 		$( 'form' ).submit( function() {
    92 		$( 'form' ).on( 'submit', function() {
    93 			// Don't show a spinner for English and installed languages,
    93 			// Don't show a spinner for English and installed languages,
    94 			// as there is nothing to download.
    94 			// as there is nothing to download.
    95 			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
    95 			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
    96 				$( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
    96 				$( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
    97 			}
    97 			}
   115 			selects = section.find('select'),
   115 			selects = section.find('select'),
   116 			check_disabled = function(){
   116 			check_disabled = function(){
   117 				selects.prop( 'disabled', ! staticPage.prop('checked') );
   117 				selects.prop( 'disabled', ! staticPage.prop('checked') );
   118 			};
   118 			};
   119 		check_disabled();
   119 		check_disabled();
   120 		section.find( 'input:radio' ).change( check_disabled );
   120 		section.find( 'input:radio' ).on( 'change', check_disabled );
   121 	});
   121 	});
   122 </script>
   122 </script>
   123 	<?php
   123 	<?php
   124 }
   124 }
   125 
   125