-
Notifications
You must be signed in to change notification settings - Fork 237
Add copy-to-clipboard element for upload/download lists. #1099
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
Open
ArneBab
wants to merge
11
commits into
hyphanet:next
Choose a base branch
from
ArneBab:add-copy-to-clipboard-element-for-the-queues
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6dae804
Add copy-to-clipboard element for upload/download lists.
ArneBab 21bcbdf
js style: space before ( in function definition, ' for strings
ArneBab 68e22ba
js: use .after() instead of .parentElement.appendChild()
ArneBab 34f8037
Ensure that addCopyKeyFieldToFinishedTransfers runs only once
ArneBab 8aa9f16
Use inline SVG as copy-to-clipboard image
ArneBab afadefa
Get the link title from the toadlet
ArneBab c1d2a70
Make copy to clipboard title localizable
ArneBab 3833a36
fix: use const to define the key data to avoid scoping problems
ArneBab bd6f4a8
refactor: rename class to general copy-to-clipboard
ArneBab ac61a6d
Prevent selecting copy-to-clipboard-element and set cursor: pointer
ArneBab 5ce3aea
don’t check for the availability of the navigator field
ArneBab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,3 +431,9 @@ div#statusbar div.separator { | |
| } | ||
|
|
||
|
|
||
|
|
||
| .copy-to-clipboard-element:active { | ||
| color: red; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later | ||
| function addCopyKeyFieldToFinishedTransfers() { | ||
| if (navigator && navigator.clipboard) { | ||
|
ArneBab marked this conversation as resolved.
Outdated
|
||
| var matching = document.getElementsByClassName("finished_key_link"); | ||
|
ArneBab marked this conversation as resolved.
Outdated
|
||
| for (var matchingElement of matching) { | ||
| var key = matchingElement.dataset.key; | ||
| if (key) { | ||
| var toClipboard = document.createElement("span"); | ||
| toClipboard.textContent = " ⎘"; | ||
|
ArneBab marked this conversation as resolved.
Outdated
ArneBab marked this conversation as resolved.
Outdated
|
||
| toClipboard.classList.add("copy-to-clipboard-element"); | ||
| toClipboard.setAttribute("title", "Copy to Clipboard"); | ||
| toClipboard.onclick=() => navigator.clipboard.writeText(key); | ||
| matchingElement.parentElement.appendChild(toClipboard); | ||
|
ArneBab marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
| } | ||
| } | ||
| document.addEventListener("DOMContentLoaded", addCopyKeyFieldToFinishedTransfers); | ||
| // @license-end | ||
|
ArneBab marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,3 +59,9 @@ | |
| /* | ||
| * Statusbar | ||
| */ | ||
|
|
||
| .copy-to-clipboard-element:active { | ||
| color: red; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.