2011-01-14 Ojan Vafai <ojan@chromium.org>
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 01:02:18 +0000 (01:02 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 01:02:18 +0000 (01:02 +0000)
        Reviewed by Adam Barth.

        put remove lines to the left of add lines in sidebyside view
        https://bugs.webkit.org/show_bug.cgi?id=52458

        Also, sneaking in a fix to make long lines with no whitespace wrap.

        * PrettyPatch/PrettyPatch.rb:
        * code-review.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75845 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/bugs.webkit.org/ChangeLog
Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb
Websites/bugs.webkit.org/code-review.js

index 71d2853..2e5daba 100644 (file)
@@ -1,5 +1,17 @@
 2011-01-14  Ojan Vafai  <ojan@chromium.org>
 
+        Reviewed by Adam Barth.
+
+        put remove lines to the left of add lines in sidebyside view
+        https://bugs.webkit.org/show_bug.cgi?id=52458
+
+        Also, sneaking in a fix to make long lines with no whitespace wrap.
+
+        * PrettyPatch/PrettyPatch.rb:
+        * code-review.js:
+
+2011-01-14  Ojan Vafai  <ojan@chromium.org>
+
         Fix bad merge in r75816.
 
         * code-review.js:
index a0529d9..904bb32 100644 (file)
@@ -164,12 +164,23 @@ h1 :hover {
     border-width: 1px 0px;
 }
 
-.LineSide {
+.sidebyside .DiffBlockPart.add:first-child {
+    float: right;
+}
+
+.LineSide,
+.sidebyside .DiffBlockPart.remove,
+.sidebyside .DiffBlockPart.add {
     display:inline-block;
     width:50%;
     vertical-align: top;
 }
 
+.sidebyside .DiffBlockPart.remove .to,
+.sidebyside .DiffBlockPart.add .from {
+    display: none;
+}
+
 .lineNumber, .expansionLineNumber {
     border-bottom: 1px solid #998;
     border-right: 1px solid #ddd;
@@ -191,8 +202,8 @@ h1 :hover {
 
 .text {
     padding-left: 5px;
-    white-space: pre;
     white-space: pre-wrap;
+    word-wrap: break-word;
 }
 
 .image {
@@ -393,9 +404,13 @@ body {
   position: absolute;
   top: -11%;
 }
+
+.clear_float {
+    clear: both;
+}
 </style>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
-<script src="code-review.js?version=23"></script>
+<script src="code-review.js?version=24"></script>
 EOF
 
     def self.revisionOrDescription(string)
@@ -579,7 +594,7 @@ END
         def to_html
             str = "<div class='DiffBlock'>\n"
             str += @parts.collect{ |part| part.to_html }.join
-            str += "</div>\n"
+            str += "<div class='clear_float'></div></div>\n"
         end
     end
 
@@ -596,7 +611,8 @@ END
         def to_html
             str = "<div class='DiffBlockPart %s'>\n" % @className
             str += @lines.collect{ |line| line.to_html }.join
-            str += "</div>\n"
+            # Don't put white-space after this so adjacent inline-block DiffBlockParts will not wrap.
+            str += "</div>"
         end
     end
 
index a903c18..e8b99ca 100644 (file)
     if (diffState(file_diff) == diff_type)
       return;
 
+    $(file_diff).removeClass('sidebyside unified');
+    $(file_diff).addClass(diff_type);
+
     $(file_diff).attr('data-diffstate', diff_type);
     updateDiffLinkVisibility(file_diff);
 
-    $('.Line', file_diff).each(function() {
+    $('.shared .Line', file_diff).each(function() {
       convertLine(diff_type, this);
     });