[PATCH 12 of 20] hgweb, paper: add shortlogajax template and use it

Alexander Plavin alexander at plav.in
Wed Aug 14 05:51:24 CDT 2013



14.08.2013, 08:24, "Kevin Bullock" <kbullock+mercurial at ringworld.org>:
> On 13 Aug 2013, at 3:44 AM, Alexander Plavin wrote:
>
>>  13.08.2013, 12:30, "Martin Geisler" <martin at geisler.net>:
>>>  Another thought that occured to me when I read the discussion about
>>>  writing an XML style: have you considered writing a JSON style instead?
>>>  That might be even more useful for JavaScript code.
>>  In this application (I mean infinite scrolling) json style doesn't give any differences/benefits to xml one, as we would have to render the templates in JS anyway. The only difference for future uses in javascript is using xfr.responsexml vs json.parse(xfr.responsetext). So, this variants are about equivalent and one of them just has to be chosen.
>>  However, I don't know what will be best here, and would like to hear more opinions on this.
>
> I'd lean towards JSON as well. There are solid, widely-available parsers for both, but JSON is generally more compact, and more widely used by newer client-side libraries.

Ok, the overall opinion seems clear - everyone prefers json :)

This patch doesn't contain xml style, however it uses xml output (namely, shortlogajax template). It's possible to replace this with json, but there is a templating issue which I didn't manage to overcome: we need to express something like {entries % shortlogentry | escape}, but this doesn't work. I also tried some other variants to write such thing, with no success. Any ideas how to do this?

On the other hand, I thought a bit more about Matt's suggestion to use the same template as is for normal shortlog page. Actually, the only thing needed to add is the id number of the last revision, which can be added as an html/js comment like '<< 1234 >>'. What do you think about this variant?

>
> pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
> Kevin R. Bullock


More information about the Mercurial-devel mailing list