hgweb: highlight line which is linked to at comparison view
authorAlexander Plavin <me@aplavin.ru>
Sat, 13 Jul 2013 17:32:54 +0400
changeset 19459 fbfe5748ef3e
parent 19458 5e518418738e
child 19460 d876c82f25a3
hgweb: highlight line which is linked to at comparison view
mercurial/templates/paper/map
mercurial/templates/static/style-paper.css
tests/test-hgweb-diffs.t
--- 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 = '
--- 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;
 }
 
--- 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>