Patchwork [3,of,6] hgweb: separate classes for stripey background

login
register
mail settings
Submitter Alexander Plavin
Date July 12, 2013, 9:07 p.m.
Message ID <8458ee0b0df78ae9ff3f.1373663260@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1848/
State Superseded, archived
Headers show

Comments

Alexander Plavin - July 12, 2013, 9:07 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1373658476 -14400
#      Fri Jul 12 23:47:56 2013 +0400
# Node ID 8458ee0b0df78ae9ff3fbd809e49e290959fcbc7
# Parent  506b516ecf16d9e97fdaa92dfa9193f5da358d2f
hgweb: separate classes for stripey background

Introduce stripes2 and stripes4 classes to support different structure.

Patch

diff -r 506b516ecf16 -r 8458ee0b0df7 mercurial/templates/paper/filerevision.tmpl
--- a/mercurial/templates/paper/filerevision.tmpl	Fri Jul 12 15:58:13 2013 +0400
+++ b/mercurial/templates/paper/filerevision.tmpl	Fri Jul 12 23:47:56 2013 +0400
@@ -69,7 +69,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 wrap">{text%fileline}</pre>
+<pre class="sourcelines stripes4 wrap">{text%fileline}</pre>
 <div class="sourcelast"></div>
 </div>
 </div>
diff -r 506b516ecf16 -r 8458ee0b0df7 mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Fri Jul 12 15:58:13 2013 +0400
+++ b/mercurial/templates/static/style-paper.css	Fri Jul 12 23:47:56 2013 +0400
@@ -94,8 +94,12 @@ 
 .age { white-space:nowrap; }
 .date { white-space:nowrap; }
 .indexlinks { white-space:nowrap; }
-.parity0 { background-color: #f0f0f0; }
-.parity1 { background-color: white; }
+.parity0,
+.stripes4 > :nth-child(4n+1),
+.stripes2 > :nth-child(2n+1) { background-color: #f0f0f0; }
+.parity1,
+.stripes4 > :nth-child(4n+3),
+.stripes2 > :nth-child(2n+2) { background-color: white; }
 .plusline { color: green; }
 .minusline { color: #dc143c; } /* crimson */
 .atline { color: purple; }
@@ -244,9 +248,6 @@ 
   content: counter(lineno);
 }
 
-.sourcelines > span:nth-child(4n+1) { background-color: #f0f0f0; }
-.sourcelines > span:nth-child(4n+3) { background-color: white; }
-
 .sourcelines > span:target {
   background-color: #ffff99;
 }
diff -r 506b516ecf16 -r 8458ee0b0df7 tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t	Fri Jul 12 15:58:13 2013 +0400
+++ b/tests/test-hgweb-commands.t	Fri Jul 12 23:47:56 2013 +0400
@@ -669,7 +669,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 wrap">
+  <pre class="sourcelines stripes4 wrap">
   <span id="l1">foo</span><a href="#l1"></a></pre>
   <div class="sourcelast"></div>
   </div>
diff -r 506b516ecf16 -r 8458ee0b0df7 tests/test-highlight.t
--- a/tests/test-highlight.t	Fri Jul 12 15:58:13 2013 +0400
+++ b/tests/test-highlight.t	Fri Jul 12 23:47:56 2013 +0400
@@ -138,7 +138,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 wrap">
+  <pre class="sourcelines stripes4 wrap">
   <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">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l3"></a>