RFR: JDK-8277420: Provide a way to copy the hyperlink to a doc element to the clipboard [v2]
Jorn Vernee
jvernee at openjdk.java.net
Mon May 23 19:44:47 UTC 2022
On Mon, 23 May 2022 19:09:41 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
>> This is a CSS/JavaScript only change to implement copy-to-clipboard functionality for all headers (`h1` - `h6`) that have an `id` attribute associated with them. The following element-attribute patterns are supported (using `<h2>` as an example):
>>
>> - `<section id="..."><h2>` (generated by javadoc)
>> - `<h2 id="...">` (commonly used)
>> - `<h2><a id="...">` (legacy)
>>
>> The change includes a consolidation of the CSS styles used to render copy-to-clipboard buttons, of which we have now three kinds: for snippets, for the link on the search page, and for headers. There is now a base CSS class called "copy" that defines the styles shared by all copy-to-clipboard buttons, and additional CSS properties for the concrete "subclasses".
>>
>> API docs generated with this change can be viewed here (top level files and java.base module):
>> http://cr.openjdk.java.net/~hannesw/8277420/api.02/
>
> Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix jquery selector for anchor within header
Thanks! The fixed version works fine for me as well.
> Regarding the size of the icon/button, it's true that it's on the smaller side. The reason is that I tried to fit it into the line size of the header both for visual and technical reasons (easier to size using relative rather than absolute measures). If it was any bigger, the header line height would increase when hovering over it. If it turns out that more people find it too small we can increase the size with a bit more work (absolute positioning and sizing).
I don't think the icon is too small. I just meant that the area where you needed to hover the mouse to make it appear seemed small. But, with your latest version it seems good to me, now that the copy button will show up when hovering anywhere on the line of the header.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8817
More information about the javadoc-dev
mailing list