Revisions UI: Add translation contexts and remove unneeded lines.
props nao. fixes #23917. git-svn-id: http://core.svn.wordpress.org/trunk@24157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0de35b1035
commit
ea1cecebee
|
@ -3694,8 +3694,6 @@ table.diff .diff-addedline ins {
|
|||
|
||||
.comparing-two-revisions #diff-previous-revision,
|
||||
.comparing-two-revisions #diff-next-revision,
|
||||
#diff-title-from-current-version,
|
||||
.comparing-two-revisions.current-version #diff-title-from-current-version,
|
||||
#diff-header-from {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -2245,7 +2245,9 @@ function wp_ajax_revisions_data() {
|
|||
$date
|
||||
);
|
||||
|
||||
/* translators: 1: date */
|
||||
$autosavef = _x( '%1$s [Autosave]', 'post revision title extra' );
|
||||
/* translators: 1: date */
|
||||
$currentf = _x( '%1$s [Current Revision]', 'post revision title extra' );
|
||||
|
||||
if ( ! $post = get_post( $post_id ) )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
window.wp = window.wp || {};
|
||||
|
||||
(function($) {
|
||||
var Revision, Revisions, Diff, l10n, revisions;
|
||||
var Revision, Revisions, Diff, revisions;
|
||||
|
||||
revisions = wp.revisions = function() {
|
||||
Diff = revisions.Diff = new Diff();
|
||||
|
@ -9,12 +9,8 @@ window.wp = window.wp || {};
|
|||
|
||||
_.extend( revisions, { model: {}, view: {}, controller: {} } );
|
||||
|
||||
// Link any localized strings.
|
||||
l10n = revisions.model.l10n = typeof wpRevisionsL10n === 'undefined' ? {} : wpRevisionsL10n;
|
||||
|
||||
// Link any settings.
|
||||
revisions.model.settings = l10n.settings || {};
|
||||
delete l10n.settings;
|
||||
// Link settings.
|
||||
revisions.model.settings = typeof wpRevisionsSettings === 'undefined' ? {} : wpRevisionsSettings;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -330,12 +326,6 @@ window.wp = window.wp || {};
|
|||
Diff.rightDiff = ui.values[1];
|
||||
}
|
||||
|
||||
if ( 0 === Diff.leftDiff ) {
|
||||
$( '#revision-diff-container' ).addClass( 'current-version' );
|
||||
} else {
|
||||
$( '#revision-diff-container' ).removeClass( 'current-version' );
|
||||
}
|
||||
|
||||
Diff.revisionView.render();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -78,10 +78,6 @@ else
|
|||
|
||||
wp_enqueue_script( 'revisions' );
|
||||
|
||||
$strings = array(
|
||||
'diffFromTitle' => _x( 'From: %s', 'revision from title' ),
|
||||
'diffToTitle' => _x( 'To: %s', 'revision to title' )
|
||||
);
|
||||
|
||||
$settings = array(
|
||||
'post_id' => $post->ID,
|
||||
|
@ -89,8 +85,7 @@ $settings = array(
|
|||
'revision_id' => $revision_id
|
||||
);
|
||||
|
||||
$strings['settings'] = $settings;
|
||||
wp_localize_script( 'revisions', 'wpRevisionsL10n', $strings );
|
||||
wp_localize_script( 'revisions', 'wpRevisionsSettings', $settings );
|
||||
|
||||
require_once( './admin-header.php' );
|
||||
|
||||
|
@ -125,18 +120,14 @@ require_once( './admin-header.php' );
|
|||
|
||||
<div id="diff-header">
|
||||
<div id="diff-header-from" class="diff-header">
|
||||
<div id="diff-title-from-current-version" class="diff-title">
|
||||
<?php printf( '<strong>%1$s</strong> %2$s.' , __( 'From:' ), __( 'the current version' ) ); ?>
|
||||
</div>
|
||||
|
||||
<div id="diff-title-from" class="diff-title">
|
||||
<strong><?php _e( 'From:' ); ?></strong> {{{ data.titleFrom }}}
|
||||
<strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong> {{{ data.titleFrom }}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="diff-header-to" class="diff-header">
|
||||
<div id="diff-title-to" class="diff-title">
|
||||
<strong><?php _e( 'To:' ); ?></strong> {{{ data.titleTo }}}
|
||||
<strong><?php _e( 'To:', 'Followed by post revision info' ); ?></strong> {{{ data.titleTo }}}
|
||||
</div>
|
||||
|
||||
<input type="button" id="restore-revision" class="button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" />
|
||||
|
@ -150,11 +141,11 @@ require_once( './admin-header.php' );
|
|||
|
||||
<script id="tmpl-revision-interact" type="text/html">
|
||||
<div id="diff-previous-revision">
|
||||
<input class="button" type="button" id="previous" value="<?php esc_attr_e( 'Previous' ); ?>" />
|
||||
<input class="button" type="button" id="previous" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="diff-next-revision">
|
||||
<input class="button" type="button" id="next" value="<?php esc_attr_e( 'Next' ); ?>" />
|
||||
<input class="button" type="button" id="next" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="diff-slider" class="wp-slider"></div>
|
||||
|
|
|
@ -1312,9 +1312,9 @@ function wp_post_revision_title( $revision, $link = true ) {
|
|||
/* translators: revision date format, see http://php.net/date */
|
||||
$datef = _x( 'j F, Y @ G:i', 'revision date format');
|
||||
/* translators: 1: date */
|
||||
$autosavef = __( '%1$s [Autosave]' );
|
||||
$autosavef = _x( '%1$s [Autosave]', 'post revision title extra' );
|
||||
/* translators: 1: date */
|
||||
$currentf = __( '%1$s [Current Revision]' );
|
||||
$currentf = _x( '%1$s [Current Revision]', 'post revision title extra' );
|
||||
|
||||
$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
|
||||
if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
|
||||
|
|
Loading…
Reference in New Issue