wp/wp-admin/includes/options.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    32  * @since 3.5.0
    32  * @since 3.5.0
    33  */
    33  */
    34 function options_general_add_js() {
    34 function options_general_add_js() {
    35 	?>
    35 	?>
    36 <script type="text/javascript">
    36 <script type="text/javascript">
    37 	jQuery(document).ready(function($){
    37 	jQuery( function($) {
    38 		var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
    38 		var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
    39 			homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
    39 			homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
    40 
    40 
    41 		$( '#blogname' ).on( 'input', function() {
    41 		$( '#blogname' ).on( 'input', function() {
    42 			var title = $.trim( $( this ).val() ) || homeURL;
    42 			var title = $.trim( $( this ).val() ) || homeURL;
    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 			}
    98 		});
    98 		});
    99 	});
    99 	} );
   100 </script>
   100 </script>
   101 	<?php
   101 	<?php
   102 }
   102 }
   103 
   103 
   104 /**
   104 /**
   107  * @since 3.5.0
   107  * @since 3.5.0
   108  */
   108  */
   109 function options_reading_add_js() {
   109 function options_reading_add_js() {
   110 	?>
   110 	?>
   111 <script type="text/javascript">
   111 <script type="text/javascript">
   112 	jQuery(document).ready(function($){
   112 	jQuery( function($) {
   113 		var section = $('#front-static-pages'),
   113 		var section = $('#front-static-pages'),
   114 			staticPage = section.find('input:radio[value="page"]'),
   114 			staticPage = section.find('input:radio[value="page"]'),
   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' ).on( '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 
   126 /**
   126 /**