Changeset 24761
- Timestamp:
- 07/22/2013 05:05:45 AM (11 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/colors-classic.css
r24751 r24761 165 165 } 166 166 167 #diff-header,167 .revisions-meta, 168 168 .widget .widget-top, 169 169 .postbox h3, … … 1482 1482 } 1483 1483 1484 #diff-header{1484 .revisions-meta { 1485 1485 border: 1px solid #d1e5ee; 1486 } 1487 1488 .revisions-controls { 1489 background: #fff; 1490 background: -webkit-gradient(linear, left bottom, left top, color-stop(0%,rgba(255,255,255,1)), color-stop(30px,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,1))); 1491 background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1492 background: -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1493 background: -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1494 background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1486 1495 } 1487 1496 … … 1492 1501 } 1493 1502 1494 #diff-title-to strong{1495 color: #08a;1503 .revisions-tickmarks > div { 1504 border-color: #d1e5ee; 1496 1505 } 1497 1506 … … 1499 1508 .wp-slider.ui-slider { 1500 1509 border-color: #d1e5ee; 1501 background: #eff8ff;1502 1510 } 1503 1511 … … 1508 1516 1509 1517 .wp-slider .ui-slider-handle { 1510 border-color: #ccc;1511 1518 border-color: #d0dfe9; 1512 1519 background: #eff8ff; -
trunk/wp-admin/css/colors-fresh.css
r24751 r24761 165 165 } 166 166 167 #diff-header,167 .revisions-meta, 168 168 .widget .widget-top, 169 169 .postbox h3, … … 1376 1376 } 1377 1377 1378 #diff-header{1378 .revisions-meta { 1379 1379 border: 1px solid #dfdfdf; 1380 } 1381 1382 .revisions-controls { 1383 background: #fff; 1384 background: -webkit-gradient(linear, left bottom, left top, color-stop(0%,rgba(255,255,255,1)), color-stop(30px,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,1))); 1385 background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1386 background: -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1387 background: -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1388 background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%); 1380 1389 } 1381 1390 … … 1390 1399 } 1391 1400 1392 #diff-title-to strong {1393 color: #08a;1394 }1395 1396 1401 /* jQuery UI Slider */ 1397 1402 .wp-slider.ui-slider { 1398 1403 border-color: #d7d7d7; 1399 background: transparent;1400 1404 } 1401 1405 -
trunk/wp-admin/css/wp-admin-rtl.css
r24751 r24761 977 977 } 978 978 979 .revisions .loading-indicator { 980 margin-right: -90px; 981 } 982 983 body.folded .revisions .loading-indicator { 984 margin-right: -32px; 985 } 986 979 987 .revisions-next { 980 988 float: left; … … 983 991 .revisions-previous { 984 992 float: right; 985 }986 987 #diff-header {988 padding: 5px 5px 5px 200px;989 993 } 990 994 … … 1005 1009 } 1006 1010 1007 .diff- header> input.restore-revision {1011 .diff-meta > input.restore-revision { 1008 1012 margin-left: 0; 1009 1013 margin-right: 10px; … … 1028 1032 margin-left: 0; 1029 1033 margin-right: -70px; 1030 -webkit-transition: right 15ms; 1031 -moz-transition: right 15ms; 1032 -ms-transition: right 15ms; 1033 -o-transition: right 15ms;1034 transition: right 15ms;1034 } 1035 1036 .revisions-tooltip.flipped { 1037 margin-right: 0; 1038 margin-left: -70px; 1035 1039 } 1036 1040 … … 1045 1049 } 1046 1050 1051 .revisions-tooltip.flipped .revisions-tooltip-arrow { 1052 margin-right: 0; 1053 margin-left: 35px; 1054 right: auto; 1055 left: 0; 1056 } 1057 1047 1058 .revisions-tooltip-arrow > span { 1048 1059 right: 20px; 1060 } 1061 1062 .revisions-tooltip.flipped .revisions-tooltip-arrow > span { 1063 right: auto; 1064 left: 20px; 1049 1065 } 1050 1066 -
trunk/wp-admin/css/wp-admin.css
r24753 r24761 3520 3520 padding-top: 40px; 3521 3521 height: 100px; 3522 z-index: 1; 3522 3523 } 3523 3524 … … 3526 3527 top: -1px; 3527 3528 vertical-align: text-bottom; 3529 } 3530 3531 .revisions.pinned .revisions-controls { 3532 position: fixed; 3533 top: 0; 3534 padding-bottom: 10px; 3528 3535 } 3529 3536 … … 3572 3579 3573 3580 .revisions .loading-indicator { 3574 position: absolute;3581 position: fixed; 3575 3582 vertical-align: middle; 3576 3583 opacity: 0; 3577 3584 width: 100%; 3578 top: 3em; 3585 top: 50%; 3586 margin-left: -90px; 3579 3587 -webkit-transition: opacity 0.5s; 3580 3588 -moz-transition: opacity 0.5s; … … 3585 3593 } 3586 3594 3595 body.folded .revisions .loading-indicator { 3596 margin-left: -32px; 3597 } 3598 3587 3599 .revisions .loading-indicator span.spinner { 3588 3600 display: block; … … 3624 3636 3625 3637 .comparing-two-revisions .revisions-previous, 3626 .comparing-two-revisions .revisions-next { 3638 .comparing-two-revisions .revisions-next, 3639 .revisions-meta .diff-meta-to strong { 3627 3640 display: none; 3641 } 3642 3643 .revisions-controls .author-card .date { 3644 color: #777; 3645 } 3646 .revisions-controls .author-card .author-name { 3647 font-weight: bold; 3648 } 3649 3650 .comparing-two-revisions .diff-meta-to strong { 3651 display: block; 3628 3652 } 3629 3653 … … 3690 3714 } 3691 3715 3692 #diff-title-to strong { 3693 display: inline; 3694 } 3695 3696 #diff-header { 3716 .diff-meta { 3697 3717 -webkit-border-radius: 3px; 3698 3718 border-radius: 3px; 3699 3719 padding: 5px; 3700 3720 clear: both; 3701 } 3702 3703 .diff-header { 3704 min-height: 35px; 3705 line-height: 35px; 3706 } 3707 3708 .diff-title { 3709 float: left; 3721 min-height: 32px; 3710 3722 } 3711 3723 3712 3724 .diff-title strong { 3713 font-size: 14px;3714 width: 60px;3725 line-height: 32px; 3726 min-width: 60px; 3715 3727 text-align: right; 3716 3728 float: left; … … 3718 3730 } 3719 3731 3720 .diff-title img { 3732 .revisions-controls .author-card .avatar, 3733 .revisions-controls .author-card .author-info { 3734 float: left; 3735 margin-left: 6px; 3736 margin-right: 6px; 3737 } 3738 3739 .revisions-controls .author-card .byline { 3740 display: block; 3741 font-size: 12px; 3742 } 3743 3744 .revisions-controls .author-card .avatar { 3721 3745 vertical-align: middle; 3722 margin-left: 5px; 3723 } 3724 3725 .diff-header > input.restore-revision { 3726 margin-left: 10px; 3727 } 3728 3729 #diff-header-from { 3746 } 3747 3748 .diff-meta input.restore-revision { 3749 float: right; 3750 margin-left: 6px; 3751 margin-right: 6px; 3752 margin-top: 4px; 3753 } 3754 3755 .diff-meta-from { 3730 3756 display: none; 3731 3757 } 3732 3758 3733 .comparing-two-revisions #diff-title-from, 3734 .comparing-two-revisions #diff-header-from { 3759 .comparing-two-revisions .diff-meta-from { 3735 3760 display: block; 3736 3761 } … … 3741 3766 margin-right: 0; 3742 3767 margin-left: -70px; 3743 line-height: 28px;3744 3768 z-index: 1; 3745 3769 max-width: 350px; 3746 3770 min-width: 130px; 3747 padding: 4px;3771 padding: 8px 4px; 3748 3772 display: none; 3749 3773 opacity: 0; 3750 -webkit-transition: left 15ms; 3751 -moz-transition: left 15ms; 3752 -ms-transition: left 15ms; 3753 -o-transition: left 15ms; 3754 transition: left 15ms; 3774 } 3775 3776 .revisions-tooltip.flipped { 3777 margin-left: 0; 3778 margin-right: -70px; 3779 } 3780 3781 .revisions.pinned .revisions-tooltip { 3782 display: none !important; 3755 3783 } 3756 3784 3757 3785 .comparing-two-revisions .revisions-tooltip { 3758 3786 bottom: 145px; 3759 }3760 3761 .revisions-tooltip img {3762 float: left;3763 margin: 2px 5px 0 0;3764 padding: 0;3765 vertical-align: middle;3766 3787 } 3767 3788 … … 3775 3796 bottom: -15px; 3776 3797 z-index: 10000; 3798 } 3799 3800 .revisions-tooltip.flipped .revisions-tooltip-arrow { 3801 margin-left: 0; 3802 margin-right: 35px; 3803 left: auto; 3804 right: 0; 3777 3805 } 3778 3806 … … 3791 3819 } 3792 3820 3821 .revisions-tooltip.flipped .revisions-tooltip-arrow > span { 3822 left: auto; 3823 right: 20px; 3824 } 3825 3793 3826 .ie8 .revisions-tooltip-arrow > span { 3794 3827 left: 14px; 3795 3828 top: -25px; 3796 -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */3829 -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; 3797 3830 } 3798 3831 -
trunk/wp-admin/includes/revision.php
r24730 r24761 100 100 $modified = strtotime( $revision->post_modified ); 101 101 $modified_gmt = strtotime( $revision->post_modified_gmt ); 102 $restore_link = wp_nonce_url(102 $restore_link = str_replace( '&', '&', wp_nonce_url( 103 103 add_query_arg( 104 104 array( 'revision' => $revision->ID, … … 107 107 ), 108 108 "restore-post_{$revision->ID}" 109 ) ;109 ) ); 110 110 111 111 if ( ! isset( $authors[ $revision->post_author ] ) ) { 112 112 $authors[ $revision->post_author ] = array( 113 113 'id' => (int) $revision->post_author, 114 'avatar' => $show_avatars ? get_avatar( $revision->post_author, 24) : '',114 'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '', 115 115 'name' => get_the_author_meta( 'display_name', $revision->post_author ), 116 116 ); … … 143 143 } 144 144 145 // If a post has been saved since the last revision (no revisioned fields were changed) 146 // we may not have a "current" revision. Mark the latest revision as "current". 147 if ( empty( $current_id ) ) 148 $revisions[ $revision->ID ]['current'] = true; 149 145 150 // Now, grab the initial diff 146 151 $compare_two_mode = is_numeric( $from ); -
trunk/wp-admin/js/revisions.js
r24751 r24761 532 532 533 533 initialize: function() { 534 _.bindAll( this, 'setWidth' ); 535 534 536 // Add the button view 535 537 this.views.add( new revisions.view.Buttons({ … … 574 576 model: this.model 575 577 }) ); 576 578 }, 579 580 ready: function() { 581 this.top = this.$el.offset().top; 582 this.window = $(window); 583 this.window.on( 'scroll.wp.revisions', {controls: this}, function(e) { 584 var controls = e.data.controls; 585 var container = controls.$el.parent(); 586 var scrolled = controls.window.scrollTop(); 587 var frame = controls.views.parent; 588 589 if ( scrolled >= controls.top ) { 590 if ( ! frame.$el.hasClass('pinned') ) { 591 controls.setWidth(); 592 container.css('height', container.height() + 'px' ); 593 controls.window.on('resize.wp.revisions.pinning click.wp.revisions.pinning', {controls: controls}, function(e) { 594 e.data.controls.setWidth(); 595 }); 596 } 597 frame.$el.addClass('pinned'); 598 } else if ( frame.$el.hasClass('pinned') ) { 599 controls.window.off('.wp.revisions.pinning'); 600 controls.$el.css('width', 'auto'); 601 frame.$el.removeClass('pinned'); 602 container.css('height', 'auto'); 603 controls.top = controls.$el.offset().top; 604 } else { 605 controls.top = controls.$el.offset().top; 606 } 607 }); 608 }, 609 610 setWidth: function() { 611 this.$el.css('width', this.$el.parent().width() + 'px'); 577 612 } 578 613 }); … … 593 628 offset = tick.allPositions(); 594 629 elWidth = tick.outerWidth(); 595 // adjust596 630 _.extend( offset, { 597 right : offset.right + elWidth + 1,598 left : offset.left + elWidth + 1631 rightPlusWidth: offset.right, 632 leftPlusWidth: offset.left 599 633 }); 600 634 } else { … … 602 636 tick = this.$('div:nth-of-type(' + (index + 1) + ')'); 603 637 offset = tick.allPositions(); 638 _.extend( offset, { 639 leftPlusWidth: offset.left + tick.outerWidth() + 1, 640 rightPlusWidth: offset.right + tick.outerWidth() + 1 641 }); 604 642 } 605 643 this.model.set({ offset: offset }); … … 627 665 628 666 initialize: function() { 629 this.listenTo( this.model, 'update:revisions', this.re ady);667 this.listenTo( this.model, 'update:revisions', this.render ); 630 668 }, 631 669 … … 634 672 }, 635 673 636 ready: function() {637 this.$('.restore-revision').prop( 'disabled', this.model.get('to').get('current') );638 },639 640 674 restoreRevision: function() { 641 var restoreUrl = this.model.get('to').attributes.restoreUrl.replace(/&/g, '&'); 642 document.location = restoreUrl; 675 document.location = this.model.get('to').attributes.restoreUrl; 643 676 } 644 677 }); … … 678 711 className: 'revisions-tooltip', 679 712 template: wp.template('revisions-tooltip'), 680 direction: isRtl ? 'right' : 'left',681 713 682 714 initialize: function( options ) { … … 691 723 692 724 render: function() { 693 var css = {}; 725 var direction, directionVal, flipped, css = {}, position = this.model.revisions.indexOf( this.model.get('revision') ) + 1; 726 flipped = ( position / this.model.revisions.length ) > 0.5; 727 if ( isRtl ) { 728 direction = flipped ? 'left' : 'right'; 729 directionVal = flipped ? 'leftPlusWidth' : direction; 730 } else { 731 direction = flipped ? 'right' : 'left'; 732 directionVal = flipped ? 'rightPlusWidth' : direction; 733 } 734 otherDirection = 'right' === direction ? 'left': 'right'; 694 735 wp.Backbone.View.prototype.render.apply( this, arguments ); 695 css[this.direction] = this.model.get('offset')[this.direction] + 'px'; 696 this.$el.css( css ); 736 css[direction] = this.model.get('offset')[directionVal] + 'px'; 737 css[otherDirection] = ''; 738 this.$el.toggleClass( 'flipped', flipped ).css( css ); 697 739 }, 698 740 … … 717 759 718 760 events: { 719 'click #next': 'nextRevision',720 'click #previous': 'previousRevision'761 'click .revisions-next .button': 'nextRevision', 762 'click .revisions-previous .button': 'previousRevision' 721 763 }, 722 764 -
trunk/wp-admin/revision.php
r24751 r24761 123 123 <script id="tmpl-revisions-buttons" type="text/html"> 124 124 <div class="revisions-previous"> 125 <input class="button" type="button" id="previous"value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />125 <input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" /> 126 126 </div> 127 127 128 128 <div class="revisions-next"> 129 <input class="button" type="button" id="next"value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />129 <input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" /> 130 130 </div> 131 131 </script> 132 132 133 133 <script id="tmpl-revisions-tooltip" type="text/html"> 134 <div class=" revisions-tooltip-content">134 <div class="author-card"> 135 135 <# if ( 'undefined' !== typeof data && 'undefined' !== typeof data.author ) { #> 136 {{{ data.author.avatar }}} {{ data.author.name }}, 137 {{ data.timeAgo }} 138 ({{ data.dateShort }}) 136 {{{ data.author.avatar }}} 137 <div class="author-info"> 138 <span class="byline">Edit by <span class="author-name">{{ data.author.name }}</span></span> 139 <span class="time-ago">{{ data.timeAgo }}</span> 140 <span class="date">({{ data.dateShort }})</span> 141 </div> 139 142 <# } #> 140 143 </div> … … 158 161 159 162 <script id="tmpl-revisions-meta" type="text/html"> 160 <div id="diff-header"> 161 <div id="diff-header-from" class="diff-header"> 162 <div id="diff-title-from" class="diff-title"> 163 <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong> 164 <# if ( 'undefined' !== typeof data.from ) { #> 165 {{{ data.from.attributes.author.avatar }}} {{ data.from.attributes.author.name }}, 166 {{ data.from.attributes.timeAgo }} 167 ({{ data.from.attributes.dateShort }}) 168 <# } #> 163 <div class="diff-meta diff-meta-from"> 164 <div class="diff-title"> 165 <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong> 166 <# if ( 'undefined' !== typeof data.from ) { #> 167 <div class="author-card"> 168 {{{ data.from.attributes.author.avatar }}} 169 <div class="author-info"> 170 <span class="byline"><?php printf( __( 'Revision by %s' ), 171 '<span class="author-name">{{ data.to.attributes.author.name }}</span>' ); ?></span> 172 <span class="time-ago">{{ data.from.attributes.timeAgo }}</span> 173 <span class="date">({{ data.from.attributes.dateShort }})</span> 174 </div> 169 175 </div> 170 <div class="clear"></div>176 <# } #> 171 177 </div> 172 173 <div id="diff-header-to" class="diff-header"> 174 <div id="diff-title-to" class="diff-title"> 175 <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong> 176 <# if ( 'undefined' !== typeof data.to ) { #> 177 {{{ data.to.attributes.author.avatar }}} {{ data.to.attributes.author.name }}, 178 {{ data.to.attributes.timeAgo }} 179 ({{ data.to.attributes.dateShort }}) 180 <# } #> 181 </div> 182 183 <input type="button" class="restore-revision button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" /> 178 </div> 179 180 <div class="diff-meta diff-meta-to"> 181 <div class="diff-title"> 182 <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong> 183 <# if ( 'undefined' !== typeof data.to ) { #> 184 <div class="author-card"> 185 {{{ data.to.attributes.author.avatar }}} 186 <div class="author-info"> 187 <span class="byline"><?php printf( __( 'Revision by %s' ), 188 '<span class="author-name">{{ data.to.attributes.author.name }}</span>' ); ?></span> 189 <span class="time-ago">{{ data.to.attributes.timeAgo }}</span> 190 <span class="date">({{ data.to.attributes.dateShort }})</span> 191 </div> 192 <# } #> 193 <input 194 <# if ( data.to.attributes.current ) { #> 195 disabled="disabled" 196 <# } #> 197 type="button" class="restore-revision button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" /> 184 198 </div> 185 199 </div>
Note: See TracChangeset
for help on using the changeset viewer.