Ticket #24804: 24804.7.diff
File 24804.7.diff, 19.5 KB (added by , 11 years ago) |
---|
-
wp-admin/css/colors-classic.css
textarea.disabled { 164 164 color: #fff; 165 165 } 166 166 167 #diff-header,167 .revisions-meta, 168 168 .widget .widget-top, 169 169 .postbox h3, 170 170 .stuffbox h3, … … table.diff .diff-addedline ins { 1481 1481 background-color: #afa; 1482 1482 } 1483 1483 1484 #diff-header{1484 .revisions-meta { 1485 1485 border: 1px solid #d1e5ee; 1486 1486 } 1487 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%); 1495 } 1496 1488 1497 .revisions-tooltip, 1489 1498 .revisions-tooltip-arrow span { 1490 1499 border-color: #d1e5ee; 1491 1500 background-color: #fff; 1492 1501 } 1493 1502 1494 #diff-title-to strong{1495 color: #08a;1503 .revisions-tickmarks > div { 1504 border-color: #d1e5ee; 1496 1505 } 1497 1506 1498 1507 /* jQuery UI Slider */ 1499 1508 .wp-slider.ui-slider { 1500 1509 border-color: #d1e5ee; 1501 background: #eff8ff;1502 1510 } 1503 1511 1504 1512 .wp-slider .ui-slider-handle { … … table.diff .diff-addedline ins { 1507 1515 } 1508 1516 1509 1517 .wp-slider .ui-slider-handle { 1510 border-color: #ccc;1511 1518 border-color: #d0dfe9; 1512 1519 background: #eff8ff; 1513 1520 background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#fff)); -
wp-admin/css/colors-fresh.css
textarea.disabled { 164 164 color: #fff; 165 165 } 166 166 167 #diff-header,167 .revisions-meta, 168 168 .widget .widget-top, 169 169 .postbox h3, 170 170 .stuffbox h3, … … table.diff .diff-addedline ins { 1375 1375 background-color: #afa; 1376 1376 } 1377 1377 1378 #diff-header{1378 .revisions-meta { 1379 1379 border: 1px solid #dfdfdf; 1380 1380 } 1381 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%); 1389 } 1390 1382 1391 .revisions-tooltip, 1383 1392 .revisions-tooltip-arrow span { 1384 1393 border-color: #d7d7d7; … … table.diff .diff-addedline ins { 1389 1398 border-color: #aaa; 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 1402 1406 .wp-slider .ui-slider-handle { -
wp-admin/css/wp-admin-rtl.css
th.sorted a span { 976 976 padding: 9px 0 0 9px; 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; 981 989 } … … th.sorted a span { 984 992 float: right; 985 993 } 986 994 987 #diff-header {988 padding: 5px 5px 5px 200px;989 }990 991 995 .diff-title { 992 996 float: right; 993 997 } … … th.sorted a span { 1004 1008 margin-right: 5px; 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; 1010 1014 } … … th.sorted a span { 1027 1031 .revisions-tooltip { 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 1037 1041 .ie8 .revisions-tooltip { … … th.sorted a span { 1044 1048 margin-right: 35px; 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; 1049 1060 } 1050 1061 1062 .revisions-tooltip.flipped .revisions-tooltip-arrow > span { 1063 right: auto; 1064 left: 20px; 1065 } 1066 1051 1067 .revisions-tooltip img { 1052 1068 float: right; 1053 1069 margin: 2px 0 0 5px; -
wp-admin/css/wp-admin.css
td.plugin-title p { 3519 3519 .revisions-controls { 3520 3520 padding-top: 40px; 3521 3521 height: 100px; 3522 z-index: 1; 3522 3523 } 3523 3524 3524 3525 .revisions-controls input[type="checkbox"] { … … td.plugin-title p { 3527 3528 vertical-align: text-bottom; 3528 3529 } 3529 3530 3531 .revisions.pinned .revisions-controls { 3532 position: fixed; 3533 top: 0; 3534 padding-bottom: 10px; 3535 } 3536 3530 3537 .revisions-tickmarks { 3531 3538 position: relative; 3532 3539 margin: 0 auto; … … td.plugin-title p { 3571 3578 } 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; 3581 3589 -ms-transition: opacity 0.5s; … … td.plugin-title p { 3584 3592 filter: alpha(opacity=0); /* ie8 and earlier */ 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; 3589 3601 margin: 0 auto; … … td.plugin-title p { 3623 3635 } 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; 3628 3641 } 3629 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; 3652 } 3653 3630 3654 .revisions-previous, 3631 3655 .revisions-next { 3632 3656 position: relative; … … table.diff .diff-addedline ins { 3689 3713 text-decoration: none; 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; 3721 min-height: 32px; 3701 3722 } 3702 3723 3703 .diff-header { 3704 min-height: 35px; 3705 line-height: 35px; 3724 .diff-title strong { 3725 line-height: 32px; 3726 min-width: 60px; 3727 text-align: right; 3728 float: left; 3729 margin-right: 5px; 3706 3730 } 3707 3731 3708 .diff-title { 3732 .revisions-controls .author-card .avatar, 3733 .revisions-controls .author-card .author-info { 3709 3734 float: left; 3735 margin-left: 6px; 3736 margin-right: 6px; 3710 3737 } 3711 3738 3712 .diff-title strong { 3713 font-size: 14px; 3714 width: 60px; 3715 text-align: right; 3716 float: left; 3717 margin-right: 5px; 3739 .revisions-controls .author-card .byline { 3740 display: block; 3741 font-size: 12px; 3718 3742 } 3719 3743 3720 . diff-title img{3744 .revisions-controls .author-card .avatar { 3721 3745 vertical-align: middle; 3722 margin-left: 5px;3723 3746 } 3724 3747 3725 .diff-header > input.restore-revision { 3726 margin-left: 10px; 3748 .diff-meta input.restore-revision { 3749 float: right; 3750 margin-left: 6px; 3751 margin-right: 6px; 3752 margin-top: 4px; 3727 3753 } 3728 3754 3729 #diff-header-from {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 } 3737 3762 … … table.diff .diff-addedline ins { 3740 3765 bottom: 105px; 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;3755 3774 } 3756 3775 3757 .comparing-two-revisions .revisions-tooltip { 3758 bottom: 145px; 3776 .revisions-tooltip.flipped { 3777 margin-left: 0; 3778 margin-right: -70px; 3759 3779 } 3760 3780 3761 .revisions-tooltip img { 3762 float: left; 3763 margin: 2px 5px 0 0; 3764 padding: 0; 3765 vertical-align: middle; 3781 .revisions.pinned .revisions-tooltip { 3782 display: none !important; 3783 } 3784 3785 .comparing-two-revisions .revisions-tooltip { 3786 bottom: 145px; 3766 3787 } 3767 3788 3768 3789 .revisions-tooltip-arrow { … … table.diff .diff-addedline ins { 3776 3797 z-index: 10000; 3777 3798 } 3778 3799 3800 .revisions-tooltip.flipped .revisions-tooltip-arrow { 3801 margin-left: 0; 3802 margin-right: 35px; 3803 left: auto; 3804 right: 0; 3805 } 3806 3779 3807 .revisions-tooltip-arrow > span { 3780 3808 content: ""; 3781 3809 position: absolute; … … table.diff .diff-addedline ins { 3790 3818 tranform: rotate(45deg); 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 3799 3832 .revisions-tooltip, -
wp-admin/includes/revision.php
function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null 99 99 foreach ( $revisions as $revision ) { 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, 105 105 'action' => 'restore' ), 106 106 admin_url( 'revision.php' ) 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 ); 117 117 } -
wp-admin/js/revisions.js
window.wp = window.wp || {}; 531 531 className: 'revisions-controls', 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({ 536 538 model: this.model … … window.wp = window.wp || {}; 573 575 this.views.add( new revisions.view.Meta({ 574 576 model: this.model 575 577 }) ); 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 }, 576 609 610 setWidth: function() { 611 this.$el.css('width', this.$el.parent().width() + 'px'); 577 612 } 578 613 }); 579 614 … … window.wp = window.wp || {}; 592 627 tick = this.$('div:nth-of-type(' + index + ')'); 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 { 601 635 // Normal tick 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 }); 606 644 }, … … window.wp = window.wp || {}; 626 664 }, 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 632 670 prepare: function() { 633 671 return this.model.toJSON(); 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 }); 645 678 … … window.wp = window.wp || {}; 677 710 revisions.view.Tooltip = wp.Backbone.View.extend({ 678 711 className: 'revisions-tooltip', 679 712 template: wp.template('revisions-tooltip'), 680 direction: isRtl ? 'right' : 'left',681 713 682 714 initialize: function( options ) { 683 715 this.listenTo( this.model, 'change:offset', this.render ); … … window.wp = window.wp || {}; 690 722 }, 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 699 741 visible: function() { … … window.wp = window.wp || {}; 716 758 template: wp.template('revisions-buttons'), 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 723 765 initialize: function() { -
wp-admin/revision.php
require_once( './admin-header.php' ); 122 122 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> 141 144 <div class="revisions-tooltip-arrow"><span></span></div> … … require_once( './admin-header.php' ); 157 160 </script> 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">Edit by <span class="author-name">{{ data.from.attributes.author.name }}</span></span> 171 <span class="time-ago">{{ data.from.attributes.timeAgo }}</span> 172 <span class="date">({{ data.from.attributes.dateShort }})</span> 173 </div> 169 174 </div> 170 <div class="clear"></div>175 <# } #> 171 176 </div> 177 <div class="clear"></div> 178 </div> 172 179 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' )?>" /> 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">Edit by <span class="author-name">{{ data.to.attributes.author.name }}</span></span> 188 <span class="time-ago">{{ data.to.attributes.timeAgo }}</span> 189 <span class="date">({{ data.to.attributes.dateShort }})</span> 190 </div> 191 <# } #> 192 <input 193 <# if ( data.to.attributes.current ) { #> 194 disabled="disabled" 195 <# } #> 196 type="button" class="restore-revision button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" /> 184 197 </div> 185 198 </div> 186 199 </script>