This adds a small css class, and a clientside js function plus
event registrations in cgit.js, to interpret the # part of the
URL on the client, and apply a highlight to filtered source.
Unlike blame highlight boxes which use generated divs, this
applies a computed absolutely-positioned, transpare
Instead of following the browser heuristic to put any matching
id element to the top left of the browser window, compute the
number of visible lines vertically in the window, and the
middle of the highlit range, and try to centre the middle of
the highlit range in the window.
If the top of the ran
Browser default interpretation of the # part of the URL is
to try to match it to an element ID one time at page load.
Subsequent modifications in the URL bar are ignored, even if
you hit enter there.
This patch makes the line range highlight able to clean up
after itself and be reapplied, and has
This allows the user to select line ranges simply by clicking on the
line number links.
- No selected highlit line, or a range already selected, causes the
click to highlight just the clicked line as usual.
- Clicking on a second line number link when a single line was already
highlit creates a
Just like the config allows setting css URL path,
add a config for setting the js URL path
Setting the js path to an empty string disables
emitting the reference to it in the head section.
Signed-off-by: Andy Green
Reviewed-by: John Keeping
---
Makefile |1 +
cgit.c |3 +++
c
Clicking on the line numbers to control the highlight
now causes a clipboard icon to appear to the left of
the line for 5s.
Clicking this will copy the highlight URL to the
clipboard, and cause the icon to grow, blur and
fade to acknowledge the click.
After 5s the clipboard icon will fade out...
The following series adds the ability to direct the browser
to highlight specific lines and ranges of lines in
/tree/, /source/, and /blame/ views, using the existing
#URLs.
As part of the implementation it adds a new cgit.js file
that is included in cgit page along with a new
config "js" to spec
On 06/24/2018 07:35 PM, John Keeping wrote:
On Sun, Jun 24, 2018 at 10:44:49AM +0800, Andy Green wrote:
This allows the user to select line ranges simply by clicking on the
line number links.
- No selected highlit line, or a range already selected, causes the
click to highlight just the cl
On 06/24/2018 07:28 PM, John Keeping wrote:
The subject is "ui-shared: ..." but should be "cgit.js" now I think.
On Sun, Jun 24, 2018 at 10:44:34AM +0800, Andy Green wrote:
diff --git a/cgit.js b/cgit.js
index e69de29..501c98f 100644
--- a/cgit.js
+++ b/cgit.js
@@ -0,0 +1,53 @@
+function cgi
On June 25, 2018 12:03:56 AM GMT+08:00, John Keeping wrote:
>On Sun, Jun 24, 2018 at 11:06:45PM +0800, Andy Green wrote:
>> On June 24, 2018 9:39:35 PM GMT+08:00, John Keeping
> wrote:
>> >On Sun, Jun 24, 2018 at 08:00:08PM +0800, Andy Green wrote:
>> >> On June 24, 2018 7:42:33 PM GMT+08:00, J
On June 25, 2018 6:58:06 AM GMT+08:00, Christian Hesse wrote:
>John Keeping 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
John Keeping 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.)
--
main(a){char*c=/*
On Sun, Jun 24, 2018 at 11:06:45PM +0800, Andy Green wrote:
> On June 24, 2018 9:39:35 PM GMT+08:00, John Keeping
> wrote:
> >On Sun, Jun 24, 2018 at 08:00:08PM +0800, Andy Green wrote:
> >> On June 24, 2018 7:42:33 PM GMT+08:00, John Keeping
> > wrote:
> >> >On Sun, Jun 24, 2018 at 10:44:54AM +0
On June 24, 2018 9:39:35 PM GMT+08:00, John Keeping wrote:
>On Sun, Jun 24, 2018 at 08:00:08PM +0800, Andy Green wrote:
>>
>>
>> On June 24, 2018 7:42:33 PM GMT+08:00, John Keeping
> wrote:
>> >On Sun, Jun 24, 2018 at 10:44:54AM +0800, Andy Green wrote:
>> >> Since the only reason to click on
On Sun, Jun 24, 2018 at 08:00:08PM +0800, Andy Green wrote:
>
>
> On June 24, 2018 7:42:33 PM GMT+08:00, John Keeping
> wrote:
> >On Sun, Jun 24, 2018 at 10:44:54AM +0800, Andy Green wrote:
> >> Since the only reason to click on the line number links
> >> is to get the corresponding #URL to sha
On June 24, 2018 7:52:53 PM GMT+08:00, John Keeping wrote:
>Subject should be "cgit.js: " not cgit.css!
>
>On Sun, Jun 24, 2018 at 03:59:51PM +0800, Andy Green wrote:
>> This patch updates the emitted "ages" dynamically on the client side.
>>
>> After updating on completion of the document loa
On June 24, 2018 7:42:33 PM GMT+08:00, John Keeping wrote:
>On Sun, Jun 24, 2018 at 10:44:54AM +0800, Andy Green wrote:
>> Since the only reason to click on the line number links
>> is to get the corresponding #URL to share, this patch
>> makes that process more convenient by copying the
>> hig
Subject should be "cgit.js: " not cgit.css!
On Sun, Jun 24, 2018 at 03:59:51PM +0800, Andy Green wrote:
> This patch updates the emitted "ages" dynamically on the client side.
>
> After updating on completion of the document load, it sets a timer
> to update according to the smallest age it found
On Sun, Jun 24, 2018 at 10:44:54AM +0800, Andy Green wrote:
> Since the only reason to click on the line number links
> is to get the corresponding #URL to share, this patch
> makes that process more convenient by copying the
> highlit area, be it a single line or a range, to the
> clipboard on eac
On Sun, Jun 24, 2018 at 10:44:49AM +0800, Andy Green wrote:
> This allows the user to select line ranges simply by clicking on the
> line number links.
>
> - No selected highlit line, or a range already selected, causes the
> click to highlight just the clicked line as usual.
>
> - Clicking on
The subject is "ui-shared: ..." but should be "cgit.js" now I think.
On Sun, Jun 24, 2018 at 10:44:34AM +0800, Andy Green wrote:
> diff --git a/cgit.js b/cgit.js
> index e69de29..501c98f 100644
> --- a/cgit.js
> +++ b/cgit.js
> @@ -0,0 +1,53 @@
> +function cgit_line_range_highlight()
> +{
> +
On Sun, Jun 24, 2018 at 10:44:29AM +0800, Andy Green wrote:
> Just like the config allows setting css URL path,
> add a config for setting the js URL path
>
> Setting the js path to an empty string disables
> emitting the reference to it in the head section.
>
> Signed-off-by: Andy Green
For th
This patch updates the emitted "ages" dynamically on the client side.
After updating on completion of the document load, it sets a timer
to update according to the smallest age it found. If there are any
ages listed in minutes, then it will update again in 10s (this can
never happen more than twe
23 matches
Mail list logo