[PATCH] cgit.css: add dynamic age update

Andy Green andy at warmcat.com
Mon Jun 25 02:15:14 CEST 2018



On June 25, 2018 6:58:06 AM GMT+08:00, Christian Hesse <list at eworm.de> wrote:
>John Keeping <john at keeping.me.uk> on Sun, 2018/06/24 12:52:
>> I'd really like to here other people's opinions on this.
>
>I like this change, but we should keep js optional and not break
>existing
>functionality without it. (I did not look at the code, but discussion
>sounds
>like it is good as-is.)

Yes, the only change to the C is one line that adds the unix time like ut=1234567 as an attribute in the span containing the age, because no nice reliable way to eat the formatted datetime already there in the tooltip.  If no JS (sending that can be manually disabled by "js=" in the global conf, per John's suggestion), or it's disabled in browser, the server-generated age is shown static as today.

Same goes for the line range highlight, it devolves to what is there today, no highlights and no ranges, no clipboard, but you can scrape from the URL bar, and relies on browser native logic to scroll to the id after the # one time.

I think generally there can't be feature parity without JS, eg the line range stuff can only be done client-side.  But the new JS features should always cleanly disappear if no JS, with features no worse than today, or it's a bug.

-Andy


More information about the CGit mailing list