Patchwork [2,of,2] hgweb: highlight line which is linked to at comparison view

login
register
mail settings
Submitter Alexander Plavin
Date July 13, 2013, 3:36 p.m.
Message ID <06f018ef1524ea7133d8.1373729807@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1858/
State Superseded
Headers show

Comments

Alexander Plavin - July 13, 2013, 3:36 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1373722374 -14400
#      Sat Jul 13 17:32:54 2013 +0400
# Node ID 06f018ef1524ea7133d83786b7691df748d73ef9
# Parent  c4f25e9184601161b1f24aa41e2c9d6957b95654
hgweb: highlight line which is linked to at comparison view

Patch

diff -r c4f25e918460 -r 06f018ef1524 mercurial/templates/paper/map
--- a/mercurial/templates/paper/map	Sat Jul 13 17:31:53 2013 +0400
+++ b/mercurial/templates/paper/map	Sat Jul 13 17:32:54 2013 +0400
@@ -99,9 +99,9 @@ 
   {lines}
   </tbody>'
 comparisonline = '
-  <tr>
-    <td class="source {type}"><a href="#{lineid}" id="{lineid}">{leftlinenumber}</a> {leftline|escape}</td>
-    <td class="source {type}"><a href="#{lineid}" id="{lineid}">{rightlinenumber}</a> {rightline|escape}</td>
+  <tr id="{lineid}">
+    <td class="source {type}"><a href="#{lineid}">{leftlinenumber}</a> {leftline|escape}</td>
+    <td class="source {type}"><a href="#{lineid}">{rightlinenumber}</a> {rightline|escape}</td>
   </tr>'
 
 changelogparent = '
diff -r c4f25e918460 -r 06f018ef1524 mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Sat Jul 13 17:31:53 2013 +0400
+++ b/mercurial/templates/static/style-paper.css	Sat Jul 13 17:32:54 2013 +0400
@@ -252,7 +252,7 @@ 
   content: counters(lineno, ".");
 }
 
-.sourcelines > span:target {
+.sourcelines > span:target, tr:target td {
   background-color: #bfdfff;
 }
 
diff -r c4f25e918460 -r 06f018ef1524 tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t	Sat Jul 13 17:31:53 2013 +0400
+++ b/tests/test-hgweb-diffs.t	Sat Jul 13 17:32:54 2013 +0400
@@ -660,9 +660,9 @@ 
     
   <tbody class="block">
   
-  <tr>
-  <td class="source insert"><a href="#r1" id="r1">      </a> </td>
-  <td class="source insert"><a href="#r1" id="r1">     1</a> a</td>
+  <tr id="r1">
+  <td class="source insert"><a href="#r1">      </a> </td>
+  <td class="source insert"><a href="#r1">     1</a> a</td>
   </tr>
   </tbody>
   </table>
@@ -782,13 +782,13 @@ 
     
   <tbody class="block">
   
-  <tr>
-  <td class="source equal"><a href="#l1r1" id="l1r1">     1</a> a</td>
-  <td class="source equal"><a href="#l1r1" id="l1r1">     1</a> a</td>
+  <tr id="l1r1">
+  <td class="source equal"><a href="#l1r1">     1</a> a</td>
+  <td class="source equal"><a href="#l1r1">     1</a> a</td>
   </tr>
-  <tr>
-  <td class="source insert"><a href="#r2" id="r2">      </a> </td>
-  <td class="source insert"><a href="#r2" id="r2">     2</a> a</td>
+  <tr id="r2">
+  <td class="source insert"><a href="#r2">      </a> </td>
+  <td class="source insert"><a href="#r2">     2</a> a</td>
   </tr>
   </tbody>
   </table>
@@ -906,13 +906,13 @@ 
     
   <tbody class="block">
   
-  <tr>
-  <td class="source delete"><a href="#l1" id="l1">     1</a> a</td>
-  <td class="source delete"><a href="#l1" id="l1">      </a> </td>
+  <tr id="l1">
+  <td class="source delete"><a href="#l1">     1</a> a</td>
+  <td class="source delete"><a href="#l1">      </a> </td>
   </tr>
-  <tr>
-  <td class="source delete"><a href="#l2" id="l2">     2</a> a</td>
-  <td class="source delete"><a href="#l2" id="l2">      </a> </td>
+  <tr id="l2">
+  <td class="source delete"><a href="#l2">     2</a> a</td>
+  <td class="source delete"><a href="#l2">      </a> </td>
   </tr>
   </tbody>
   </table>