[PATCH 1 of 1] hgweb: code selection without line numbers in file source view

Alexander Plavin me at aplavin.ru
Wed Jun 26 15:53:32 CDT 2013


It's a known problem with firefox, and pre tags don't solve it simple.
No plans for fixing this soon.

2013/6/27 Laurens Holst <laurens.nospam at grauw.nl>:
> If I copy/paste some text from here:
>
> http://hg.aplavin.ru/hg_fork/file/tip/README
>
> it doesn’t include the indentation.
>
> Maybe it will if you put the lines between <pre> tags?
>
> ~Laurens
>
> Op 26-06-13 19:01, Alexander Plavin schreef:
>>
>> # HG changeset patch
>> # User Alexander Plavin <me at aplavin.ru>
>> # Date 1372180221 -14400
>> #      Tue Jun 25 21:10:21 2013 +0400
>> # Node ID ebe1b167012527ac68a563e6b7d359dad9bb2046
>> # Parent  7a4e0ab91bcc550e85693bcb0dda1e11924a1a4e
>> hgweb: code selection without line numbers in file source view
>>
>> File code is presented as HTML ordered list, so that
>> line numbers are not selected with the code itself.
>>
>> After this patch there is no ability to get a link to a line,
>> (however, they work). This will be added later.
>>
>> This patch changes the visual appearance of the source a little:
>> - line numbers have dots after them
>> - line numbers don't have the stripey background
>> - 'line source' heading above the source lines removed
>> - line numbers and lines have a vertical line between them
>>    for better distinction
>>
>> diff -r 7a4e0ab91bcc -r ebe1b1670125
>> mercurial/templates/paper/filerevision.tmpl
>> --- a/mercurial/templates/paper/filerevision.tmpl       Wed Jun 26
>> 12:41:21 2013 +0400
>> +++ b/mercurial/templates/paper/filerevision.tmpl       Tue Jun 25
>> 21:10:21 2013 +0400
>> @@ -67,8 +67,10 @@
>>   </table>
>>     <div class="overflow">
>> -<div class="sourcefirst"> line source</div>
>> +<div class="sourcefirst"></div>
>> +<ol class="sourcelines">
>>   {text%fileline}
>> +</ol>
>>   <div class="sourcelast"></div>
>>   </div>
>>   </div>
>> diff -r 7a4e0ab91bcc -r ebe1b1670125 mercurial/templates/paper/map
>> --- a/mercurial/templates/paper/map     Wed Jun 26 12:41:21 2013 +0400
>> +++ b/mercurial/templates/paper/map     Tue Jun 25 21:10:21 2013 +0400
>> @@ -72,7 +72,7 @@
>>   filecomparison = filecomparison.tmpl
>>   filelog = filelog.tmpl
>>   fileline = '
>> -  <div class="parity{parity} source"><a href="#{lineid}"
>> id="{lineid}">{linenumber}</a> {line|escape}</div>'
>> +  <li class="parity{parity} source"
>> id="{lineid}"><div>{strip(line|escape, '\n')}{ifeq(strip(line, '\n'), '', '
>> ', '')}</div></li>'
>>   filelogentry = filelogentry.tmpl
>>     annotateline = '
>> diff -r 7a4e0ab91bcc -r ebe1b1670125
>> mercurial/templates/static/style-paper.css
>> --- a/mercurial/templates/static/style-paper.css        Wed Jun 26
>> 12:41:21 2013 +0400
>> +++ b/mercurial/templates/static/style-paper.css        Tue Jun 25
>> 21:10:21 2013 +0400
>> @@ -209,6 +209,38 @@
>>   .source a { color: #999; font-size: smaller; font-family: monospace;}
>>   .bottomline { border-bottom: 1px solid #999; }
>>   +div.source, td.source { padding: 1px 4px; }
>> +
>> +ol.sourcelines {
>> +  background-color: #eee;
>> +  font-size: 90%;
>> +  margin: 0;
>> +  padding-left: 50px;
>> +}
>> +
>> +li.source {
>> +  -moz-user-select: -moz-none;
>> +  -khtml-user-select: none;
>> +  -webkit-user-select: none;
>> +  -ms-user-select: none;
>> +  user-select: none;
>> +  color: #999;
>> +  padding: 0 5px;
>> +}
>> +
>> +li.source div {
>> +  -moz-user-select: text;
>> +  -khtml-user-select: text;
>> +  -webkit-user-select: text;
>> +  -ms-user-select: text;
>> +  user-select: text;
>> +  padding: 1px 5px;
>> +  border-left: 1px solid #ccc;
>> +  margin: 0 0 0 -7px;
>> +  color: #000;
>> +  font-size: 111%;
>> +}
>> +
>>   .fileline { font-family: monospace; }
>>   .fileline img { border: 0; }
>>   _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel
>>
>


More information about the Mercurial-devel mailing list