Settings: Fix date/time format previewing.
Props afercia. Amends [41857]. Fixes #41603 for 4.9. Built from https://develop.svn.wordpress.org/branches/4.9@42135 git-svn-id: http://core.svn.wordpress.org/branches/4.9@41966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bbef4fd178
commit
e6a91f7ccf
|
@ -897,7 +897,7 @@ table.form-table td .updated p {
|
||||||
|
|
||||||
.options-general-php .spinner {
|
.options-general-php .spinner {
|
||||||
float: none;
|
float: none;
|
||||||
margin: 0 3px;
|
margin: -3px 3px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-php .language-install-spinner,
|
.settings-php .language-install-spinner,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -897,7 +897,7 @@ table.form-table td .updated p {
|
||||||
|
|
||||||
.options-general-php .spinner {
|
.options-general-php .spinner {
|
||||||
float: none;
|
float: none;
|
||||||
margin: 0 3px;
|
margin: -3px 3px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-php .language-install-spinner,
|
.settings-php .language-install-spinner,
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -51,7 +51,7 @@ function options_general_add_js() {
|
||||||
|
|
||||||
$("input[name='date_format']").click(function(){
|
$("input[name='date_format']").click(function(){
|
||||||
if ( "date_format_custom_radio" != $(this).attr("id") )
|
if ( "date_format_custom_radio" != $(this).attr("id") )
|
||||||
$( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
|
$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
|
||||||
});
|
});
|
||||||
$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
|
$( 'input[name="date_format_custom"]' ).on( 'click input', function() {
|
||||||
$( '#date_format_custom_radio' ).prop( 'checked', true );
|
$( '#date_format_custom_radio' ).prop( 'checked', true );
|
||||||
|
@ -59,18 +59,23 @@ function options_general_add_js() {
|
||||||
|
|
||||||
$("input[name='time_format']").click(function(){
|
$("input[name='time_format']").click(function(){
|
||||||
if ( "time_format_custom_radio" != $(this).attr("id") )
|
if ( "time_format_custom_radio" != $(this).attr("id") )
|
||||||
$( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
|
$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
|
||||||
});
|
});
|
||||||
$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
|
$( 'input[name="time_format_custom"]' ).on( 'click input', function() {
|
||||||
$( '#time_format_custom_radio' ).prop( 'checked', true );
|
$( '#time_format_custom_radio' ).prop( 'checked', true );
|
||||||
});
|
});
|
||||||
$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
|
$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
|
||||||
var format = $(this);
|
var format = $( this ),
|
||||||
format.siblings( '.spinner' ).addClass( 'is-active' );
|
fieldset = format.closest( 'fieldset' ),
|
||||||
$.post(ajaxurl, {
|
example = fieldset.find( '.example' ),
|
||||||
action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
|
spinner = fieldset.find( '.spinner' );
|
||||||
|
|
||||||
|
spinner.addClass( 'is-active' );
|
||||||
|
|
||||||
|
$.post( ajaxurl, {
|
||||||
|
action: 'date_format_custom' == format.attr( 'name' ) ? 'date_format' : 'time_format',
|
||||||
date : format.val()
|
date : format.val()
|
||||||
}, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
|
}, function( d ) { spinner.removeClass( 'is-active' ); example.text( d ); } );
|
||||||
});
|
});
|
||||||
|
|
||||||
var languageSelect = $( '#WPLANG' );
|
var languageSelect = $( '#WPLANG' );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9-RC2-42133';
|
$wp_version = '4.9-RC2-42135';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue