<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[24761] trunk/wp-admin: Revisions: Pinned controls, layout tweaks, copy tweaks, misc.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/24761">24761</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-07-22 05:05:45 +0000 (Mon, 22 Jul 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Revisions: Pinned controls, layout tweaks, copy tweaks, misc.

* When you scroll down the diff view, the controls will pin to the top.
* The revisions meta view was cleaned up. Copy changes.
* Loading indicator in the center of the screen (so it follows as you scroll).
* Tooltips "flip" when you cross the center line, so that they don't hit the container edge and wrap for later revisions.
* The "Restore" button's inactive state is handled on render, instead of after.
* Make sure we always have a current revision, even if the timestamp doesn't work out on the most recent one.

See <a href="http://core.trac.wordpress.org/ticket/24804">#24804</a>. Props markjaquith, nacin, ocean90, aaroncampbell.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscolorsclassiccss">trunk/wp-admin/css/colors-classic.css</a></li>
<li><a href="#trunkwpadmincsscolorsfreshcss">trunk/wp-admin/css/colors-fresh.css</a></li>
<li><a href="#trunkwpadmincsswpadminrtlcss">trunk/wp-admin/css/wp-admin-rtl.css</a></li>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadminincludesrevisionphp">trunk/wp-admin/includes/revision.php</a></li>
<li><a href="#trunkwpadminjsrevisionsjs">trunk/wp-admin/js/revisions.js</a></li>
<li><a href="#trunkwpadminrevisionphp">trunk/wp-admin/revision.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscolorsclassiccss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-classic.css (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-classic.css    2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/css/colors-classic.css       2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">  color: #fff;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header,
</del><ins>+.revisions-meta,
</ins><span class="cx"> .widget .widget-top,
</span><span class="cx"> .postbox h3,
</span><span class="cx"> .stuffbox h3,
</span><span class="lines">@@ -1481,24 +1481,32 @@
</span><span class="cx">  background-color: #afa;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header {
</del><ins>+.revisions-meta {
</ins><span class="cx">   border: 1px solid #d1e5ee;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-controls {
+       background: #fff;
+       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)));
+       background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:    -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:      -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+}
+
</ins><span class="cx"> .revisions-tooltip,
</span><span class="cx"> .revisions-tooltip-arrow span {
</span><span class="cx">  border-color: #d1e5ee;
</span><span class="cx">  background-color: #fff;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-title-to strong {
-       color: #08a;
</del><ins>+.revisions-tickmarks > div {
+       border-color: #d1e5ee;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /* jQuery UI Slider */
</span><span class="cx"> .wp-slider.ui-slider {
</span><span class="cx">  border-color: #d1e5ee;
</span><del>-       background: #eff8ff;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .wp-slider .ui-slider-handle {
</span><span class="lines">@@ -1507,7 +1515,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .wp-slider .ui-slider-handle {
</span><del>-       border-color: #ccc;
</del><span class="cx">   border-color: #d0dfe9;
</span><span class="cx">  background: #eff8ff;
</span><span class="cx">  background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#fff));
</span></span></pre></div>
<a id="trunkwpadmincsscolorsfreshcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/colors-fresh.css (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/colors-fresh.css      2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/css/colors-fresh.css 2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">  color: #fff;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header,
</del><ins>+.revisions-meta,
</ins><span class="cx"> .widget .widget-top,
</span><span class="cx"> .postbox h3,
</span><span class="cx"> .stuffbox h3,
</span><span class="lines">@@ -1375,10 +1375,19 @@
</span><span class="cx">  background-color: #afa;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header {
</del><ins>+.revisions-meta {
</ins><span class="cx">   border: 1px solid #dfdfdf;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-controls {
+       background: #fff;
+       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)));
+       background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:    -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:      -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+}
+
</ins><span class="cx"> .revisions-tooltip,
</span><span class="cx"> .revisions-tooltip-arrow span {
</span><span class="cx">  border-color: #d7d7d7;
</span><span class="lines">@@ -1389,14 +1398,9 @@
</span><span class="cx">  border-color: #aaa;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-title-to strong {
-       color: #08a;
-}
-
</del><span class="cx"> /* jQuery UI Slider */
</span><span class="cx"> .wp-slider.ui-slider {
</span><span class="cx">  border-color: #d7d7d7;
</span><del>-       background: transparent;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .wp-slider .ui-slider-handle {
</span></span></pre></div>
<a id="trunkwpadmincsswpadminrtlcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin-rtl.css (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin-rtl.css      2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/css/wp-admin-rtl.css 2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -976,6 +976,14 @@
</span><span class="cx">  padding: 9px 0 0 9px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions .loading-indicator {
+       margin-right: -90px;
+}
+
+body.folded .revisions .loading-indicator {
+       margin-right: -32px;
+}
+
</ins><span class="cx"> .revisions-next {
</span><span class="cx">  float: left;
</span><span class="cx"> }
</span><span class="lines">@@ -984,10 +992,6 @@
</span><span class="cx">  float: right;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header {
-       padding: 5px 5px 5px 200px;
-}
-
</del><span class="cx"> .diff-title {
</span><span class="cx">  float: right;
</span><span class="cx"> }
</span><span class="lines">@@ -1004,7 +1008,7 @@
</span><span class="cx">  margin-right: 5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-header > input.restore-revision {
</del><ins>+.diff-meta > input.restore-revision {
</ins><span class="cx">   margin-left: 0;
</span><span class="cx">  margin-right: 10px;
</span><span class="cx"> }
</span><span class="lines">@@ -1027,13 +1031,13 @@
</span><span class="cx"> .revisions-tooltip {
</span><span class="cx">  margin-left: 0;
</span><span class="cx">  margin-right: -70px;
</span><del>-       -webkit-transition: right 15ms;
-       -moz-transition:    right 15ms;
-       -ms-transition:     right 15ms;
-       -o-transition:      right 15ms;
-       transition:         right 15ms;
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped {
+       margin-right: 0;
+       margin-left: -70px;
+}
+
</ins><span class="cx"> .ie8 .revisions-tooltip {
</span><span class="cx">  margin-right: -75px;
</span><span class="cx"> }
</span><span class="lines">@@ -1044,10 +1048,22 @@
</span><span class="cx">  margin-right: 35px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+       margin-right: 0;
+       margin-left: 35px;
+       right: auto;
+       left: 0;
+}
+
</ins><span class="cx"> .revisions-tooltip-arrow > span {
</span><span class="cx">  right: 20px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+       right: auto;
+       left: 20px;
+}
+
</ins><span class="cx"> .revisions-tooltip img {
</span><span class="cx">  float: right;
</span><span class="cx">  margin: 2px 0 0 5px;
</span></span></pre></div>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css  2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/css/wp-admin.css     2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -3519,6 +3519,7 @@
</span><span class="cx"> .revisions-controls {
</span><span class="cx">  padding-top: 40px;
</span><span class="cx">  height: 100px;
</span><ins>+       z-index: 1;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .revisions-controls input[type="checkbox"] {
</span><span class="lines">@@ -3527,6 +3528,12 @@
</span><span class="cx">  vertical-align: text-bottom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions.pinned .revisions-controls {
+       position: fixed;
+       top: 0;
+       padding-bottom: 10px;
+}
+
</ins><span class="cx"> .revisions-tickmarks {
</span><span class="cx">  position: relative;
</span><span class="cx">  margin: 0 auto;
</span><span class="lines">@@ -3571,11 +3578,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .revisions .loading-indicator {
</span><del>-       position: absolute;
</del><ins>+        position: fixed;
</ins><span class="cx">   vertical-align: middle;
</span><span class="cx">  opacity: 0;
</span><span class="cx">  width: 100%;
</span><del>-       top: 3em;
</del><ins>+        top: 50%;
+       margin-left: -90px;
</ins><span class="cx">   -webkit-transition: opacity 0.5s;
</span><span class="cx">  -moz-transition:    opacity 0.5s;
</span><span class="cx">  -ms-transition:     opacity 0.5s;
</span><span class="lines">@@ -3584,6 +3592,10 @@
</span><span class="cx">  filter: alpha(opacity=0); /* ie8 and earlier */
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+body.folded .revisions .loading-indicator {
+       margin-left: -32px;
+}
+
</ins><span class="cx"> .revisions .loading-indicator span.spinner {
</span><span class="cx">  display: block;
</span><span class="cx">  margin: 0 auto;
</span><span class="lines">@@ -3623,10 +3635,22 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .comparing-two-revisions .revisions-previous,
</span><del>-.comparing-two-revisions .revisions-next {
</del><ins>+.comparing-two-revisions .revisions-next,
+.revisions-meta .diff-meta-to strong {
</ins><span class="cx">   display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-controls .author-card .date {
+       color: #777;
+}
+.revisions-controls .author-card .author-name {
+       font-weight: bold;
+}
+
+.comparing-two-revisions .diff-meta-to strong {
+       display: block;
+}
+
</ins><span class="cx"> .revisions-previous,
</span><span class="cx"> .revisions-next {
</span><span class="cx">  position: relative;
</span><span class="lines">@@ -3689,49 +3713,50 @@
</span><span class="cx">  text-decoration: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-title-to strong {
-       display: inline;
-}
-
-#diff-header {
</del><ins>+.diff-meta {
</ins><span class="cx">   -webkit-border-radius: 3px;
</span><span class="cx">  border-radius: 3px;
</span><span class="cx">  padding: 5px;
</span><span class="cx">  clear: both;
</span><ins>+       min-height: 32px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-header {
-       min-height: 35px;
-       line-height: 35px;
</del><ins>+.diff-title strong {
+       line-height: 32px;
+       min-width: 60px;
+       text-align: right;
+       float: left;
+       margin-right: 5px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-title {
</del><ins>+.revisions-controls .author-card .avatar,
+.revisions-controls .author-card .author-info {
</ins><span class="cx">   float: left;
</span><ins>+       margin-left: 6px;
+       margin-right: 6px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-title strong {
-       font-size: 14px;
-       width: 60px;
-       text-align: right;
-       float: left;
-       margin-right: 5px;
</del><ins>+.revisions-controls .author-card .byline {
+       display: block;
+       font-size: 12px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-title img {
</del><ins>+.revisions-controls .author-card .avatar {
</ins><span class="cx">   vertical-align: middle;
</span><del>-       margin-left: 5px;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-.diff-header > input.restore-revision {
-       margin-left: 10px;
</del><ins>+.diff-meta input.restore-revision {
+       float: right;
+       margin-left: 6px;
+       margin-right: 6px;
+       margin-top: 4px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#diff-header-from {
</del><ins>+.diff-meta-from {
</ins><span class="cx">   display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.comparing-two-revisions #diff-title-from,
-.comparing-two-revisions #diff-header-from {
</del><ins>+.comparing-two-revisions .diff-meta-from {
</ins><span class="cx">   display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3740,31 +3765,27 @@
</span><span class="cx">  bottom: 105px;
</span><span class="cx">  margin-right: 0;
</span><span class="cx">  margin-left: -70px;
</span><del>-       line-height: 28px;
</del><span class="cx">   z-index: 1;
</span><span class="cx">  max-width: 350px;
</span><span class="cx">  min-width: 130px;
</span><del>-       padding: 4px;
</del><ins>+        padding: 8px 4px;
</ins><span class="cx">   display: none;
</span><span class="cx">  opacity: 0;
</span><del>-       -webkit-transition: left 15ms;
-       -moz-transition:    left 15ms;
-       -ms-transition:     left 15ms;
-       -o-transition:      left 15ms;
-       transition:         left 15ms;
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped {
+       margin-left: 0;
+       margin-right: -70px;
+}
+
+.revisions.pinned .revisions-tooltip {
+       display: none !important;
+}
+
</ins><span class="cx"> .comparing-two-revisions .revisions-tooltip {
</span><span class="cx">  bottom: 145px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.revisions-tooltip img {
-       float: left;
-       margin: 2px 5px 0 0;
-       padding: 0;
-       vertical-align: middle;
-}
-
</del><span class="cx"> .revisions-tooltip-arrow {
</span><span class="cx">  width: 70px;
</span><span class="cx">  height: 15px;
</span><span class="lines">@@ -3776,6 +3797,13 @@
</span><span class="cx">  z-index: 10000;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+       margin-left: 0;
+       margin-right: 35px;
+       left: auto;
+       right: 0;
+}
+
</ins><span class="cx"> .revisions-tooltip-arrow > span {
</span><span class="cx">  content: "";
</span><span class="cx">  position: absolute;
</span><span class="lines">@@ -3790,10 +3818,15 @@
</span><span class="cx">  tranform: rotate(45deg);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+       left: auto;
+       right: 20px;
+}
+
</ins><span class="cx"> .ie8 .revisions-tooltip-arrow > span {
</span><span class="cx">  left: 14px;
</span><span class="cx">  top: -25px;
</span><del>-       -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */
</del><ins>+        -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .revisions-tooltip,
</span></span></pre></div>
<a id="trunkwpadminincludesrevisionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/revision.php (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/revision.php     2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/includes/revision.php        2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -99,19 +99,19 @@
</span><span class="cx">  foreach ( $revisions as $revision ) {
</span><span class="cx">          $modified = strtotime( $revision->post_modified );
</span><span class="cx">          $modified_gmt = strtotime( $revision->post_modified_gmt );
</span><del>-               $restore_link = wp_nonce_url(
</del><ins>+                $restore_link = str_replace( '&amp;', '&', wp_nonce_url(
</ins><span class="cx">                   add_query_arg(
</span><span class="cx">                          array( 'revision' => $revision->ID,
</span><span class="cx">                                  'action' => 'restore' ),
</span><span class="cx">                                  admin_url( 'revision.php' )
</span><span class="cx">                  ),
</span><span class="cx">                  "restore-post_{$revision->ID}"
</span><del>-               );
</del><ins>+                ) );
</ins><span class="cx"> 
</span><span class="cx">          if ( ! isset( $authors[ $revision->post_author ] ) ) {
</span><span class="cx">                  $authors[ $revision->post_author ] = array(
</span><span class="cx">                          'id' => (int) $revision->post_author,
</span><del>-                               'avatar' => $show_avatars ? get_avatar( $revision->post_author, 24 ) : '',
</del><ins>+                                'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',
</ins><span class="cx">                           'name' => get_the_author_meta( 'display_name', $revision->post_author ),
</span><span class="cx">                  );
</span><span class="cx">          }
</span><span class="lines">@@ -142,6 +142,11 @@
</span><span class="cx">          );
</span><span class="cx">  }
</span><span class="cx"> 
</span><ins>+       // If a post has been saved since the last revision (no revisioned fields were changed)
+       // we may not have a "current" revision. Mark the latest revision as "current".
+       if ( empty( $current_id ) )
+               $revisions[ $revision->ID ]['current'] = true;
+
</ins><span class="cx">   // Now, grab the initial diff
</span><span class="cx">  $compare_two_mode = is_numeric( $from );
</span><span class="cx">  if ( ! $compare_two_mode ) {
</span></span></pre></div>
<a id="trunkwpadminjsrevisionsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/revisions.js (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/revisions.js   2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/js/revisions.js      2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -531,6 +531,8 @@
</span><span class="cx">          className: 'revisions-controls',
</span><span class="cx"> 
</span><span class="cx">          initialize: function() {
</span><ins>+                       _.bindAll( this, 'setWidth' );
+
</ins><span class="cx">                   // Add the button view
</span><span class="cx">                  this.views.add( new revisions.view.Buttons({
</span><span class="cx">                          model: this.model
</span><span class="lines">@@ -573,7 +575,40 @@
</span><span class="cx">                  this.views.add( new revisions.view.Meta({
</span><span class="cx">                          model: this.model
</span><span class="cx">                  }) );
</span><ins>+               },
</ins><span class="cx"> 
</span><ins>+               ready: function() {
+                       this.top = this.$el.offset().top;
+                       this.window = $(window);
+                       this.window.on( 'scroll.wp.revisions', {controls: this}, function(e) {
+                               var controls = e.data.controls;
+                               var container = controls.$el.parent();
+                               var scrolled = controls.window.scrollTop();
+                               var frame = controls.views.parent;
+
+                               if ( scrolled >= controls.top ) {
+                                       if ( ! frame.$el.hasClass('pinned') ) {
+                                               controls.setWidth();
+                                               container.css('height', container.height() + 'px' );
+                                               controls.window.on('resize.wp.revisions.pinning click.wp.revisions.pinning', {controls: controls}, function(e) {
+                                                       e.data.controls.setWidth();
+                                               });
+                                       }
+                                       frame.$el.addClass('pinned');
+                               } else if ( frame.$el.hasClass('pinned') ) {
+                                       controls.window.off('.wp.revisions.pinning');
+                                       controls.$el.css('width', 'auto');
+                                       frame.$el.removeClass('pinned');
+                                       container.css('height', 'auto');
+                                       controls.top = controls.$el.offset().top;
+                               } else {
+                                       controls.top = controls.$el.offset().top;
+                               }
+                       });
+               },
+
+               setWidth: function() {
+                       this.$el.css('width', this.$el.parent().width() + 'px');
</ins><span class="cx">           }
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="lines">@@ -592,15 +627,18 @@
</span><span class="cx">                          tick = this.$('div:nth-of-type(' + index + ')');
</span><span class="cx">                          offset = tick.allPositions();
</span><span class="cx">                          elWidth = tick.outerWidth();
</span><del>-                               // adjust
</del><span class="cx">                           _.extend( offset, {
</span><del>-                                       right: offset.right + elWidth + 1,
-                                       left: offset.left + elWidth + 1
</del><ins>+                                        rightPlusWidth: offset.right,
+                                       leftPlusWidth: offset.left
</ins><span class="cx">                           });
</span><span class="cx">                  } else {
</span><span class="cx">                          // Normal tick
</span><span class="cx">                          tick = this.$('div:nth-of-type(' + (index + 1) + ')');
</span><span class="cx">                          offset = tick.allPositions();
</span><ins>+                               _.extend( offset, {
+                                       leftPlusWidth: offset.left + tick.outerWidth() + 1,
+                                       rightPlusWidth: offset.right + tick.outerWidth() + 1
+                               });
</ins><span class="cx">                   }
</span><span class="cx">                  this.model.set({ offset: offset });
</span><span class="cx">          },
</span><span class="lines">@@ -626,20 +664,15 @@
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          initialize: function() {
</span><del>-                       this.listenTo( this.model, 'update:revisions', this.ready );
</del><ins>+                        this.listenTo( this.model, 'update:revisions', this.render );
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          prepare: function() {
</span><span class="cx">                  return this.model.toJSON();
</span><span class="cx">          },
</span><span class="cx"> 
</span><del>-               ready: function() {
-                       this.$('.restore-revision').prop( 'disabled', this.model.get('to').get('current') );
-               },
-
</del><span class="cx">           restoreRevision: function() {
</span><del>-                       var restoreUrl = this.model.get('to').attributes.restoreUrl.replace(/&amp;/g, '&');
-                       document.location = restoreUrl;
</del><ins>+                        document.location = this.model.get('to').attributes.restoreUrl;
</ins><span class="cx">           }
</span><span class="cx">  });
</span><span class="cx"> 
</span><span class="lines">@@ -677,7 +710,6 @@
</span><span class="cx">  revisions.view.Tooltip = wp.Backbone.View.extend({
</span><span class="cx">          className: 'revisions-tooltip',
</span><span class="cx">          template: wp.template('revisions-tooltip'),
</span><del>-               direction: isRtl ? 'right' : 'left',
</del><span class="cx"> 
</span><span class="cx">          initialize: function( options ) {
</span><span class="cx">                  this.listenTo( this.model, 'change:offset', this.render );
</span><span class="lines">@@ -690,10 +722,20 @@
</span><span class="cx">          },
</span><span class="cx"> 
</span><span class="cx">          render: function() {
</span><del>-                       var css = {};
</del><ins>+                        var direction, directionVal, flipped, css = {}, position = this.model.revisions.indexOf( this.model.get('revision') ) + 1;
+                       flipped = ( position / this.model.revisions.length ) > 0.5;
+                       if ( isRtl ) {
+                               direction = flipped ? 'left' : 'right';
+                               directionVal = flipped ? 'leftPlusWidth' : direction;
+                       } else {
+                               direction = flipped ? 'right' : 'left';
+                               directionVal = flipped ? 'rightPlusWidth' : direction;
+                       }
+                       otherDirection = 'right' === direction ? 'left': 'right';
</ins><span class="cx">                   wp.Backbone.View.prototype.render.apply( this, arguments );
</span><del>-                       css[this.direction] = this.model.get('offset')[this.direction] + 'px';
-                       this.$el.css( css );
</del><ins>+                        css[direction] = this.model.get('offset')[directionVal] + 'px';
+                       css[otherDirection] = '';
+                       this.$el.toggleClass( 'flipped', flipped ).css( css );
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          visible: function() {
</span><span class="lines">@@ -716,8 +758,8 @@
</span><span class="cx">          template: wp.template('revisions-buttons'),
</span><span class="cx"> 
</span><span class="cx">          events: {
</span><del>-                       'click #next': 'nextRevision',
-                       'click #previous': 'previousRevision'
</del><ins>+                        'click .revisions-next .button': 'nextRevision',
+                       'click .revisions-previous .button': 'previousRevision'
</ins><span class="cx">           },
</span><span class="cx"> 
</span><span class="cx">          initialize: function() {
</span></span></pre></div>
<a id="trunkwpadminrevisionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/revision.php (24760 => 24761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/revision.php      2013-07-22 04:24:13 UTC (rev 24760)
+++ trunk/wp-admin/revision.php 2013-07-22 05:05:45 UTC (rev 24761)
</span><span class="lines">@@ -122,20 +122,23 @@
</span><span class="cx"> 
</span><span class="cx"> <script id="tmpl-revisions-buttons" type="text/html">
</span><span class="cx">  <div class="revisions-previous">
</span><del>-               <input class="button" type="button" id="previous" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
</del><ins>+                <input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
</ins><span class="cx">   </div>
</span><span class="cx"> 
</span><span class="cx">  <div class="revisions-next">
</span><del>-               <input class="button" type="button" id="next" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
</del><ins>+                <input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
</ins><span class="cx">   </div>
</span><span class="cx"> </script>
</span><span class="cx"> 
</span><span class="cx"> <script id="tmpl-revisions-tooltip" type="text/html">
</span><del>-       <div class="revisions-tooltip-content">
</del><ins>+        <div class="author-card">
</ins><span class="cx">   <# if ( 'undefined' !== typeof data && 'undefined' !== typeof data.author ) { #>
</span><del>-                       {{{ data.author.avatar }}} {{ data.author.name }},
-                       {{ data.timeAgo }}
-                       ({{ data.dateShort }})
</del><ins>+                {{{ data.author.avatar }}}
+               <div class="author-info">
+                       <span class="byline">Edit by <span class="author-name">{{ data.author.name }}</span></span>
+                       <span class="time-ago">{{ data.timeAgo }}</span>
+                       <span class="date">({{ data.dateShort }})</span>
+               </div>
</ins><span class="cx">   <# } #>
</span><span class="cx">  </div>
</span><span class="cx">  <div class="revisions-tooltip-arrow"><span></span></div>
</span><span class="lines">@@ -157,30 +160,41 @@
</span><span class="cx"> </script>
</span><span class="cx"> 
</span><span class="cx"> <script id="tmpl-revisions-meta" type="text/html">
</span><del>-       <div id="diff-header">
-               <div id="diff-header-from" class="diff-header">
-                       <div id="diff-title-from" class="diff-title">
-                               <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
-                               <# if ( 'undefined' !== typeof data.from ) { #>
-                                       {{{ data.from.attributes.author.avatar }}} {{ data.from.attributes.author.name }},
-                                       {{ data.from.attributes.timeAgo }}
-                                       ({{ data.from.attributes.dateShort }})
-                               <# } #>
</del><ins>+        <div class="diff-meta diff-meta-from">
+               <div class="diff-title">
+                       <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
+               <# if ( 'undefined' !== typeof data.from ) { #>
+                       <div class="author-card">
+                               {{{ data.from.attributes.author.avatar }}}
+                               <div class="author-info">
+                                       <span class="byline"><?php printf( __( 'Revision by %s' ),
+                                               '<span class="author-name">{{ data.to.attributes.author.name }}</span>' ); ?></span>
+                                       <span class="time-ago">{{ data.from.attributes.timeAgo }}</span>
+                                       <span class="date">({{ data.from.attributes.dateShort }})</span>
+                               </div>
</ins><span class="cx">                   </div>
</span><del>-                       <div class="clear"></div>
</del><ins>+                <# } #>
</ins><span class="cx">           </div>
</span><ins>+       </div>
</ins><span class="cx"> 
</span><del>-               <div id="diff-header-to" class="diff-header">
-                       <div id="diff-title-to" class="diff-title">
-                               <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
-                               <# if ( 'undefined' !== typeof data.to ) { #>
-                                       {{{ data.to.attributes.author.avatar }}} {{ data.to.attributes.author.name }},
-                                       {{ data.to.attributes.timeAgo }}
-                                       ({{ data.to.attributes.dateShort }})
-                               <# } #>
-                       </div>
-
-                       <input type="button" class="restore-revision button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" />
</del><ins>+        <div class="diff-meta diff-meta-to">
+               <div class="diff-title">
+                       <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
+               <# if ( 'undefined' !== typeof data.to ) { #>
+                       <div class="author-card">
+                               {{{ data.to.attributes.author.avatar }}}
+                               <div class="author-info">
+                                       <span class="byline"><?php printf( __( 'Revision by %s' ),
+                                               '<span class="author-name">{{ data.to.attributes.author.name }}</span>' ); ?></span>
+                                       <span class="time-ago">{{ data.to.attributes.timeAgo }}</span>
+                                       <span class="date">({{ data.to.attributes.dateShort }})</span>
+                               </div>
+               <# } #>
+                       <input 
+                       <# if ( data.to.attributes.current ) { #>
+                               disabled="disabled"
+                       <# } #>
+                       type="button" class="restore-revision button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" />
</ins><span class="cx">           </div>
</span><span class="cx">  </div>
</span><span class="cx"> </script>
</span></span></pre>
</div>
</div>

</body>
</html>