<div dir="ltr">Next I'm going to implement multiple lines highlighting, like e.g. on github and as I know it's impossible with CSS :target. However, using :target as a fallback for disabled JS is planned too.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/31 Laurens Holst <span dir="ltr"><<a href="mailto:laurens.nospam@grauw.nl" target="_blank">laurens.nospam@grauw.nl</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Op 31-05-13 12:35, Alexander Plavin schreef:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# HG changeset patch<br>
# User Alexander Plavin <<a href="mailto:me@aplavin.ru" target="_blank">me@aplavin.ru</a>><br>
# Date 1369991128 -14400<br>
#      Fri May 31 13:05:28 2013 +0400<br>
# Node ID 235602ad98c5ee757544110a639b5d<u></u>a88163d320<br>
# Parent  b05d1e3d588bc747083ced741c2982<u></u>9c55c73cd8<br>
hgweb: highlight the line which is linked at<br>
<br>
Line corresponding to the URL hash (#l<n>) is highlighted in the views which<br>
show file(s) content.<br>
</blockquote>
<br></div>
Can’t you use a :target CSS style?<br>
<br>
~Laurens<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
diff -r b05d1e3d588b -r 235602ad98c5 mercurial/templates/paper/<u></u>footer.tmpl<br>
--- a/mercurial/templates/paper/<u></u>footer.tmpl     Thu May 30 20:23:50 2013 +0400<br>
+++ b/mercurial/templates/paper/<u></u>footer.tmpl     Fri May 31 13:05:28 2013 +0400<br>
@@ -1,4 +1,8 @@<br>
-<script type="text/javascript"><u></u>process_dates()</script><br>
+<script type="text/javascript"><br>
+process_dates();<br>
+highlightLines();<br>
+addOnclickSource();<br>
+</script><br>
  {motd}<br>
    </body><br>
diff -r b05d1e3d588b -r 235602ad98c5 mercurial/templates/static/<u></u>mercurial.js<br>
--- a/mercurial/templates/static/<u></u>mercurial.js   Thu May 30 20:23:50 2013 +0400<br>
+++ b/mercurial/templates/static/<u></u>mercurial.js   Fri May 31 13:05:28 2013 +0400<br>
@@ -3,6 +3,7 @@<br>
  // Rendering of branch DAGs on the client side<br>
  // Display of elapsed time<br>
  // Show or hide diffstat<br>
+// Highlight source lines<br>
  //<br>
  // Copyright 2008 Dirkjan Ochtman <dirkjan AT ochtman DOT nl><br>
  // Copyright 2006 Alexander Schremmer <alex AT alexanderweb DOT de><br>
@@ -274,3 +275,38 @@<br>
        document.getElementById('<u></u>diffstatdetails').style.<u></u>display = 'none';<br>
        document.getElementById('<u></u>diffstatexpand').style.display = 'inline';<br>
  }<br>
+<br>
+<br>
+function highlightLines() {<br>
+    nodes = document.<u></u>getElementsByClassName('<u></u>linkedline');<br>
+    for (i = 0; i < nodes.length; i++) {<br>
+        nodes[i].className = nodes[i].className.replace(/(?<u></u>:^|\s)linkedline(?!\S)/g, '');<br>
+    }<br>
+<br>
+    hash = window.location.hash;<br>
+    if (hash.substring(0, 2) === '#l') {<br>
+        id = hash.substring(1);<br>
+        elem = document.getElementById(id);<br>
+        switch (elem.tagName) {<br>
+            case 'A':<br>
+                elem.parentNode.parentNode.<u></u>className += ' linkedline';<br>
+                break;<br>
+            case 'LI':<br>
+                elem.className += ' linkedline';<br>
+                break;<br>
+        }<br>
+    }<br>
+}<br>
+<br>
+window.addEventListener("<u></u>hashchange", highlightLines, false);<br>
+<br>
+function addOnclickSource() {<br>
+    nodes = document.querySelectorAll('li.<u></u>source');<br>
+    for (i = 0; i < nodes.length; i++) {<br>
+        nodes[i].onclick = function (event) {<br>
+            if (event.offsetX < 0 || event.target.tagName == 'LI') {<br>
+                window.location.hash = '#' + <a href="http://this.id" target="_blank">this.id</a>;<br>
+            }<br>
+        };<br>
+    }<br>
+}<br>
diff -r b05d1e3d588b -r 235602ad98c5 mercurial/templates/static/<u></u>style-paper.css<br>
--- a/mercurial/templates/static/<u></u>style-paper.css        Thu May 30 20:23:50 2013 +0400<br>
+++ b/mercurial/templates/static/<u></u>style-paper.css        Fri May 31 13:05:28 2013 +0400<br>
@@ -96,6 +96,7 @@<br>
  .indexlinks { white-space:nowrap; }<br>
  .parity0 { background-color: #f0f0f0; }<br>
  .parity1 { background-color: white; }<br>
+.linkedline > * { background-color: #ffff99 !important; }<br>
  .plusline { color: green !important; }<br>
  .minusline { color: #dc143c !important; } /* crimson */<br>
  .atline { color: purple !important; }<br></div></div>
______________________________<u></u>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com" target="_blank">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/<u></u>listinfo/mercurial-devel</a><br>
<br>
</blockquote>
<br>
</blockquote></div><br></div>