[gitg] Apply 'pre-wrap' only on code



commit 1ce3808ad0a47a9ef89a0d5849a8f1bac66c453a
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Wed Dec 18 07:08:57 2013 +0800

    Apply 'pre-wrap' only on code
    
    Now, we can indent the html elements in normal '<td>'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720886

 libgitg/resources/diff-view-html-builder.js |    2 +-
 libgitg/resources/diff-view.css             |    4 ++--
 libgitg/resources/diff-view.html            |    5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 0f05ebb..48da6a6 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -91,7 +91,7 @@ function diff_file(file, lnstate, data)
                                break;
                        }
 
-                       row += '<td>' + html_escape(l.content).replace(/\t/g, tabrepl) + '</td>';
+                       row += '<td class="code">' + html_escape(l.content).replace(/\t/g, tabrepl) + '</td>';
 
                        row += '</tr>';
 
diff --git a/libgitg/resources/diff-view.css b/libgitg/resources/diff-view.css
index 782de1b..5b9066b 100644
--- a/libgitg/resources/diff-view.css
+++ b/libgitg/resources/diff-view.css
@@ -57,7 +57,7 @@ div#diff div.file table .gutter {
   text-align: right;
 }
 
-div#diff div.file table td {
+div#diff div.file table td.code {
   white-space: pre;
 }
 
@@ -66,7 +66,7 @@ span.tab {
   display: inline-block;
 }
 
-div#diff div.file table.wrapped td {
+div#diff div.file table.wrapped td.code {
   white-space: pre-wrap;
 }
 
diff --git a/libgitg/resources/diff-view.html b/libgitg/resources/diff-view.html
index 740a411..61944eb 100644
--- a/libgitg/resources/diff-view.html
+++ b/libgitg/resources/diff-view.html
@@ -29,7 +29,10 @@
           </colgroup>
           <tbody>
             <tr class="file_header">
-              <td colspan="3"><!-- ${FILE_STATS} --><span class="file_path"><!-- ${FILE_PATH} --></span></td>
+              <td colspan="3">
+                <!-- ${FILE_STATS} -->
+                <span class="file_path"><!-- ${FILE_PATH} --></span>
+              </td>
             </tr>
             <!-- ${FILE_BODY} -->
           </tbody>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]