sapling/mercurial/templates
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
..
atom hgweb: reindent atom/changelogentry.tmpl 2016-06-29 22:48:32 +08:00
coal coal: use inheritance to derive from paper 2016-08-17 13:43:13 -05:00
gitweb hgweb: re-implement followlines UI selection using buttons 2017-07-03 13:49:03 +02:00
json hgweb: expose list of per-repo labels to templates 2016-06-30 18:59:53 -07:00
monoblue hgweb: consolidate search form for monoblue 2017-06-09 13:41:10 -07:00
paper hgweb: re-implement followlines UI selection using buttons 2017-07-03 13:49:03 +02:00
raw hgweb: replace 'shortlog' with 'changelog' in raw changelog template 2013-08-16 21:41:19 +04:00
rss hgweb: add missing slash to file log url in rss style 2016-12-08 23:59:36 +08:00
spartan hgweb: support Content Security Policy 2017-01-10 23:37:08 -08:00
static hgweb: re-implement followlines UI selection using buttons 2017-07-03 13:49:03 +02:00
map-cmdline.bisect map-cmdline.bisect: rewrite to just %include the default template 2015-05-10 13:48:10 -04:00
map-cmdline.changelog setup: install translation files as package data 2009-12-01 16:06:10 +01:00
map-cmdline.compact compact: add color labels to -Tcompact 2016-04-08 16:05:52 +00:00
map-cmdline.default templates: shorten definition of changeset labels in command-line style 2017-03-28 22:38:45 +02:00
map-cmdline.phases template-phases: extend default style instead of duplicating it 2015-04-25 21:42:07 +09:00
map-cmdline.show show: implement "stack" view 2017-07-01 22:38:42 -07:00
map-cmdline.status log: fix status template to list copy source per dest (issue5155) 2016-03-24 22:55:56 +09:00
map-cmdline.xml templater: add new docheader/footer components for XML (issue4135) 2015-08-26 16:27:14 -05:00