Index: /trunk/src/wp-admin/includes/admin.php
===================================================================
--- /trunk/src/wp-admin/includes/admin.php	(revision 34021)
+++ /trunk/src/wp-admin/includes/admin.php	(revision 34022)
@@ -40,4 +40,7 @@
 require_once(ABSPATH . 'wp-admin/includes/misc.php');
 
+/** WordPress Options Administration API */
+require_once(ABSPATH . 'wp-admin/includes/options.php');
+
 /** WordPress Plugin Administration API */
 require_once(ABSPATH . 'wp-admin/includes/plugin.php');
Index: /trunk/src/wp-admin/includes/options.php
===================================================================
--- /trunk/src/wp-admin/includes/options.php	(revision 34022)
+++ /trunk/src/wp-admin/includes/options.php	(revision 34022)
@@ -0,0 +1,141 @@
+<?php
+/**
+ * WordPress Options Administration API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 4.4.0
+ */
+
+/**
+ * Output JavaScript to toggle display of additional settings if avatars are disabled.
+ *
+ * @since 4.2.0
+ */
+function options_discussion_add_js() {
+?>
+	<script>
+	(function($){
+		var parent = $( '#show_avatars' ),
+			children = $( '.avatar-settings' );
+		parent.change(function(){
+			children.toggleClass( 'hide-if-js', ! this.checked );
+		});
+	})(jQuery);
+	</script>
+<?php
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function options_general_add_js() {
+?>
+<script type="text/javascript">
+	jQuery(document).ready(function($){
+		var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
+			homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
+
+		$( '#blogname' ).on( 'input', function() {
+			var title = $.trim( $( this ).val() ) || homeURL;
+
+			// Truncate to 40 characters.
+			if ( 40 < title.length ) {
+				title = title.substring( 0, 40 ) + '\u2026';
+			}
+
+			$siteName.text( title );
+		});
+
+		$("input[name='date_format']").click(function(){
+			if ( "date_format_custom_radio" != $(this).attr("id") )
+				$( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() );
+		});
+		$("input[name='date_format_custom']").focus(function(){
+			$( '#date_format_custom_radio' ).prop( 'checked', true );
+		});
+
+		$("input[name='time_format']").click(function(){
+			if ( "time_format_custom_radio" != $(this).attr("id") )
+				$( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() );
+		});
+		$("input[name='time_format_custom']").focus(function(){
+			$( '#time_format_custom_radio' ).prop( 'checked', true );
+		});
+		$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
+			var format = $(this);
+			format.siblings( '.spinner' ).addClass( 'is-active' );
+			$.post(ajaxurl, {
+					action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
+					date : format.val()
+				}, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
+		});
+
+		var languageSelect = $( '#WPLANG' );
+		$( 'form' ).submit( function() {
+			// Don't show a spinner for English and installed languages,
+			// as there is nothing to download.
+			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
+				$( '#submit', this ).after( '<span class="spinner language-install-spinner" />' );
+			}
+		});
+	});
+</script>
+<?php
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function options_permalink_add_js() {
+	?>
+<script type="text/javascript">
+jQuery(document).ready(function() {
+	jQuery('.permalink-structure input:radio').change(function() {
+		if ( 'custom' == this.value )
+			return;
+		jQuery('#permalink_structure').val( this.value );
+	});
+	jQuery('#permalink_structure').focus(function() {
+		jQuery("#custom_selection").attr('checked', 'checked');
+	});
+});
+</script>
+<?php
+}
+
+/**
+ * Display JavaScript on the page.
+ *
+ * @since 3.5.0
+ */
+function options_reading_add_js() {
+?>
+<script type="text/javascript">
+	jQuery(document).ready(function($){
+		var section = $('#front-static-pages'),
+			staticPage = section.find('input:radio[value="page"]'),
+			selects = section.find('select'),
+			check_disabled = function(){
+				selects.prop( 'disabled', ! staticPage.prop('checked') );
+			};
+		check_disabled();
+ 		section.find('input:radio').change(check_disabled);
+	});
+</script>
+<?php
+}
+
+/**
+ * Render the blog charset setting.
+ *
+ * @since 3.5.0
+ */
+function options_reading_blog_charset() {
+	echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
+	echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
+}
Index: /trunk/src/wp-admin/options-discussion.php
===================================================================
--- /trunk/src/wp-admin/options-discussion.php	(revision 34021)
+++ /trunk/src/wp-admin/options-discussion.php	(revision 34022)
@@ -15,22 +15,4 @@
 $parent_file = 'options-general.php';
 
-/**
- * Output JavaScript to toggle display of additional settings if avatars are disabled.
- *
- * @since 4.2.0
- */
-function options_discussion_add_js() {
-?>
-	<script>
-	(function($){
-		var parent = $( '#show_avatars' ),
-			children = $( '.avatar-settings' );
-		parent.change(function(){
-			children.toggleClass( 'hide-if-js', ! this.checked );
-		});
-	})(jQuery);
-	</script>
-<?php
-}
 add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );
 
Index: /trunk/src/wp-admin/options-general.php
===================================================================
--- /trunk/src/wp-admin/options-general.php	(revision 34021)
+++ /trunk/src/wp-admin/options-general.php	(revision 34022)
@@ -21,63 +21,4 @@
 $timezone_format = _x('Y-m-d H:i:s', 'timezone date format');
 
-/**
- * Display JavaScript on the page.
- *
- * @since 3.5.0
- */
-function options_general_add_js() {
-?>
-<script type="text/javascript">
-	jQuery(document).ready(function($){
-		var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
-			homeURL = ( <?php echo wp_json_encode( get_home_url() ); ?> || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );
-
-		$( '#blogname' ).on( 'input', function() {
-			var title = $.trim( $( this ).val() ) || homeURL;
-
-			// Truncate to 40 characters.
-			if ( 40 < title.length ) {
-				title = title.substring( 0, 40 ) + '\u2026';
-			}
-
-			$siteName.text( title );
-		});
-
-		$("input[name='date_format']").click(function(){
-			if ( "date_format_custom_radio" != $(this).attr("id") )
-				$( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() );
-		});
-		$("input[name='date_format_custom']").focus(function(){
-			$( '#date_format_custom_radio' ).prop( 'checked', true );
-		});
-
-		$("input[name='time_format']").click(function(){
-			if ( "time_format_custom_radio" != $(this).attr("id") )
-				$( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() );
-		});
-		$("input[name='time_format_custom']").focus(function(){
-			$( '#time_format_custom_radio' ).prop( 'checked', true );
-		});
-		$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
-			var format = $(this);
-			format.siblings( '.spinner' ).addClass( 'is-active' );
-			$.post(ajaxurl, {
-					action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
-					date : format.val()
-				}, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
-		});
-
-		var languageSelect = $( '#WPLANG' );
-		$( 'form' ).submit( function() {
-			// Don't show a spinner for English and installed languages,
-			// as there is nothing to download.
-			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
-				$( '#submit', this ).after( '<span class="spinner language-install-spinner" />' );
-			}
-		});
-	});
-</script>
-<?php
-}
 add_action('admin_head', 'options_general_add_js');
 
Index: /trunk/src/wp-admin/options-permalink.php
===================================================================
--- /trunk/src/wp-admin/options-permalink.php	(revision 34021)
+++ /trunk/src/wp-admin/options-permalink.php	(revision 34022)
@@ -47,25 +47,4 @@
 );
 
-/**
- * Display JavaScript on the page.
- *
- * @since 3.5.0
- */
-function options_permalink_add_js() {
-	?>
-<script type="text/javascript">
-jQuery(document).ready(function() {
-	jQuery('.permalink-structure input:radio').change(function() {
-		if ( 'custom' == this.value )
-			return;
-		jQuery('#permalink_structure').val( this.value );
-	});
-	jQuery('#permalink_structure').focus(function() {
-		jQuery("#custom_selection").attr('checked', 'checked');
-	});
-});
-</script>
-<?php
-}
 add_filter('admin_head', 'options_permalink_add_js');
 
Index: /trunk/src/wp-admin/options-reading.php
===================================================================
--- /trunk/src/wp-admin/options-reading.php	(revision 34021)
+++ /trunk/src/wp-admin/options-reading.php	(revision 34022)
@@ -16,36 +16,5 @@
 $parent_file = 'options-general.php';
 
-/**
- * Display JavaScript on the page.
- *
- * @since 3.5.0
- */
-function options_reading_add_js() {
-?>
-<script type="text/javascript">
-	jQuery(document).ready(function($){
-		var section = $('#front-static-pages'),
-			staticPage = section.find('input:radio[value="page"]'),
-			selects = section.find('select'),
-			check_disabled = function(){
-				selects.prop( 'disabled', ! staticPage.prop('checked') );
-			};
-		check_disabled();
- 		section.find('input:radio').change(check_disabled);
-	});
-</script>
-<?php
-}
 add_action('admin_head', 'options_reading_add_js');
-
-/**
- * Render the blog charset setting.
- *
- * @since 3.5.0
- */
-function options_reading_blog_charset() {
-	echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
-	echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
-}
 
 get_current_screen()->add_help_tab( array(
