Changeset 33348
- Timestamp:
- 07/21/2015 10:08:38 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/comment.js
r33337 r33348 4 4 postboxes.add_postbox_toggles('comment'); 5 5 6 var stamp = $('#timestamp').html(); 7 $('.edit-timestamp').click(function () { 8 if ($('#timestampdiv').is(':hidden')) { 9 $('#timestampdiv').slideDown('normal'); 10 $('.edit-timestamp').hide(); 6 var $timestampdiv = $('#timestampdiv'), 7 stamp = $('#timestamp').html(); 8 9 $timestampdiv.siblings('a.edit-timestamp').click( function( event ) { 10 if ( $timestampdiv.is( ':hidden' ) ) { 11 $timestampdiv.slideDown('fast'); 12 $('#mm').focus(); 13 $(this).hide(); 11 14 } 12 return false;15 event.preventDefault(); 13 16 }); 14 17 15 $ ('.cancel-timestamp').click(function() {16 $ ('#timestampdiv').slideUp('normal');18 $timestampdiv.find('.cancel-timestamp').click( function( event ) { 19 $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().focus(); 17 20 $('#mm').val($('#hidden_mm').val()); 18 21 $('#jj').val($('#hidden_jj').val()); … … 21 24 $('#mn').val($('#hidden_mn').val()); 22 25 $('#timestamp').html(stamp); 23 $('.edit-timestamp').show(); 24 return false; 26 event.preventDefault(); 25 27 }); 26 28 27 $ ('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels29 $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels 28 30 var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(), 29 31 newD = new Date( aa, mm - 1, jj, hh, mn ); 30 32 33 event.preventDefault(); 34 31 35 if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) { 32 $ ('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');33 return false;36 $timestampdiv.find('.timestamp-wrap').addClass('form-invalid'); 37 return; 34 38 } else { 35 $ ('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');39 $timestampdiv.find('.timestamp-wrap').removeClass('form-invalid'); 36 40 } 37 41 38 $('#timestampdiv').slideUp('normal');39 $('.edit-timestamp').show();40 42 $('#timestamp').html( 41 43 commentL10n.submittedOn + ' <b>' + 42 $( '#mm option[value="' + mm + '"]' ).text() + ' ' + 43 jj + ', ' + 44 aa + ' @ ' + 45 hh + ':' + 46 mn + '</b> ' 44 commentL10n.dateFormat 45 .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) ) 46 .replace( '%2$s', parseInt( jj, 10 ) ) 47 .replace( '%3$s', aa ) 48 .replace( '%4$s', ( '00' + hh ).slice( -2 ) ) 49 .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) + 50 '</b> ' 47 51 ); 48 return false; 52 53 $timestampdiv.slideUp('fast'); 54 $timestampdiv.siblings('a.edit-timestamp').show(); 49 55 }); 50 56 }); -
trunk/src/wp-includes/script-loader.php
r33340 r33348 524 524 $scripts->add_data( 'comment', 'group', 1 ); 525 525 did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array( 526 'submittedOn' => __('Submitted on:') 526 'submittedOn' => __( 'Submitted on:' ), 527 /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */ 528 'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ) 527 529 ) ); 528 530
Note: See TracChangeset
for help on using the changeset viewer.