Skip to content

Add copy-to-clipboard element for upload/download lists.#1099

Open
ArneBab wants to merge 11 commits intohyphanet:nextfrom
ArneBab:add-copy-to-clipboard-element-for-the-queues
Open

Add copy-to-clipboard element for upload/download lists.#1099
ArneBab wants to merge 11 commits intohyphanet:nextfrom
ArneBab:add-copy-to-clipboard-element-for-the-queues

Conversation

@ArneBab
Copy link
Copy Markdown
Contributor

@ArneBab ArneBab commented Aug 17, 2025

The title text currently cannot be internationalized, because I wanted to keep the initialization out of the Toadlets.

Copy link
Copy Markdown
Contributor

@bertm bertm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature-wise this is nice, the implementation could use some additional care.

Comment thread src/freenet/clients/http/QueueToadlet.java
Comment thread src/freenet/clients/http/staticfiles/js/clipboard.js Outdated
Comment thread src/freenet/clients/http/staticfiles/js/clipboard.js Outdated
Comment thread src/freenet/clients/http/staticfiles/js/clipboard.js Outdated
Comment thread src/freenet/clients/http/staticfiles/js/clipboard.js Outdated
Comment thread src/freenet/clients/http/staticfiles/js/clipboard.js Outdated
Comment thread src/freenet/clients/http/staticfiles/themes/boxed/color.css
@Bombe
Copy link
Copy Markdown
Contributor

Bombe commented Aug 30, 2025

The title text currently cannot be internationalized, because I wanted to keep the initialization out of the Toadlets.

That can totally be worked around by putting the translated texts into an invisbile <div> somewhere on the page, and letting the javascript read the <div>s. 🙂

@ArneBab
Copy link
Copy Markdown
Contributor Author

ArneBab commented Apr 25, 2026

@bertm @Bombe Thank you for your review (despite the not so great shape of the code)!

I addressed all comments now:

  • The script only runs once, regardless of how often it is included
  • The icon is now the inline SVG by bertm
  • the title is from the toadlet and localizable (via dataset.copytitle).
  • it can’t be selected and the cursor is set as pointer

I left out the spacing adjustments because they were not needed with the SVG.

The SVG is added via innerHTML, but as static data, so it does not pose a risk (no escaping necessary).

Can you give this another look?

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.

3 participants