[PATCH 2 of 2] gitweb, monoblue: port highlighting linked lines from paper

Augie Fackler raf at durin42.com
Fri Sep 25 12:42:13 CDT 2015


On Fri, Sep 25, 2015 at 03:34:53PM +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6 at dwimlabs.net>
> # Date 1443155900 -28800
> #      Fri Sep 25 12:38:20 2015 +0800
> # Node ID 513e167f4754da50c441e7ef8bcbbe2e395ae363
> # Parent  b149db3019db1ea377507201ce46d925071df7e2
> gitweb, monoblue: port highlighting linked lines from paper

queued these, thanks

>
> This is adapted from 41c4bdd1d585, fbfe5748ef3e and f3393d458bf5.
>
> diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
> --- a/mercurial/templates/gitweb/map
> +++ b/mercurial/templates/gitweb/map
> @@ -95,12 +95,12 @@ filelog = filelog.tmpl
>  fileline = '
>    <span id="{lineid}">{strip(line|escape, '\r\n')}</span><a href="#{lineid}"></a>'
>  annotateline = '
> -  <tr style="font-family:monospace" class="parity{parity}">
> +  <tr id="{lineid}" style="font-family:monospace" class="parity{parity}">
>      <td class="linenr" style="text-align: right;">
>        <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
>           title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
>      </td>
> -    <td><pre><a class="linenr" href="#{lineid}" id="{lineid}">{linenumber}</a></pre></td>
> +    <td><pre><a class="linenr" href="#{lineid}">{linenumber}</a></pre></td>
>      <td><pre>{line|escape}</pre></td>
>    </tr>'
>  difflineplus = '
> @@ -117,9 +117,9 @@ comparisonblock ='
>    {lines}
>    </tbody>'
>  comparisonline = '
> -  <tr style="font-family:monospace">
> -    <td class="{type}"><pre><a class="linenr" href="#{lineid}" id="{lineid}">{leftlinenumber}</a> {leftline|escape}</pre></td>
> -    <td class="{type}"><pre><a class="linenr" href="#{lineid}" id="{lineid}">{rightlinenumber}</a> {rightline|escape}</pre></td>
> +  <tr id="{lineid}" style="font-family:monospace">
> +    <td class="{type}"><pre><a class="linenr" href="#{lineid}">{leftlinenumber}</a> {leftline|escape}</pre></td>
> +    <td class="{type}"><pre><a class="linenr" href="#{lineid}">{rightlinenumber}</a> {rightline|escape}</pre></td>
>    </tr>'
>
>  changelogparent = '
> diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
> --- a/mercurial/templates/monoblue/map
> +++ b/mercurial/templates/monoblue/map
> @@ -91,13 +91,13 @@ filelog = filelog.tmpl
>  fileline = '
>    <span id="{lineid}">{strip(line|escape, '\r\n')}</span><a href="#{lineid}"></a>'
>  annotateline = '
> -  <tr class="parity{parity}">
> +  <tr id="{lineid}" class="parity{parity}">
>      <td class="linenr">
>        <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
>           title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
>      </td>
>      <td class="lineno">
> -      <a href="#{lineid}" id="{lineid}">{linenumber}</a>
> +      <a href="#{lineid}">{linenumber}</a>
>      </td>
>      <td class="source">{line|escape}</td>
>    </tr>'
> @@ -115,9 +115,9 @@ comparisonblock ='
>    {lines}
>    </tbody>'
>  comparisonline = '
> -  <tr>
> -    <td class="source {type}"><a class="linenr" href="#{lineid}" id="{lineid}">{leftlinenumber}</a> {leftline|escape}</td>
> -    <td class="source {type}"><a class="linenr" href="#{lineid}" id="{lineid}">{rightlinenumber}</a> {rightline|escape}</td>
> +  <tr id="{lineid}">
> +    <td class="source {type}"><a class="linenr" href="#{lineid}">{leftlinenumber}</a> {leftline|escape}</td>
> +    <td class="source {type}"><a class="linenr" href="#{lineid}">{rightlinenumber}</a> {rightline|escape}</td>
>    </tr>'
>
>  changesetlink = '<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
> diff --git a/mercurial/templates/static/style-gitweb.css b/mercurial/templates/static/style-gitweb.css
> --- a/mercurial/templates/static/style-gitweb.css
> +++ b/mercurial/templates/static/style-gitweb.css
> @@ -119,6 +119,11 @@ pre.sourcelines > a {
>       width: 4em;
>       height: 1em;
>  }
> +tr:target td,
> +pre.sourcelines > span:target,
> +pre.sourcelines.stripes > span:target {
> +	background-color: #bfdfff;
> +}
>
>  /* Graph */
>  div#wrapper {
> diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
> --- a/mercurial/templates/static/style-monoblue.css
> +++ b/mercurial/templates/static/style-monoblue.css
> @@ -300,6 +300,11 @@ pre.sourcelines.stripes > :nth-child(4n+
>  pre.sourcelines.stripes > :nth-child(4n+3) { background-color: #FFFFFF; }
>  pre.sourcelines.stripes > :nth-child(4n+1):hover,
>  pre.sourcelines.stripes > :nth-child(4n+3):hover { background-color: #D5E1E6; }
> +tr:target td,
> +pre.sourcelines > span:target,
> +pre.sourcelines.stripes > span:target {
> +    background-color: #bfdfff;
> +}
>
>  td.source {
>    white-space: pre;
> diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
> --- a/tests/test-hgweb.t
> +++ b/tests/test-hgweb.t
> @@ -340,7 +340,7 @@ static file
>
>    $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
>    200 Script output follows
> -  content-length: 6264
> +  content-length: 6379
>    content-type: text/css
>
>    body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; }
> @@ -464,6 +464,11 @@ static file
>       width: 4em;
>       height: 1em;
>    }
> +  tr:target td,
> +  pre.sourcelines > span:target,
> +  pre.sourcelines.stripes > span:target {
> +     background-color: #bfdfff;
> +  }
>
>    /* Graph */
>    div#wrapper {
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list