Mercurial > hg
comparison mercurial/templates/static/style-paper.css @ 31758:04ec317b8128
hgweb: expose a followlines UI in filerevision view
In filerevision view (/file/<rev>/<fname>) we add some event listeners on
mouse clicks of <span> elements in the <pre class="sourcelines"> block.
Those listeners will capture a range of lines selected between two mouse
clicks and a box inviting to follow the history of selected lines will then
show up. Selected lines (i.e. the block of lines) get a CSS class which make
them highlighted. Selection can be cancelled (and restarted) by either
clicking on the cancel ("x") button in the invite box or clicking on any other
source line. Also clicking twice on the same line will abort the selection and
reset event listeners to restart the process.
As a first step, this action is only advertised by the "cursor: cell" CSS rule
on source lines elements as any other mechanisms would make the code
significantly more complicated. This might be improved later.
All JavaScript code lives in a new "linerangelog.js" file, sourced in
filerevision template (only in "paper" style for now).
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Wed, 29 Mar 2017 22:26:16 +0200 |
parents | 8f34e217338b |
children | 02eb52e9d413 |
comparison
equal
deleted
inserted
replaced
31757:473f2fcc7629 | 31758:04ec317b8128 |
---|---|
278 | 278 |
279 .sourcelines > span:target, tr:target td { | 279 .sourcelines > span:target, tr:target td { |
280 background-color: #bfdfff; | 280 background-color: #bfdfff; |
281 } | 281 } |
282 | 282 |
283 div.overflow pre.sourcelines > span:hover { | |
284 cursor: cell; | |
285 } | |
286 | |
287 pre.sourcelines > span.followlines-selected { | |
288 background-color: #99C7E9; | |
289 } | |
290 | |
291 div#followlines { | |
292 background-color: #B7B7B7; | |
293 border: 1px solid #CCC; | |
294 border-radius: 5px; | |
295 padding: 4px; | |
296 position: absolute; | |
297 } | |
298 | |
299 div.followlines-cancel { | |
300 text-align: right; | |
301 } | |
302 | |
303 div.followlines-cancel > button { | |
304 line-height: 80%; | |
305 padding: 0; | |
306 border: 0; | |
307 border-radius: 2px; | |
308 background-color: inherit; | |
309 font-weight: bold; | |
310 } | |
311 | |
312 div.followlines-cancel > button:hover { | |
313 color: #FFFFFF; | |
314 background-color: #CF1F1F; | |
315 } | |
316 | |
317 div.followlines-link { | |
318 margin: 2px; | |
319 margin-top: 4px; | |
320 font-family: sans-serif; | |
321 } | |
322 | |
283 .sourcelines > a { | 323 .sourcelines > a { |
284 display: inline-block; | 324 display: inline-block; |
285 position: absolute; | 325 position: absolute; |
286 left: 0px; | 326 left: 0px; |
287 width: 4em; | 327 width: 4em; |