Re: [PATCH v4 1/6] config: add js

2018-06-26 Thread Christian Hesse
Andy Green on Mon, 2018/06/25 13:49: > 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

[PATCH v2 1/2] gcc8.1: fix strncpy bounds warnings

2018-06-26 Thread Andy Green
These warnings are coming on default Fedora 28 build and probably others using gcc 8.1 ../shared.c: In function ‘expand_macro’: ../shared.c:483:3: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=] strncpy(name, value, len);

[PATCH v5-ninjaedit] line-range-highlight: onclick handler and range selection

2018-06-26 Thread Andy Green
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

[PATCH v5 1/6] config: add js

2018-06-26 Thread Andy Green
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 +++

[PATCH v5 0/6] line range highlight

2018-06-26 Thread Andy Green
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

[PATCH v5 3/6] cgit.js: line range highlight: make responsive to url changes

2018-06-26 Thread Andy Green
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

[PATCH v5 6/6] line-range-highlight: copy URL to clipboard UI

2018-06-26 Thread Andy Green
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...

[PATCH v2 2/2] cgit_repobasename: convert to allocated result

2018-06-26 Thread Andy Green
cgit_repobasename has one user also in ui-shared.c. Make it static and remove the declaration from cgit.h. Instead of the gnarly return pointer to now deallocated stack, compute the valid part of the string using the incoming pointer, then just allocate the right amount and copy it in. Drop the

[PATCH v2 0/2] gcc8.1: fix strncpy bounds warnings

2018-06-26 Thread Andy Green
These patches fix warnings blown by gcc8.1 about strncpy usage. The first patch is the first part of v1 that got a confusing reception the first time. But I think in the end no objection to it. In the second version, I follow John's suggestion and go further refactoring the affected functions.