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
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 each click of the line number links.
Signed-off-by: Andy Green
---
cgi
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
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 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
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
---
Makefile |1 +
cgit.c |3 +++
cgit.h |1 +
cgit.
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/23/2018 06:17 PM, John Keeping wrote:
On Thu, Jun 21, 2018 at 05:34:59PM +0800, Andy Green wrote:
This adds a small css class, a clientside js function in
cgit.js, and ajs inline script caller in ui-shared
functions to interpret the # part of the URL
on the client, and apply a highlight
On Sat, Jun 23, 2018 at 07:08:08PM +0800, Andy Green wrote:
>
>
> On 06/23/2018 06:53 PM, John Keeping wrote:
> > On Sat, Jun 23, 2018 at 06:33:38PM +0800, Andy Green wrote:
> >>
> >>
> >> On 06/23/2018 06:28 PM, John Keeping wrote:
> >>> On Thu, Jun 21, 2018 at 02:46:47PM +0800, Andy Green wrote
On 06/23/2018 07:04 PM, John Keeping wrote:
On Wed, Jun 20, 2018 at 06:11:57PM +0800, Andy Green wrote:
The following series adds config to allow rendering of
selected READMEs inline after the tree view, where
present in the directory being viewed.
Particularly you can use completely relativ
On 06/23/2018 06:53 PM, John Keeping wrote:
On Sat, Jun 23, 2018 at 06:33:38PM +0800, Andy Green wrote:
On 06/23/2018 06:28 PM, John Keeping wrote:
On Thu, Jun 21, 2018 at 02:46:47PM +0800, Andy Green wrote:
Where root-desc and repo.desc are used in the header region, also
emit their html
On Wed, Jun 20, 2018 at 06:11:57PM +0800, Andy Green wrote:
> The following series adds config to allow rendering of
> selected READMEs inline after the tree view, where
> present in the directory being viewed.
>
> Particularly you can use completely relative markdown to
> inline pictures served f
On Sat, Jun 23, 2018 at 06:33:38PM +0800, Andy Green wrote:
>
>
> On 06/23/2018 06:28 PM, John Keeping wrote:
> > On Thu, Jun 21, 2018 at 02:46:47PM +0800, Andy Green wrote:
> >> Where root-desc and repo.desc are used in the header region, also
> >> emit their html counterparts afterwards if they
On Wed, Jun 20, 2018 at 09:17:00PM +0800, Andy Green wrote:
> noheader=1 stops the static page header from being emitted by
> cgit, but along with that, the small form that lets the user
> change branch context on the page is also lost.
>
> This isn't actually static since it contains a dynamic li
On 06/23/2018 06:20 PM, John Keeping wrote:
On Thu, Jun 21, 2018 at 05:34:49PM +0800, Andy Green wrote:
Just like the config allows setting css URL path,
add a config for setting the js URL path
Signed-off-by: Andy Green
---
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 99fc799..a692aa5 10
On 06/23/2018 06:28 PM, John Keeping wrote:
On Thu, Jun 21, 2018 at 02:46:47PM +0800, Andy Green wrote:
Where root-desc and repo.desc are used in the header region, also
emit their html counterparts afterwards if they are defined.
Where root-desc are repo.desc are used outside the header,
eg
On Thu, Jun 21, 2018 at 02:46:47PM +0800, Andy Green wrote:
> Where root-desc and repo.desc are used in the header region, also
> emit their html counterparts afterwards if they are defined.
>
> Where root-desc are repo.desc are used outside the header,
> eg in the repo list, leave it as it is wit
On Thu, Jun 21, 2018 at 05:34:49PM +0800, Andy Green wrote:
> Just like the config allows setting css URL path,
> add a config for setting the js URL path
>
> Signed-off-by: Andy Green
> ---
> diff --git a/cgitrc.5.txt b/cgitrc.5.txt
> index 99fc799..a692aa5 100644
> --- a/cgitrc.5.txt
> +++ b/cg
On Thu, Jun 21, 2018 at 05:34:54PM +0800, Andy Green wrote:
> Similar to how cgit.css is handled, we will also provide and
> reference a cgit.js for javascript from now on.
>
> Signed-off-by: Andy Green
> ---
I think we can merge this and the previous patch, along with the change
to output a
On Thu, Jun 21, 2018 at 05:34:59PM +0800, Andy Green wrote:
> This adds a small css class, a clientside js function in
> cgit.js, and ajs inline script caller in ui-shared
> functions to interpret the # part of the URL
> on the client, and apply a highlight to filtered source.
>
> Unlike blame hig
Since the user might add a # to a URL that didn't initially have one,
eg by clicking the line numbers, always register the hashchange listener.
Signed-off-by: Andy Green
---
cgit.js |4
ui-shared.c |5 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/cgit.js
21 matches
Mail list logo