[PATCH v2] web: Made elapsed time calculation dynamic (javascript).

Adrian Buehlmann adrian at cadifra.com
Thu Apr 28 11:01:39 CDT 2011


On 2011-04-28 10:03, Benoît Allard wrote:
> 
> 
> Adrian Buehlmann wrote:
>> On 2011-04-27 19:54, Kevin Gessner wrote:
>>> 2011/4/27 Adrian Buehlmann <adrian at cadifra.com>:
>>>> On 2011-04-27 11:21, Benoît Allard wrote:
>>>>> About the flickering, you are right Adrian that it occurs. I doubt I can
>>>>> do something about it, patch are welcome to fix this. I've been pointed
>>>>> on IRC toward using a DOM-ready event instead of the `window.onload`.
>>>>> This would replace the text in an earlier stage, even before rendering.
>>>>> Unfortunately, there is no portable way to use it. There are solutions
>>>>> involving jQuery, or domready [1] (a subset of jQuery). I'd be delighted
>>>>> to see patches that involve one of these accepted.
>>>> While I like the idea of calculating the ages on the client side, I fear
>>>> the flickering is pretty much a show stopper on this.
>>>>
>>>> So I think this flickering problem needs to be solved before this patch
>>>> should be taken.
>>> Another way to solve the flickering is to call `process_dates` at the
>>> bottom of the page (below all the elements that have a date). At this
>>> point the necessary DOM elements will be available to JS, so you
>>> wouldn't need to wait for either dom-ready or window.load.
>>
>> I offer to test that claim on Windows 7 with IE9, Google chrome and
>> Firefox 4 if Benoît provides a testpatch for this. It doesn't need to be
>> a fully polished patch yet.
>>
> 
> Thanks a lot Kevin ! Looks like it does it, I have to say that I'm 
> myself impressed. See enclosed bundle.
> 
> If it fits the bill, I'll update the testsuite again and resubmit. 
> Please let me know your degree of satisfaction Adrian (others are of 
> course also invited to look at it !).

I tried the dynamicago3a.hg bundle you sent.

No flicker in IE9, Google Chrome 11, Firefox 4.

So the flicker problem seems to be solved.

Another (possibly nitpickish) thing I started wondering (sorry for
mentioning this late):

Would it make sense to have the dates inside the html page in isodatesec
format or similar (e.g. "2009-08-18 13:00:13 +0200", see 'hg help
templating') instead of the current (example) "Tue Apr 26 14:42:14 2011
+0200"?

isodatesec looks like it might be a bit easier to parse and it's even a
little bit shorter (5 bytes per date).


More information about the Mercurial-devel mailing list