Make WordPress Core

Changeset 8286


Ignore:
Timestamp:
07/08/2008 05:51:28 PM (17 years ago)
Author:
mdawaffe
Message:

crazyhorse: timestamp language changes. multiple ok/cancels may give inconsistent data

Location:
branches/crazyhorse/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/edit-form-advanced.php

    r8242 r8286  
    307307<?php
    308308    if ( current_user_can( 'publish_posts' ) ) : // Contributors don't get to choose the date of publish
     309        $stamp = __( 'Timestamp: <span class="timestamp">%1$s%3$s</span>' );
     310        $edit = '&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex="4">' . __('(Change)') . '</a>';
    309311        if ($post_ID) {
    310             if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
    311                 $stamp = __('Scheduled for: %1$s at %2$s');
    312             } else if ( 'publish' == $post->post_status ) { // already published
    313                 $stamp = __('Published on: %1$s at %2$s');
    314             } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
    315                 $stamp = __('Publish immediately');
    316             } else { // draft, 1 or more saves, date specified
    317                 $stamp = __('Publish on: %1$s at %2$s');
     312            if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
     313                $stamp = __( 'Timestamp: <span class="timestamp">Today, %1$s%3$s</span>' );
    318314            }
    319315            $date = mysql2date(get_option('date_format'), $post->post_date);
    320316            $time = mysql2date(get_option('time_format'), $post->post_date);
    321317        } else { // draft (no saves, and thus no date specified)
    322             $stamp = __('Publish immediately');
     318            $stamp = __( 'Timestamp: <span class="timestamp">Today, %1$s%3$s</span>' );
    323319            $date = mysql2date(get_option('date_format'), current_time('mysql'));
    324320            $time = mysql2date(get_option('time_format'), current_time('mysql'));
     
    326322?>
    327323
    328     <p class="curtime"><?php printf($stamp, $date, $time); ?>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a></p>
     324    <p class="curtime"><?php printf($stamp, $date, $time, $edit); ?>
     325</p>
    329326    <div id='timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>
    330327
  • branches/crazyhorse/wp-admin/includes/template.php

    r8277 r8286  
    965965
    966966<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />
     967
     968<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a>
     969<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a>
    967970<?php
    968971}
  • branches/crazyhorse/wp-admin/js/post.js

    r8242 r8286  
    163163        if (jQuery('#timestampdiv').is(":hidden")) {
    164164            jQuery('#timestampdiv').slideDown("normal");
    165             jQuery('.edit-timestamp').text(postL10n.cancel);
     165            jQuery('.timestamp').hide();
    166166        } else {
    167167            jQuery('#timestampdiv').hide();
     
    171171            jQuery('#hh').val(jQuery('#hidden_hh').val());
    172172            jQuery('#mn').val(jQuery('#hidden_mn').val());
    173             jQuery('.edit-timestamp').text(postL10n.edit);
    174         }
    175         return false;
    176 
     173            jQuery('.timestamp').show();
     174        }
     175        return false;
     176
     177    });
     178    jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
     179        jQuery('#timestampdiv').hide();
     180        var link = jQuery('.timestamp a').clone( true );
     181        jQuery('.timestamp').show().html(
     182            jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' +
     183            jQuery('#jj').val() + ', ' +
     184            jQuery('#aa').val() + ' @ ' +
     185            jQuery('#hh').val() + ':' +
     186            jQuery('#mn').val() + ' '
     187        ).append( link );
     188        return false;
    177189    });
    178190
Note: See TracChangeset for help on using the changeset viewer.