Make WordPress Core


Ignore:
Timestamp:
07/03/2013 08:27:19 PM (13 years ago)
Author:
ocean90
Message:

Revisions UI update:

  • Restore Compare two mode
  • Restore tooltips
  • RTL support
  • First pass for URL routing and history

props adamsilverstein, see #24425.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/revision.php

    r24520 r24549  
    116116
    117117<script id="tmpl-revisions-frame" type="text/html">
    118         <span class="spinner"></span>
    119118        <div class="revisions-control-frame"></div>
    120119        <div class="revisions-diff-frame"></div>
    121120</script>
    122121
    123 <script id="tmpl-revisions-controls" type="text/html">
    124 
    125         <div class="revision-toggle-compare-mode">
    126                 <label>
    127                         <input type="checkbox" class="compare-two-revisions" />
    128                         <?php esc_attr_e( 'Compare two revisions' ); ?>
    129                 </label>
    130         </div>
    131 
     122<script id="tmpl-revisions-buttons" type="text/html">
    132123        <div class="revisions-previous">
    133124                <input class="button" type="button" id="previous" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
    … …  
    139130</script>
    140131
     132<script id="tmpl-revisions-tooltip" type="text/html">
     133        <div class="ui-slider-tooltip ui-widget-content ui-corner-all ">
     134        <# if ( 'undefined' !== typeof data && 'undefined' !== typeof data.author ) { #>
     135                        {{{ data.author.avatar }}} {{{ data.author.name }}},
     136                        {{{ data.timeAgo }}} <?php _e( 'ago' ); ?>
     137                        ({{{ data.dateShort }}})
     138        <# } #>
     139        </div>
     140        <div class="arrow"></div>
     141</script>
     142
     143<script id="tmpl-revisions-checkbox" type="text/html">
     144        <div class="revision-toggle-compare-mode">
     145                <label>
     146                        <input type="checkbox" class="compare-two-revisions"
     147                        <#
     148                        if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {
     149                                #> checked="checked"<#
     150                        }
     151                        #>
     152                        />
     153                        <?php esc_attr_e( 'Compare two revisions' ); ?>
     154                </label>
     155        </div>
     156</script>
    141157
    142158<script id="tmpl-revisions-meta" type="text/html">
    … …  
    144160                <div id="diff-header-from" class="diff-header">
    145161                        <div id="diff-title-from" class="diff-title">
    146                                 <strong>
    147                                 <?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
    148                                         <# if ( 'undefined' !== typeof data.from ) { #>
    149                                                 {{{ data.from.attributes.author.avatar }}} {{{ data.from.attributes.author.name }}},
    150                                                 {{{ data.from.attributes.timeAgo }}} <?php _e( 'ago' ); ?>
    151                                                 ({{{ data.from.attributes.dateShort }}})
    152                                         <# } #>
    153 
     162                                <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
     163                                <# if ( 'undefined' !== typeof data.from ) { #>
     164                                        {{{ data.from.attributes.author.avatar }}} {{{ data.from.attributes.author.name }}},
     165                                        {{{ data.from.attributes.timeAgo }}} <?php _e( 'ago' ); ?>
     166                                        ({{{ data.from.attributes.dateShort }}})
     167                                <# } #>
    154168                        </div>
    155169                        <div class="clear"></div>
    … …  
    159173                        <div id="diff-title-to" class="diff-title">
    160174                                <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
    161                                         <# if ( 'undefined' !== typeof data.to ) { #>
    162                                                 {{{ data.to.attributes.author.avatar }}} {{{ data.to.attributes.author.name }}},
    163                                                 {{{ data.to.attributes.timeAgo }}} <?php _e( 'ago' ); ?>
    164                                                 ({{{ data.to.attributes.dateShort }}})
    165                                         <# } #>
    166                 </div>
     175                                <# if ( 'undefined' !== typeof data.to ) { #>
     176                                        {{{ data.to.attributes.author.avatar }}} {{{ data.to.attributes.author.name }}},
     177                                        {{{ data.to.attributes.timeAgo }}} <?php _e( 'ago' ); ?>
     178                                        ({{{ data.to.attributes.dateShort }}})
     179                                <# } #>
     180                        </div>
    167181
    168182                        <input type="button" id="restore-revision" class="button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" />
    … …  
    178192</script>
    179193
    180 <script id="tmpl-revisions-diff-old" type="text/html">
    181         <div id="toggle-revision-compare-mode">
    182                 <label>
    183                         <input type="checkbox" id="compare-two-revisions" />
    184                         <?php esc_attr_e( 'Compare two revisions' ); ?>
    185                 </label>
    186         </div>
    187194
    188         <div id="diff-header">
    189                 <div id="diff-header-from" class="diff-header">
    190                         <div id="diff-title-from" class="diff-title">
    191                                 <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong> {{{ data.titleFrom }}}
    192                         </div>
    193                         <div class="clear"></div>
    194                 </div>
    195 
    196                 <div id="diff-header-to" class="diff-header">
    197                         <div id="diff-title-to" class="diff-title">
    198                                 <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong> {{{ data.titleTo }}}
    199                         </div>
    200 
    201                         <input type="button" id="restore-revision" class="button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" />
    202                         <div class="clear"></div>
    203                 </div>
    204         </div>
    205 
    206         <div id="diff-table">{{{ data.diff }}}</div>
    207 </script>
    208 
    209 <script id="tmpl-revision-interact-old" type="text/html">
    210         <div id="diff-previous-revision">
    211                 <input class="button" type="button" id="previous" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
    212         </div>
    213 
    214         <div id="diff-next-revision">
    215                 <input class="button" type="button" id="next" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
    216         </div>
    217 
    218 </script>
    219 
    220 <script id="tmpl-revision-ticks" type="text/html">
    221         <div class="revision-tick completed-{{{ data.completed }}} scope-of-changes-{{{ data.scopeOfChanges }}}">
    222                 <span class="ui-slider-tooltip ui-widget-content ui-corner-all hidden"></span>
    223         </div>
    224 </script>
    225195<?php
    226196require_once( './admin-footer.php' );
Note: See TracChangeset for help on using the changeset viewer.