Publish box: focus first date field on edit

The order of the fields may change depending on the translation.

Props afercia.
Fixes #33059.

Built from https://develop.svn.wordpress.org/trunk@33349


git-svn-id: http://core.svn.wordpress.org/trunk@33321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ella Iseulde Van Dorpe 2015-07-21 22:23:24 +00:00
parent d827a71c7f
commit 253d9db831
5 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ jQuery(document).ready( function($) {
$timestampdiv.siblings('a.edit-timestamp').click( function( event ) { $timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) { if ( $timestampdiv.is( ':hidden' ) ) {
$timestampdiv.slideDown('fast'); $timestampdiv.slideDown('fast');
$('#mm').focus(); $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
$(this).hide(); $(this).hide();
} }
event.preventDefault(); event.preventDefault();

View File

@ -1 +1 @@
jQuery(document).ready(function(a){postboxes.add_postbox_toggles("comment");var b=a("#timestampdiv"),c=a("#timestamp").html();b.siblings("a.edit-timestamp").click(function(c){b.is(":hidden")&&(b.slideDown("fast"),a("#mm").focus(),a(this).hide()),c.preventDefault()}),b.find(".cancel-timestamp").click(function(d){b.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),a("#timestamp").html(c),d.preventDefault()}),b.find(".save-timestamp").click(function(c){var d=a("#aa").val(),e=a("#mm").val(),f=a("#jj").val(),g=a("#hh").val(),h=a("#mn").val(),i=new Date(d,e-1,f,g,h);return c.preventDefault(),i.getFullYear()!=d||1+i.getMonth()!=e||i.getDate()!=f||i.getMinutes()!=h?void b.find(".timestamp-wrap").addClass("form-invalid"):(b.find(".timestamp-wrap").removeClass("form-invalid"),a("#timestamp").html(commentL10n.submittedOn+" <b>"+commentL10n.dateFormat.replace("%1$s",a('option[value="'+e+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(f,10)).replace("%3$s",d).replace("%4$s",("00"+g).slice(-2)).replace("%5$s",("00"+h).slice(-2))+"</b> "),b.slideUp("fast"),void b.siblings("a.edit-timestamp").show())})}); jQuery(document).ready(function(a){postboxes.add_postbox_toggles("comment");var b=a("#timestampdiv"),c=a("#timestamp").html();b.siblings("a.edit-timestamp").click(function(c){b.is(":hidden")&&(b.slideDown("fast"),a("input, select",b.find(".timestamp-wrap")).first().focus(),a(this).hide()),c.preventDefault()}),b.find(".cancel-timestamp").click(function(d){b.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),a("#timestamp").html(c),d.preventDefault()}),b.find(".save-timestamp").click(function(c){var d=a("#aa").val(),e=a("#mm").val(),f=a("#jj").val(),g=a("#hh").val(),h=a("#mn").val(),i=new Date(d,e-1,f,g,h);return c.preventDefault(),i.getFullYear()!=d||1+i.getMonth()!=e||i.getDate()!=f||i.getMinutes()!=h?void b.find(".timestamp-wrap").addClass("form-invalid"):(b.find(".timestamp-wrap").removeClass("form-invalid"),a("#timestamp").html(commentL10n.submittedOn+" <b>"+commentL10n.dateFormat.replace("%1$s",a('option[value="'+e+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(f,10)).replace("%3$s",d).replace("%4$s",("00"+g).slice(-2)).replace("%5$s",("00"+h).slice(-2))+"</b> "),b.slideUp("fast"),void b.siblings("a.edit-timestamp").show())})});

View File

@ -650,7 +650,7 @@ jQuery(document).ready( function($) {
$timestampdiv.siblings('a.edit-timestamp').click( function( event ) { $timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) { if ( $timestampdiv.is( ':hidden' ) ) {
$timestampdiv.slideDown('fast'); $timestampdiv.slideDown('fast');
$('#mm').focus(); $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
$(this).hide(); $(this).hide();
} }
event.preventDefault(); event.preventDefault();

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta3-33348'; $wp_version = '4.3-beta3-33349';
/** /**
* 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.