Patchwork [V2] hgweb: highlight line which is linked to at comparison view

login
register
mail settings
Submitter Alexander Plavin
Date July 17, 2013, 7 p.m.
Message ID <e498e628f4234b646b90.1374087600@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1912/
State Accepted
Commit fbfe5748ef3e6ca29a7384b6f4b967f68bcf0112
Headers show

Comments

Alexander Plavin - July 17, 2013, 7 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1373722374 -14400
#      Sat Jul 13 17:32:54 2013 +0400
# Node ID e498e628f4234b646b904779a011a47ac15448f7
# Parent  85647c04ac7c35b7cbddf8612d81198f1ee7953f
hgweb: highlight line which is linked to at comparison view
Matt Mackall - July 19, 2013, 2:18 a.m.
On Wed, 2013-07-17 at 23:00 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <me@aplavin.ru>
> # Date 1373722374 -14400
> #      Sat Jul 13 17:32:54 2013 +0400
> # Node ID e498e628f4234b646b904779a011a47ac15448f7
> # Parent  85647c04ac7c35b7cbddf8612d81198f1ee7953f
> hgweb: highlight line which is linked to at comparison view

Queued for default, thanks.

Patch

diff -r 85647c04ac7c -r e498e628f423 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 85647c04ac7c -r e498e628f423 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 85647c04ac7c -r e498e628f423 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>