[PATCH 2 of 2] paper: call ajaxScrollInit in shortlog

Alexander Plavin alexander at plav.in
Thu Sep 19 03:29:28 CDT 2013



19.09.2013, 10:59, "Martin Geisler" <martin at geisler.net>:
> Alexander Plavin <alexander at plav.in> writes:
>
>>  # HG changeset patch
>>  # User Alexander Plavin <alexander at plav.in>
>>  # Date 1378459857 -14400
>>  #      Fri Sep 06 13:30:57 2013 +0400
>>  # Node ID 0032f7b54b7bb23b35574f774d37ba763a8e5199
>>  # Parent  0a792989e90204557812427f02ba2f176f08d8c1
>>  paper: call ajaxScrollInit in shortlog
>>
>>  This just calls ajaxScrollInit at the shortlog page template with all needed
>>  agruments. So, infinite scrolling is working now there.
>>
>>  diff -r 0a792989e902 -r 0032f7b54b7b mercurial/templates/paper/shortlog.tmpl
>>  --- a/mercurial/templates/paper/shortlog.tmpl Wed Sep 18 22:44:12 2013 +0400
>>  +++ b/mercurial/templates/paper/shortlog.tmpl Fri Sep 06 13:30:57 2013 +0400
>>  @@ -71,6 +71,18 @@
>>   | rev {rev}: {changenav%navshort}
>>   </div>
>>
>>  +<script type="text/javascript">
>>  +    ajaxScrollInit(
>>  +            '{url|urlescape}shortlog/%hash%',
>>  +            '{nextentry%"{node}"}', <!-- NEXTHASH
>
> I'm missing something here... This HTML comment looks unclosed to me?
> Would '//' not be more appropriate for a comment inside JavaScript?

It's valid JS code, such one-line comments are allowed (look http://www.javascripter.net/faq/comments.htm for example). I used '<!--' instead of '//' because with '//' it's possible (through very unlikely) that such sequence (like "'abc', // NEXTHASH") appears in a commit message, but the same is impossible for '<!--' as '<' is always replaced with corresponding html entity on the page.

>
> --
> Martin Geisler


More information about the Mercurial-devel mailing list