Patchwork [2,of,5,V2] hgweb: code selection without line numbers in file diff and changeset views

login
register
mail settings
Submitter Alexander Plavin
Date May 31, 2013, 10:51 a.m.
Message ID <12a99814b60ae57e2ee9.1369997514@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1681/
State Rejected, archived
Headers show

Comments

Alexander Plavin - May 31, 2013, 10:51 a.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1369931030 -14400
#      Thu May 30 20:23:50 2013 +0400
# Node ID 12a99814b60ae57e2ee96780020fc6f324cd6815
# Parent  88877f36f75166b4bd12317cf3f986b17ae8cf2c
hgweb: code selection without line numbers in file diff and changeset views

File diff and changeset views display lines the same way as file code view, as
HTML ordered list, so that line numbers are not selected with the code itself.

Patch

diff -r 88877f36f751 -r 12a99814b60a mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/changeset.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -77,7 +77,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r 88877f36f751 -r 12a99814b60a mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/filediff.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -68,7 +68,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r 88877f36f751 -r 12a99814b60a mercurial/templates/paper/map
--- a/mercurial/templates/paper/map	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/map	Thu May 30 20:23:50 2013 +0400
@@ -84,11 +84,11 @@ 
     <td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td>
   </tr>'
 
-diffblock = '<div class="source bottomline parity{parity}"><pre>{lines}</pre></div>'
-difflineplus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="plusline">{line|escape}</span>'
-difflineminus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="minusline">{line|escape}</span>'
-difflineat = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="atline">{line|escape}</span>'
-diffline = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}'
+diffblock = '<div class="bottomline parity{parity}"><ol class="parity{parity}">{lines}</ol></div>'
+difflineplus = '<li class="source" id="{lineid}"><div class="plusline">{line|escape|spaceifempty}</div></li>'
+difflineminus = '<li class="source" id="{lineid}"><div class="minusline">{line|escape|spaceifempty}</div></li>'
+difflineat = '<li class="source" id="{lineid}"><div class="atline">{line|escape|spaceifempty}</div></li>'
+diffline = '<li class="source" id="{lineid}"><div>{line|escape|spaceifempty}</div></li>'
 
 comparisonblock ='
   <tbody class="block">
diff -r 88877f36f751 -r 12a99814b60a mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/static/style-paper.css	Thu May 30 20:23:50 2013 +0400
@@ -96,9 +96,9 @@ 
 .indexlinks { white-space:nowrap; }
 .parity0 { background-color: #f0f0f0; }
 .parity1 { background-color: white; }
-.plusline { color: green; }
-.minusline { color: #dc143c; } /* crimson */
-.atline { color: purple; }
+.plusline { color: green !important; }
+.minusline { color: #dc143c !important; } /* crimson */
+.atline { color: purple !important; }
 
 .diffstat-file {
   white-space: nowrap;