8000 Replace SWF clippy with clipboardjs on repository page by flaix · Pull Request #1438 · gitblit-org/gitblit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace SWF clippy with clipboardjs on repository page #1438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

flaix
Copy link
Member
@flaix flaix commented Nov 20, 2022

Replace the outdated and broken Shockwave Flash way of copying text to the browser clip board with a modern JavaScript approach. This introduces the JS library clipboardjs.

There is some visual feedback in form of a tooltip. While this works fine for the main repository URL, it is less so for the copy buttons in the drop-down menus. The tool tip is attached to a element higher in the hierarchy so that it gets shown. But the height seems to be restricted, so the tooltip doesn't have the proper padding.

Shockwave Flash is dead. But Gitblit still uses it to copy the repository
URLs to the clip board. Which doesn't work anymore since no browser uses
Flash anymore, so this has degraded disgracefully.

Instead, we can use JavaScript to copy directly to the clipboard, now
that there are APIs for it. So replace the use of clippy.swf on the
repository page with clipboard.js[1]. This right now only has the
functionality to copy to clipboard but now visual feedback, yet.

This addresses GH issue gitblit-org#1241.

[1] https://clipboardjs.com
@flaix flaix marked this pull request as ready for review November 21, 2022 20:16
@flaix flaix linked an issue Nov 21, 2022 that may be closed by this pull request
@flaix flaix added this to the 1.10.0 milestone Nov 22, 2022
This is not the ideal version, since the height is too low for the tooltip
used for the drop-down menus. Probably has something to do with the
container or something. But at least something is there now, even if
not the most beautiful.
The ticket page also has some copy-to-clipboard buttons, which get
updated to work with JS instead of SWF.
The `clippy.swf` Flash program is no longer needed and can be deleted.
The configuration property is now incorrectly named, but we keep the
name and update the documentation. Maybe it could be completely deleted
one day, when the clipboard.js solution is known to work and be universally
supported.
@flaix flaix closed this Dec 5, 2022
@flaix flaix deleted the clipboardjs branch December 5, 2022 17:10
@flaix
Copy link
Member Author
flaix commented Dec 5, 2022

Has been merged. Status closed is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy repository url to clipboard with JS
1 participant
0