Ticket #24736: 24736.16.patch
File 24736.16.patch, 22.6 KB (added by , 12 years ago) |
---|
-
wp-admin/css/colors-classic.css
table.diff .diff-addedline ins { 1486 1486 } 1487 1487 1488 1488 .revisions-tooltip, 1489 .revisions-tooltip-arrow :after{1489 .revisions-tooltip-arrow span { 1490 1490 border-color: #d1e5ee; 1491 1491 background-color: #fff; 1492 1492 } -
wp-admin/css/colors-fresh.css
table.diff .diff-addedline ins { 1380 1380 } 1381 1381 1382 1382 .revisions-tooltip, 1383 .revisions-tooltip-arrow :after{1383 .revisions-tooltip-arrow span { 1384 1384 border-color: #d7d7d7; 1385 1385 background-color: #fff; 1386 1386 } 1387 1387 1388 1389 .revisions-tickmarks {1390 background-color: #f7f7f7;1391 }1392 1393 1388 .revisions-tickmarks > div { 1394 1389 border-color: #aaa; 1395 1390 } -
wp-admin/css/ie.css
table.ie-fixed { 630 630 * html #adminmenu div.wp-menu-image { 631 631 height: 29px; 632 632 } 633 634 /* Revisions */ 635 .revisions-tooltip-arrow span { 636 left: 25px; 637 top: -24px; 638 filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE7 */ 639 } 640 641 .revisions-controls .revisions-tickmarks > div { 642 margin-right: -1px; 643 border-width: 0 0 0 0; 644 border-style: none; 645 } 646 No newline at end of file -
wp-admin/css/wp-admin-rtl.css
th.sorted a span { 954 954 /*------------------------------------------------------------------------------ 955 955 11.2 - Post Revisions 956 956 ------------------------------------------------------------------------------*/ 957 .wp-slider .ui-slider-handle. left-handle:before,958 .wp-slider .ui-slider-handle. right-handle:before {957 .wp-slider .ui-slider-handle.from-handle:before, 958 .wp-slider .ui-slider-handle.to-handle:before { 959 959 height: 8px; 960 960 width: 7px; 961 961 } 962 962 963 .wp-slider .ui-slider-handle. left-handle:before {963 .wp-slider .ui-slider-handle.from-handle:before { 964 964 background-position: -5px -10px; 965 965 left: 6px; 966 966 } 967 967 968 .wp-slider .ui-slider-handle. right-handle:before {968 .wp-slider .ui-slider-handle.to-handle:before { 969 969 background-position: -4px -29px; 970 970 left: 6px; 971 971 } … … th.sorted a span { 1025 1025 } 1026 1026 1027 1027 .revisions-tooltip { 1028 margin-right: -73px;1029 1028 margin-left: 0; 1029 margin-right: -70px; 1030 1030 -webkit-transition: right 15ms; 1031 1031 -moz-transition: right 15ms; 1032 1032 -ms-transition: right 15ms; … … th.sorted a span { 1040 1040 margin-right: 35px; 1041 1041 } 1042 1042 1043 .revisions-tooltip-image { 1043 .revisions-tooltip-arrow > span { 1044 right: 20px; 1045 } 1046 1047 .revisions-tooltip img { 1044 1048 float: right; 1045 1049 margin: 2px 0 0 5px; 1046 1050 } 1047 1051 1052 .revisions-tickmarks > div { 1053 float: right; 1054 border-width: 0 0 0 1px; 1055 } 1056 1048 1057 /*------------------------------------------------------------------------------ 1049 1058 11.3 - Featured Images 1050 1059 ------------------------------------------------------------------------------*/ -
wp-admin/css/wp-admin.css
td.plugin-title p { 3500 3500 /*------------------------------------------------------------------------------ 3501 3501 11.2 - Post Revisions 3502 3502 ------------------------------------------------------------------------------*/ 3503 body.revision-php {3504 overflow-y: scroll; /* Force a scrollbar, so centering doesn't jump */3505 }3506 3507 3503 .revisions-control-frame, 3508 3504 .revisions-diff-frame { 3509 3505 position: relative; … … body.revision-php { 3522 3518 3523 3519 .revisions-tickmarks { 3524 3520 position: relative; 3525 margin: 0 auto 0;3521 margin: 0 auto; 3526 3522 height: 0.8em; 3527 3523 z-index: 2; 3528 3524 top: 7px; 3529 width: 70%; 3525 width: 100%; 3526 padding: 0 15%; 3530 3527 -moz-box-sizing: border-box; 3531 3528 -webkit-box-sizing: border-box; 3532 -ms-box-sizing: border-box; /* ie8 only */3533 3529 box-sizing: border-box; 3534 3530 } 3535 3531 … … body.revision-php { 3539 3535 float: left; 3540 3536 z-index: 10002; 3541 3537 border-style: solid; 3542 border-width: 0 0 0 1px;3538 border-width: 0 1px 0 0; 3543 3539 -moz-box-sizing: border-box; 3544 3540 -webkit-box-sizing: border-box; 3545 -ms-box-sizing: border-box; /* ie8 only */3546 3541 box-sizing: border-box; 3547 3542 } 3548 3543 3549 .revisions-tickmarks > div: first-of-type{3550 border- left-width: 0;3544 .revisions-tickmarks > div:last-child { 3545 border-width: 0; 3551 3546 } 3552 3547 3553 3548 .comparing-two-revisions .revisions-controls { … … body.revision-php { 3577 3572 -ms-transition: opacity 0.5s; 3578 3573 -o-transition: opacity 0.5s; 3579 3574 transition: opacity 0.5s; 3575 filter: alpha(opacity=0); /* ie8 and earlier */ 3580 3576 } 3581 3577 3582 3578 .revisions .loading-indicator span.spinner { … … body.revision-php { 3587 3583 3588 3584 .revisions.loading .loading-indicator { 3589 3585 opacity: 1; 3586 filter: alpha(opacity=100); /* ie8 and earlier */ 3590 3587 } 3591 3588 3592 3589 .revisions .diff { … … body.revision-php { 3599 3596 3600 3597 .revisions.loading .diff { 3601 3598 opacity: 0.5; 3599 filter: alpha(opacity=50); /* ie8 and earlier */ 3602 3600 } 3603 3601 3604 3602 .revisions.diff-error .diff { … … body.revision-php { 3630 3628 3631 3629 .wp-slider { 3632 3630 width: 70%; 3633 margin: 0 auto 0;3631 margin: 0 auto; 3634 3632 top: -3px; 3635 3633 } 3636 3634 … … table.diff .diff-addedline ins { 3725 3723 .revisions-tooltip { 3726 3724 position: absolute; 3727 3725 bottom: 105px; 3728 margin-left: -69px; 3726 margin-right: 0; 3727 margin-left: -70px; 3729 3728 line-height: 28px; 3730 3729 z-index: 9999; 3731 3730 max-width: 350px; … … table.diff .diff-addedline ins { 3762 3761 z-index: 10000; 3763 3762 } 3764 3763 3765 .revisions-tooltip-arrow :after{3764 .revisions-tooltip-arrow > span { 3766 3765 content: ""; 3767 3766 position: absolute; 3768 3767 left: 20px; … … table.diff .diff-addedline ins { 3776 3775 tranform: rotate(45deg); 3777 3776 } 3778 3777 3778 .ie8 .revisions-tooltip-arrow > span { 3779 left: 14px; 3780 top: -25px; 3781 -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */ 3782 } 3783 3779 3784 .revisions-tooltip, 3780 .revisions-tooltip-arrow :after{3785 .revisions-tooltip-arrow > span { 3781 3786 border-width: 1px; 3782 3787 border-style: solid; 3783 3788 } … … div.revisions-controls > .wp-slider > .ui-slider-handle { 3817 3822 background: url(../images/arrows-pr.png) no-repeat -2px -47px; 3818 3823 } 3819 3824 3820 .wp-slider .ui-slider-handle. left-handle:before,3821 .wp-slider .ui-slider-handle. right-handle:before {3825 .wp-slider .ui-slider-handle.from-handle:before, 3826 .wp-slider .ui-slider-handle.to-handle:before { 3822 3827 height: 8px; 3823 3828 width: 7px; 3824 3829 } 3825 3830 3826 .wp-slider .ui-slider-handle. left-handle:before {3831 .wp-slider .ui-slider-handle.from-handle:before { 3827 3832 background-position: -5px -84px; 3828 3833 left: 7px; 3829 3834 } 3830 3835 3831 .wp-slider .ui-slider-handle. right-handle:before {3836 .wp-slider .ui-slider-handle.to-handle:before { 3832 3837 background-position: -4px -65px; 3833 3838 left: 5px; 3834 3839 } -
wp-admin/js/revisions.js
window.wp = window.wp || {}; 16 16 console.log.apply( console, arguments ); 17 17 }; 18 18 19 // Handy functions to help with positioning 20 $.fn.allOffsets = function() { 21 var offset = this.offset() || {top: 0, left: 0}, win = $(window); 22 return _.extend( offset, { 23 right: win.width() - offset.left - this.outerWidth(), 24 bottom: win.height() - offset.top - this.outerHeight() 25 }); 26 }; 27 28 $.fn.allPositions = function() { 29 var position = this.position() || {top: 0, left: 0}, parent = this.parent(); 30 return _.extend( position, { 31 right: parent.outerWidth() - position.left - this.outerWidth(), 32 bottom: parent.outerHeight() - position.top - this.outerHeight() 33 }); 34 }; 35 19 36 // wp_localize_script transforms top-level numbers into strings. Undo that. 20 37 if ( revisions.settings.to ) 21 38 revisions.settings.to = parseInt( revisions.settings.to, 10 ); … … window.wp = window.wp || {}; 125 142 revisions.model.Tooltip = Backbone.Model.extend({ 126 143 defaults: { 127 144 revision: null, 145 offset: {}, 128 146 hovering: false, // Whether the mouse is hovering 129 147 scrubbing: false // Whether the mouse is scrubbing 130 148 }, 131 149 132 150 initialize: function( options ) { 151 this.frame = options.frame; 133 152 this.revisions = options.revisions; 134 153 this.slider = options.slider; 135 154 136 155 this.listenTo( this.slider, 'hovered:revision', this.updateRevision ); 137 156 this.listenTo( this.slider, 'change:hovering', this.setHovering ); 138 157 this.listenTo( this.slider, 'change:scrubbing', this.setScrubbing ); 158 159 this.set({ revision: this.frame.diff() }); 139 160 }, 140 161 162 141 163 updateRevision: function( revision ) { 142 164 this.set({ revision: revision }); 143 165 }, … … window.wp = window.wp || {}; 475 497 render: function() { 476 498 wp.Backbone.View.prototype.render.apply( this, arguments ); 477 499 500 $('html').css( 'overflow-y', 'scroll' ); 478 501 $('#wpbody-content .wrap').append( this.el ); 479 502 this.updateCompareTwoMode(); 480 503 this.renderDiff( this.model.diff() ); … … window.wp = window.wp || {}; 524 547 revisions: this.model.revisions 525 548 }); 526 549 550 // Prep the tooltip model 551 var tooltip = new revisions.model.Tooltip({ 552 frame: this.model, 553 revisions: this.model.revisions, 554 slider: slider 555 }); 556 527 557 // Add the tooltip view 528 558 this.views.add( new revisions.view.Tooltip({ 529 model: new revisions.model.Tooltip({ 530 revisions: this.model.revisions, 531 slider: slider 532 }) 559 model: tooltip 533 560 }) ); 534 561 535 562 // Add the tickmarks view 536 563 this.views.add( new revisions.view.Tickmarks({ 537 model: t his.model564 model: tooltip 538 565 }) ); 539 566 540 567 // Add the slider view … … window.wp = window.wp || {}; 554 581 revisions.view.Tickmarks = wp.Backbone.View.extend({ 555 582 className: 'revisions-tickmarks', 556 583 584 initialize: function() { 585 this.listenTo( this.model, 'change:revision', this.reportTickPosition ); 586 }, 587 588 reportTickPosition: function( model, revision ) { 589 var elWidth, offset, tick, index = this.model.revisions.indexOf( revision ); 590 if ( index === this.model.revisions.length - 1 ) { 591 // Last one 592 tick = this.$('div:nth-of-type(' + index + ')'); 593 offset = tick.allPositions(); 594 elWidth = tick.outerWidth(); 595 // adjust 596 _.extend( offset, { 597 right: offset.right + elWidth + 1, 598 left: offset.left + elWidth + 1 599 }); 600 } else { 601 // Normal tick 602 tick = this.$('div:nth-of-type(' + (index + 1) + ')'); 603 offset = tick.allPositions(); 604 } 605 this.model.set({ offset: offset }); 606 }, 607 557 608 ready: function() { 558 609 var tickCount, tickWidth; 559 610 tickCount = this.model.revisions.length - 1; 560 611 tickWidth = 1 / tickCount; 561 612 562 613 _(tickCount).times( function(){ this.$el.append( '<div></div>' ); }, this ); 614 563 615 this.$('div').css( 'width', ( 100 * tickWidth ) + '%' ); 564 616 } 565 617 }); … … window.wp = window.wp || {}; 625 677 revisions.view.Tooltip = wp.Backbone.View.extend({ 626 678 className: 'revisions-tooltip', 627 679 template: wp.template('revisions-tooltip'), 680 direction: isRtl ? 'right' : 'left', 628 681 629 682 initialize: function( options ) { 630 this.listenTo( this.model, 'change: revision', this.render );683 this.listenTo( this.model, 'change:offset', this.render ); 631 684 this.listenTo( this.model, 'change:hovering', this.toggleVisibility ); 632 685 this.listenTo( this.model, 'change:scrubbing', this.toggleVisibility ); 633 686 }, 634 687 688 prepare: function() { 689 return this.model.get('revision').toJSON(); 690 }, 691 692 render: function() { 693 var css = {}; 694 wp.Backbone.View.prototype.render.apply( this, arguments ); 695 css[this.direction] = this.model.get('offset')[this.direction] + 'px'; 696 this.$el.css( css ); 697 }, 698 635 699 visible: function() { 636 700 return this.model.get( 'scrubbing' ) || this.model.get( 'hovering' ); 637 701 }, … … window.wp = window.wp || {}; 642 706 else 643 707 this.$el.stop().fadeTo( this.el.style.opacity * 300, 0, function(){ $(this).hide(); } ); 644 708 return; 645 },646 647 render: function() {648 var offset;649 // Check if a revision exists.650 if ( _.isNull( this.model.get('revision') ) )651 return;652 653 this.$el.html( this.template( this.model.get('revision').toJSON() ) );654 655 // Set the position.656 offset = this.model.revisions.indexOf( this.model.get('revision') ) / ( this.model.revisions.length - 1 );657 // 15% to get us to the start of the slider658 // 0.7 to convert the slider-relative percentage to a page-relative percentage659 // 100 to convert to a percentage660 offset = 15 + (0.7 * offset * 100 ); // Now in a percentage661 this.$el.css( isRtl ? 'right' : 'left', offset + '%' );662 709 } 663 710 }); 664 711 … … window.wp = window.wp || {}; 681 728 this.disabledButtonCheck(); 682 729 }, 683 730 684 // Go to a specific model index, taking into account RTL mode.731 // Go to a specific model index 685 732 gotoModel: function( toIndex ) { 686 733 var attributes = { 687 to: this.model.revisions.at( isRtl ? this.model.revisions.length - toIndex - 1 : toIndex ) // Reverse directions for RTL.734 to: this.model.revisions.at( toIndex ) 688 735 }; 689 736 // If we're at the first revision, unset 'from'. 690 if ( isRtl ? this.model.revisions.length - toIndex - 1 : toIndex ) // Reverse directions for RTL691 attributes.from = this.model.revisions.at( isRtl ? this.model.revisions.length - toIndex - 2 :toIndex - 1 );737 if ( toIndex ) 738 attributes.from = this.model.revisions.at( toIndex - 1 ); 692 739 else 693 740 this.model.unset('from', { silent: true }); 694 741 695 742 this.model.set( attributes ); 696 743 }, 697 744 698 // Go to the 'next' revision , direction takes into account RTL mode.745 // Go to the 'next' revision 699 746 nextRevision: function() { 700 var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get('to') ) - 1 : this.model.revisions.indexOf( this.model.get('to') ); 701 toIndex = isRtl ? toIndex - 1 : toIndex + 1; 747 var toIndex = this.model.revisions.indexOf( this.model.get('to') ) + 1; 702 748 this.gotoModel( toIndex ); 703 749 }, 704 750 705 // Go to the 'previous' revision , direction takes into account RTL mode.751 // Go to the 'previous' revision 706 752 previousRevision: function() { 707 var toIndex = isRtl ? this.model.revisions.length - this.model.revisions.indexOf( this.model.get('to') ) - 1 : this.model.revisions.indexOf( this.model.get('to') ); 708 toIndex = isRtl ? toIndex + 1 : toIndex - 1; 753 var toIndex = this.model.revisions.indexOf( this.model.get('to') ) - 1; 709 754 this.gotoModel( toIndex ); 710 755 }, 711 756 … … window.wp = window.wp || {}; 729 774 // The slider view. 730 775 revisions.view.Slider = wp.Backbone.View.extend({ 731 776 className: 'wp-slider', 777 direction: isRtl ? 'right' : 'left', 732 778 733 779 events: { 734 780 'mousemove' : 'mouseMove' … … window.wp = window.wp || {}; 757 803 758 804 mouseMove: function( e ) { 759 805 var zoneCount = this.model.revisions.length - 1, // One fewer zone than models 760 slider Left = this.$el.offset().left, // Leftedge of slider806 sliderFrom = this.$el.allOffsets()[this.direction], // "From" edge of slider 761 807 sliderWidth = this.$el.width(), // Width of slider 762 808 tickWidth = sliderWidth / zoneCount, // Calculated width of zone 763 actualX = e.clientX - sliderLeft, // Offset of mouse position in slider 764 currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 ) ) / tickWidth ); // Calculate the model index 765 766 // Reverse direction in RTL mode. 767 if ( isRtl ) 768 currentModelIndex = this.model.revisions.length - currentModelIndex - 1; 809 actualX = isRtl? $(window).width() - e.pageX : e.pageX; // Flipped for RTL - sliderFrom; 810 actualX = actualX - sliderFrom; // Offset of mouse position in slider 811 var currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 ) ) / tickWidth ); // Calculate the model index 769 812 770 813 // Ensure sane value for currentModelIndex. 771 814 if ( currentModelIndex < 0 ) … … window.wp = window.wp || {}; 773 816 else if ( currentModelIndex >= this.model.revisions.length ) 774 817 currentModelIndex = this.model.revisions.length - 1; 775 818 776 // Update the tooltip mode l819 // Update the tooltip mode 777 820 this.model.set({ hoveredRevision: this.model.revisions.at( currentModelIndex ) }); 778 821 }, 779 822 … … window.wp = window.wp || {}; 792 835 if ( this.model.get('compareTwoMode') ) { 793 836 // in RTL mode the 'left handle' is the second in the slider, 'right' is first 794 837 handles.first() 795 .toggleClass( ' right-handle', !! isRtl )796 .toggleClass( ' left-handle', ! isRtl );838 .toggleClass( 'to-handle', !! isRtl ) 839 .toggleClass( 'from-handle', ! isRtl ); 797 840 handles.last() 798 .toggleClass( ' left-handle', !! isRtl )799 .toggleClass( ' right-handle', ! isRtl );841 .toggleClass( 'from-handle', !! isRtl ) 842 .toggleClass( 'to-handle', ! isRtl ); 800 843 } else { 801 handles.removeClass(' left-handle right-handle');844 handles.removeClass('from-handle to-handle'); 802 845 } 803 846 }, 804 847 805 getSliderPosition: function( ui ){806 return isRtl ? this.model.revisions.length - ui.value - 1 : ui.value;807 },808 809 848 start: function( event, ui ) { 810 849 this.model.set({ scrubbing: true }); 811 850 812 851 // Track the mouse position to enable smooth dragging, 813 852 // overrides default jQuery UI step behavior. 814 853 $( window ).on( 'mousemove.wp.revisions', { view: this }, function( e ) { 815 var view = e.data.view, 816 leftDragBoundary = view.$el.offset().left, // Initial left boundary 817 sliderOffset = leftDragBoundary, 818 sliderRightEdge = leftDragBoundary + view.$el.width(), 819 rightDragBoundary = sliderRightEdge, // Initial right boundary 820 leftDragReset = 0, // Initial left drag reset 821 rightDragReset = sliderRightEdge - sliderOffset; // Initial right drag reset 854 var view = e.data.view, 855 leftDragBoundary = view.$el.offset().left, 856 sliderOffset = leftDragBoundary, 857 sliderRightEdge = leftDragBoundary + view.$el.width(), 858 rightDragBoundary = sliderRightEdge, 859 leftDragReset = '0', 860 rightDragReset = '100%', 861 handle = $( ui.handle ); 822 862 823 863 // In two handle mode, ensure handles can't be dragged past each other. 824 864 // Adjust left/right boundaries and reset points. 825 865 if ( view.model.get('compareTwoMode') ) { 826 var rightHandle = $( ui.handle ).parent().find('.right-handle'), 827 leftHandle = $( ui.handle ).parent().find('.left-handle'); 828 829 if ( $( ui.handle ).hasClass('left-handle') ) { 830 // Dragging the left handle, boundary is right handle. 831 // RTL mode calculations reverse directions. 832 if ( isRtl ) { 833 leftDragBoundary = rightHandle.offset().left + rightHandle.width(); 834 leftDragReset = leftDragBoundary - sliderOffset; 835 } else { 836 rightDragBoundary = rightHandle.offset().left; 837 rightDragReset = rightDragBoundary - sliderOffset; 838 } 839 } else { 840 // Dragging the right handle, boundary is the left handle. 841 // RTL mode calculations reverse directions. 842 if ( isRtl ) { 843 rightDragBoundary = leftHandle.offset().left; 844 rightDragReset = rightDragBoundary - sliderOffset; 845 } else { 846 leftDragBoundary = leftHandle.offset().left + leftHandle.width() ; 847 leftDragReset = leftDragBoundary - sliderOffset; 848 } 866 var handles = handle.parent().find('.ui-slider-handle'); 867 if ( handle.is( handles.first() ) ) { // We're the left handle 868 rightDragBoundary = handles.last().offset().left; 869 rightDragReset = rightDragBoundary - sliderOffset; 870 } else { // We're the right handle 871 leftDragBoundary = handles.first().offset().left + handles.first().width(); 872 leftDragReset = leftDragBoundary - sliderOffset; 849 873 } 850 874 } 851 875 852 876 // Follow mouse movements, as long as handle remains inside slider. 853 if ( e. clientX < leftDragBoundary ) {854 $( ui.handle ).css( 'left', leftDragReset ); // Mouse to left of slider.855 } else if ( e. clientX > rightDragBoundary ) {856 $( ui.handle ).css( 'left', rightDragReset ); // Mouse to right of slider.877 if ( e.pageX < leftDragBoundary ) { 878 handle.css( 'left', leftDragReset ); // Mouse to left of slider. 879 } else if ( e.pageX > rightDragBoundary ) { 880 handle.css( 'left', rightDragReset ); // Mouse to right of slider. 857 881 } else { 858 $( ui.handle ).css( 'left', e.clientX - sliderOffset ); // Mouse in slider.882 handle.css( 'left', e.pageX - sliderOffset ); // Mouse in slider. 859 883 } 860 884 } ); 861 885 }, 862 886 887 getPosition: function( position ) { 888 return isRtl ? this.model.revisions.length - position - 1: position; 889 }, 890 863 891 // Responds to slide events 864 892 slide: function( event, ui ) { 865 var attributes, movedRevision , sliderPosition;893 var attributes, movedRevision; 866 894 // Compare two revisions mode 867 895 if ( this.model.get('compareTwoMode') ) { 868 896 // Prevent sliders from occupying same spot 869 897 if ( ui.values[1] === ui.values[0] ) 870 898 return false; 871 899 if ( isRtl ) 900 ui.values.reverse(); 872 901 attributes = { 873 to: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[0] - 1 : ui.values[1]),874 from: this.model.revisions.at( isRtl ? this.model.revisions.length - ui.values[1] - 1 : ui.values[0])902 from: this.model.revisions.at( this.getPosition( ui.values[0] ) ), 903 to: this.model.revisions.at( this.getPosition( ui.values[1] ) ) 875 904 }; 876 if ( isRtl )877 movedRevision = ui.value === ui.values[1] ? attributes.from : attributes.to;878 else879 movedRevision = ui.value === ui.values[0] ? attributes.from : attributes.to;880 905 } else { 881 sliderPosition = this.getSliderPosition( ui );882 906 attributes = { 883 to: this.model.revisions.at( sliderPosition)907 to: this.model.revisions.at( this.getPosition( ui.value ) ) 884 908 }; 885 movedRevision = attributes.to;886 909 // If we're at the first revision, unset 'from'. 887 if ( sliderPosition ) // Reverse directions for RTL.888 attributes.from = this.model.revisions.at( sliderPosition - 1);910 if ( this.getPosition( ui.value ) > 0 ) 911 attributes.from = this.model.revisions.at( this.getPosition( ui.value ) - 1 ); 889 912 else 890 913 attributes.from = undefined; 891 914 } 915 movedRevision = this.model.revisions.at( this.getPosition( ui.value ) ); 892 916 893 917 // If we are scrubbing, a scrub to a revision is considered a hover 894 918 if ( this.model.get('scrubbing') ) -
wp-admin/revision.php
require_once( './admin-header.php' ); 138 138 ({{ data.dateShort }}) 139 139 <# } #> 140 140 </div> 141 <div class="revisions-tooltip-arrow">< /div>141 <div class="revisions-tooltip-arrow"><span></span></div> 142 142 </script> 143 143 144 144 <script id="tmpl-revisions-checkbox" type="text/html">