-/**
- * Display JavaScript on the page.
- *
- * @since 3.5.0
- */
-function options_general_add_js() {
-?>
-<script type="text/javascript">
-//<![CDATA[
- jQuery(document).ready(function($){
- $("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).siblings('span').text() );
- });
- $("input[name='date_format_custom']").focus(function(){
- $("#date_format_custom_radio").attr("checked", "checked");
- });
-
- $("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).siblings('span').text() );
- });
- $("input[name='time_format_custom']").focus(function(){
- $("#time_format_custom_radio").attr("checked", "checked");
- });
- $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
- var format = $(this);
- format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
- $.post(ajaxurl, {
- action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
- date : format.val()
- }, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
- });
- });
-//]]>
-</script>
-<?php
-}