From patchwork Sat Jul 13 22:12:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,4,V2] hgweb: introduce separate classes for stripey background From: Alexander Plavin X-Patchwork-Id: 1875 Message-Id: <4ff0280567aab3b43c50.1373753530@debian-alexander.dolgopa> To: mercurial-devel@selenic.com Date: Sun, 14 Jul 2013 02:12:10 +0400 # HG changeset patch # User Alexander Plavin # Date 1373658476 -14400 # Fri Jul 12 23:47:56 2013 +0400 # Node ID 4ff0280567aab3b43c5058815d239d8fa4f1fb2e # Parent ff3a665349adccb190786a81bdb201efce895b1d hgweb: introduce separate classes for stripey background Introduce stripes2 and stripes4 classes to support different structure. They will be useful to implement stripes with pure CSS everywhere instead of current server-side implementation. diff -r ff3a665349ad -r 4ff0280567aa 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 @@
line wrap: on
line source
-
{text%fileline}
+
{text%fileline}
diff -r ff3a665349ad -r 4ff0280567aa 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 ff3a665349ad -r 4ff0280567aa 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 @@
line wrap: on
line source
-
+  
   foo
diff -r ff3a665349ad -r 4ff0280567aa 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 @@
line wrap: on
line source
-
+  
   #!/usr/bin/env python
   
   """Fun with generators. Corresponding Haskell implementation: