sapling/mercurial/templates/paper
Denis Laxalde e4402fa19c hgweb: re-implement followlines UI selection using buttons
This changeset attempts to solve two issues with the "followlines" UI in
hgweb. First the "followlines" action is currently not easily discoverable
(one has to hover on a line for some time, wait for the invite message to
appear and then perform some action). Second, it gets in the way of natural
line selection, especially in filerevision view.

This changeset introduces an additional markup element (a <button
class="btn-followlines">) alongside each content line of the view. This button
now holds events for line selection that were previously plugged onto content
lines directly. Consequently, there's no more action on content lines, hence
restoring the "natural line selection" behavior (solving the second problem).
These buttons are hidden by default and get displayed upon hover of content
lines; then upon hover of a button itself, a text inviting followlines section
shows up. This solves the first problem (discoverability) as we now have a
clear visual element indicating that "some action could be perform" (i.e. a
button) and that is self-documented.

In followlines.js, all event listeners are now attached to these <button>
elements. The custom "floating tooltip" element is dropped as <button>
elements are now self-documented through a "title" attribute that changes
depending on preceding actions (selection started or not, in particular).

The new <button> element is inserted in followlines.js script (thus only
visible if JavaScript is activated); it contains a "+" and "-" with a
"diff-semantics" style; upon hover, it scales up.

To find the parent element under which to insert the <button> we either rely
on the "data-selectabletag" attribute (which defines the HTML tag of children
of class="sourcelines" element e.g. <span> for filerevision view and <tr> for
annotate view) or use a child of the latter elements if we find an element
with class="followlines-btn-parent" (useful for annotate view, for which we
have to find the <td> in which to insert the <button>).

On noticeable change in CSS concerns the "margin-left" of span:before
pseudo-elements in filelog view that has been increased a bit in order to
leave space for the new button to appear between line number column and
line content one.
Also note the "z-index" addition for "annotate-info" box so that the latter
appears on top of new buttons (instead of getting hidden).

In some respect, the UI similar to line commenting feature that is implemented
in popular code hosting site like GitHub, BitBucket or Kallithea.
2017-07-03 13:49:03 +02: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: plug followlines action in annotate view 2017-06-21 17:17:17 +02: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: re-implement followlines UI selection using buttons 2017-07-03 13:49:03 +02: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