Mercurial > hg
diff tests/test-highlight.t @ 32995:7c82bfd55d47
hgweb: parameterize the tag name of elements holding followlines selection
While plugging followlines.js into "annotate" view, we'll need to walk a
different DOM structure from that of "filerevision" view. In particular, the
selectable source line element is a <tr> in annotate view (in contrast with a
<span> in filerevision view). So make this tag name a parameter of
followlines.js script by passing its value as a "selectabletag" data attribute
of <pre class="sourcelines"> element.
As <pre class="sourcelines"> tags are getting quite long in templates, rewrite
them on several lines.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Wed, 21 Jun 2017 17:07:51 +0200 |
parents | b6776b34e44e |
children | 1c97df5e3b46 |
line wrap: on
line diff
--- a/tests/test-highlight.t Wed Jun 21 17:02:21 2017 +0200 +++ b/tests/test-highlight.t Wed Jun 21 17:07:51 2017 +0200 @@ -148,7 +148,11 @@ <div class="overflow"> <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div> <div class="sourcefirst"> line source</div> - <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py" data-ishead="1"> + <pre class="sourcelines stripes4 wrap bottomline" + data-logurl="/log/tip/primes.py" + data-selectabletag="SPAN" + data-ishead="1"> + <span id="l1"><span class="sd">"""Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l1"></a> <span id="l2"></span><a href="#l2"></a> <span id="l3"><span class="sd">primes = 2 : sieve [3, 5..]</span></span><a href="#l3"></a> @@ -179,7 +183,8 @@ <span id="l28"> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></span><a href="#l28"></a> <span id="l29"> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></span><a href="#l29"></a> <span id="l30"> <span class="kn">print</span> <span class="s">"The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></span><a href="#l30"></a> - <span id="l31"></span><a href="#l31"></a></pre> + <span id="l31"></span><a href="#l31"></a> + </pre> </div> <script type="text/javascript" src="/static/followlines.js"></script>