[PATCH 2 of 2] paper, coal: replace .sourcelast with .bottomline that does the same

Anton Shestakov av6 at dwimlabs.net
Mon Sep 14 07:42:37 CDT 2015


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1442227269 -28800
#      Mon Sep 14 18:41:09 2015 +0800
# Node ID 59eb92712fe4065633bd0254b3dd7aa761a24f90
# Parent  4ac7b7cfe6ff540b0993c1a13c0afd4bac63f725
paper, coal: replace .sourcelast with .bottomline that does the same

Basically, div.sourcelast was only used to make a 1px border on the bottom of
file source view (and only there). It's better to use bottomline class, that
also exists for the same purpose (visually), but is used more widely and works
without needing an empty <div>.

diff --git a/mercurial/templates/paper/filerevision.tmpl b/mercurial/templates/paper/filerevision.tmpl
--- a/mercurial/templates/paper/filerevision.tmpl
+++ b/mercurial/templates/paper/filerevision.tmpl
@@ -71,8 +71,7 @@
 <div class="overflow">
 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
 <div class="sourcefirst"> line source</div>
-<pre class="sourcelines stripes4 wrap">{text%fileline}</pre>
-<div class="sourcelast"></div>
+<pre class="sourcelines stripes4 wrap bottomline">{text%fileline}</pre>
 </div>
 </div>
 </div>
diff --git a/mercurial/templates/static/style-coal.css b/mercurial/templates/static/style-coal.css
--- a/mercurial/templates/static/style-coal.css
+++ b/mercurial/templates/static/style-coal.css
@@ -208,14 +208,13 @@ h3 {
 .bigtable td.annotate { font-size: smaller; }
 .bigtable td.source { font-size: inherit; }
 
-.source, .sourcefirst, .sourcelast {
+.source, .sourcefirst {
   font-family: monospace;
   white-space: pre;
   padding: 1px 4px;
   font-size: 90%;
 }
 .sourcefirst { border-bottom: 1px solid #999; font-weight: bold; }
-.sourcelast { border-top: 1px solid #999; }
 .source a { color: #999; font-size: smaller; font-family: monospace;}
 .bottomline { border-bottom: 1px solid #999; }
 
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -209,14 +209,13 @@ h3 {
 .bigtable td.annotate { font-size: smaller; }
 .bigtable td.source { font-size: inherit; }
 
-.source, .sourcefirst, .sourcelast {
+.source, .sourcefirst {
   font-family: monospace;
   white-space: pre;
   padding: 1px 4px;
   font-size: 90%;
 }
 .sourcefirst { border-bottom: 1px solid #999; font-weight: bold; }
-.sourcelast { border-top: 1px solid #999; }
 .source a { color: #999; font-size: smaller; font-family: monospace;}
 .bottomline { border-bottom: 1px solid #999; }
 
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1335,9 +1335,8 @@ File-related
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap">
+  <pre class="sourcelines stripes4 wrap bottomline">
   <span id="l1">foo</span><a href="#l1"></a></pre>
-  <div class="sourcelast"></div>
   </div>
   </div>
   </div>
@@ -1462,9 +1461,8 @@ File-related
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap">
+  <pre class="sourcelines stripes4 wrap bottomline">
   <span id="l1">another</span><a href="#l1"></a></pre>
-  <div class="sourcelast"></div>
   </div>
   </div>
   </div>
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -142,7 +142,7 @@ hgweb filerevision, html
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap">
+  <pre class="sourcelines stripes4 wrap bottomline">
   <span id="l1"><span class="c">#!/usr/bin/env python</span></span><a href="#l1"></a>
   <span id="l2"></span><a href="#l2"></a>
   <span id="l3"><span class="sd">"""Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l3"></a>
@@ -176,7 +176,6 @@ hgweb filerevision, html
   <span id="l31">    <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></span><a href="#l31"></a>
   <span id="l32">    <span class="kn">print</span> <span class="s">"The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></span><a href="#l32"></a>
   <span id="l33"></span><a href="#l33"></a></pre>
-  <div class="sourcelast"></div>
   </div>
   </div>
   </div>


More information about the Mercurial-devel mailing list