sapling/mercurial/templates/paper
Gregory Szorc 28b7db089e hgweb: add HTML elements to control whitespace settings for annotate
Building on top of the new URL query string arguments to control
whitespace settings for annotate, this commit adds HTML checkboxes
reflecting the values of these arguments to the paper and gitweb
themes.

The actual diff settings are now exported to the templating layer.
The HTML templates add these as data-* attributes so they are
accessible to the DOM.

A new <form> with various <input> elements is added. The <form>
is initially hidden via CSS. A shared JavaScript function (which
runs after the <form> has been rendered but before the annotate
HTML (because annotate HTML could take a while to load and we want
the form to render quickly) takes care of setting the checked state
of each box from the data-* attributes. It also registers an event
handler to modify the URL and refresh the page whenever the checkbox
state is changed.

I'm using the URLSearchParams interface to perform URL manipulation.
https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams tells
me this may not be supported on older web browsers. Yes, apparently
the web API didn't have a standard API to parse and format query
strings until recently. Hence the check for the presence of this
feature in the JavaScript. If the browser doesn't support the
feature, the <form> will remain hidden and behavior will like it
currently is. We could polyfill this feature or implement our own
query string parsing. But I'm lazy and this could be done as a
follow-up if people miss it.

We could certainly expand this feature to support more diff options
(such as lines of context). That's why the potentially reusable code
is stored in a reusable place. It is also certainly possible to
add diff controls to other pages that display diffs. But since
Mozillians are making noise about controlling which revisions
annotate shows, I figured I'd start there.

.. feature::

   Control whitespace settings for annotation on hgweb

   /annotate URLs on hgweb now accept query string arguments to
   influence how whitespace changes impact results.

   The arguments "ignorews," "ignorewsamount," "ignorewseol," and
   "ignoreblanklines" now have the same meaning as their [annotate]
   config section counterparts. Any provided setting overrides the
   server default.

   HTML checkboxes have been added to the paper and gitweb themes
   to expose current whitespace settings and to easily modify the
   current view.

Differential Revision: https://phab.mercurial-scm.org/D850
2017-09-30 09:01:36 +01:00
..
bookmarks.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
branches.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
changeset.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
diffstat.tmpl hgweb: make stripes in diffstat with CSS 2013-07-13 18:06:57 +04:00
error.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
fileannotate.tmpl hgweb: add HTML elements to control whitespace settings for annotate 2017-09-30 09:01:36 +01:00
filecomparison.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
filediff.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
filelog.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
filelogentry.tmpl hgweb: add a "patch" query parameter to filelog command 2017-03-13 10:41:13 +01:00
filerevision.tmpl hgweb: parameterize the tag name of elements holding followlines selection 2017-06-21 17:07:51 +02:00
footer.tmpl hgweb: call process_dates() via DOM event listener 2017-01-10 20:47:48 -08:00
graph.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
header.tmpl hgweb: urlescape all urls, HTML escape repo/tag/branch/... names 2013-02-01 20:43:35 +01:00
help.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
helptopics.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
index.tmpl hgweb: replace implicit <tbody> with explicit <thead> where appropriate 2015-02-06 15:52:55 +08:00
manifest.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
map hgweb: add HTML elements to control whitespace settings for annotate 2017-09-30 09:01:36 +01:00
notfound.tmpl hgweb: urlescape all urls, HTML escape repo/tag/branch/... names 2013-02-01 20:43:35 +01:00
search.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
shortlog.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00
shortlogentry.tmpl hgweb: split some long lines in paper, gitweb and monoblue styles 2015-05-15 02:07:43 +08:00
tags.tmpl hgweb: consolidate search form for paper 2017-06-09 13:59:13 -07:00