From 6dae8040b20649fb0a6a96433de9846f6844f5c9 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sun, 17 Aug 2025 18:38:00 +0200 Subject: [PATCH 01/11] Add copy-to-clipboard element for upload/download lists. --- src/freenet/clients/http/QueueToadlet.java | 9 ++++++++- .../clients/http/staticfiles/color.css | 6 ++++++ .../clients/http/staticfiles/js/clipboard.js | 19 +++++++++++++++++++ .../http/staticfiles/themes/boxed/color.css | 6 ++++++ .../http/staticfiles/themes/clean/color.css | 6 ++++++ .../staticfiles/themes/grayandblue/color.css | 6 ++++++ .../http/staticfiles/themes/sky/color.css | 6 ++++++ .../staticfiles/themes/winterfacey/theme.css | 6 ++++++ 8 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/freenet/clients/http/staticfiles/js/clipboard.js diff --git a/src/freenet/clients/http/QueueToadlet.java b/src/freenet/clients/http/QueueToadlet.java index bf3a29ee619..c0d9d98ac78 100644 --- a/src/freenet/clients/http/QueueToadlet.java +++ b/src/freenet/clients/http/QueueToadlet.java @@ -1979,7 +1979,11 @@ private HTMLNode createSizeCell(long dataSize, boolean confirmed, boolean advanc private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { HTMLNode keyCell = new HTMLNode("td", "class", "request-key"); if (uri != null) { - keyCell.addChild("span", "class", "key_is").addChild("a", "href", '/' + uri.toString() + (addSlash ? "/" : ""), uri.toShortString() + (addSlash ? "/" : "")); + keyCell.addChild("span", "class", "key_is") + .addChild("a", + new String[]{"class", "data-key", "href"}, + new String[]{"finished_key_link", uri.toString(), '/' + uri.toString() + (addSlash ? "/" : "")}, + uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); } @@ -2115,6 +2119,9 @@ private HTMLNode createRequestTable(PageMaker pageMaker, ToadletContext ctx, Lis HTMLNode formDiv = new HTMLNode("div", "class", "request-table-form"); HTMLNode form = ctx.addFormChild(formDiv, path(), "request-table-form-"+id+(advancedModeEnabled?"-advanced":"-simple")); + if (core.getNode().isFProxyJavascriptEnabled()) { + form.addChild("script", new String[] {"type", "src"}, new String[] {"text/javascript", "/static/js/clipboard.js"}); + } createRequestTableButtons(form, pageMaker, ctx, mimeType, hasFriends, advancedModeEnabled, priorityClasses, true, queueType); diff --git a/src/freenet/clients/http/staticfiles/color.css b/src/freenet/clients/http/staticfiles/color.css index 9c8dd3359b0..5063e67be06 100644 --- a/src/freenet/clients/http/staticfiles/color.css +++ b/src/freenet/clients/http/staticfiles/color.css @@ -431,3 +431,9 @@ div#statusbar div.separator { } + +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js new file mode 100644 index 00000000000..b9cf5d15ec7 --- /dev/null +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -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) { + var matching = document.getElementsByClassName("finished_key_link"); + for (var matchingElement of matching) { + var key = matchingElement.dataset.key; + if (key) { + var toClipboard = document.createElement("span"); + toClipboard.textContent = " ⎘"; + toClipboard.classList.add("copy-to-clipboard-element"); + toClipboard.setAttribute("title", "Copy to Clipboard"); + toClipboard.onclick=() => navigator.clipboard.writeText(key); + matchingElement.parentElement.appendChild(toClipboard); + } + } + } +} +document.addEventListener("DOMContentLoaded", addCopyKeyFieldToFinishedTransfers); +// @license-end diff --git a/src/freenet/clients/http/staticfiles/themes/boxed/color.css b/src/freenet/clients/http/staticfiles/themes/boxed/color.css index 82cba4045d9..40fc1c83168 100644 --- a/src/freenet/clients/http/staticfiles/themes/boxed/color.css +++ b/src/freenet/clients/http/staticfiles/themes/boxed/color.css @@ -260,3 +260,9 @@ div#statusbar div.separator { background-color: black; } + +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + diff --git a/src/freenet/clients/http/staticfiles/themes/clean/color.css b/src/freenet/clients/http/staticfiles/themes/clean/color.css index 8d7f8ea763b..fdfa3614bb0 100644 --- a/src/freenet/clients/http/staticfiles/themes/clean/color.css +++ b/src/freenet/clients/http/staticfiles/themes/clean/color.css @@ -59,3 +59,9 @@ /* * Statusbar */ + +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + diff --git a/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css b/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css index fbff689789e..f2250616b8f 100644 --- a/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css +++ b/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css @@ -289,3 +289,9 @@ tr.priority6, td.priority6 { background-color: transparent !important; } + +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + diff --git a/src/freenet/clients/http/staticfiles/themes/sky/color.css b/src/freenet/clients/http/staticfiles/themes/sky/color.css index a78083d9a42..0c3b2e8a298 100644 --- a/src/freenet/clients/http/staticfiles/themes/sky/color.css +++ b/src/freenet/clients/http/staticfiles/themes/sky/color.css @@ -229,3 +229,9 @@ table.queue span.progress_fraction_finalized { #statusbar div.separator { background-color: #d0d0f0; } + +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + diff --git a/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css b/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css index 2702b080e7b..ef984197e88 100644 --- a/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css +++ b/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css @@ -1482,6 +1482,12 @@ body[id*="Sone"] { } +.copy-to-clipboard-element:active { + color: red; + font-weight: bold; +} + + /** Media query **/ @media (max-width: 1500px) { From 21bcbdf35c4294b5a7e6a5dfe7ed5e2d637a6f3b Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 16:40:45 +0200 Subject: [PATCH 02/11] js style: space before ( in function definition, ' for strings --- .../clients/http/staticfiles/js/clipboard.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index b9cf5d15ec7..4ee17e6c9d7 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -1,19 +1,19 @@ // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later -function addCopyKeyFieldToFinishedTransfers() { +function addCopyKeyFieldToFinishedTransfers () { if (navigator && navigator.clipboard) { - var matching = document.getElementsByClassName("finished_key_link"); + var matching = document.getElementsByClassName('finished_key_link'); for (var matchingElement of matching) { var key = matchingElement.dataset.key; if (key) { - var toClipboard = document.createElement("span"); - toClipboard.textContent = " ⎘"; - toClipboard.classList.add("copy-to-clipboard-element"); - toClipboard.setAttribute("title", "Copy to Clipboard"); - toClipboard.onclick=() => navigator.clipboard.writeText(key); matchingElement.parentElement.appendChild(toClipboard); + var toClipboard = document.createElement('span'); + toClipboard.textContent = ' ⎘'; + toClipboard.classList.add('copy-to-clipboard-element'); + toClipboard.setAttribute('title', 'Copy to Clipboard'); + toClipboard.onclick = () => navigator.clipboard.writeText(key); } } } } -document.addEventListener("DOMContentLoaded", addCopyKeyFieldToFinishedTransfers); +document.addEventListener('DOMContentLoaded', addCopyKeyFieldToFinishedTransfers); // @license-end From 68e22baa6499ce1ffbd376350aca6ec5336493c8 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 16:40:52 +0200 Subject: [PATCH 03/11] js: use .after() instead of .parentElement.appendChild() --- src/freenet/clients/http/staticfiles/js/clipboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index 4ee17e6c9d7..5e6a34e8a32 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -5,12 +5,12 @@ function addCopyKeyFieldToFinishedTransfers () { for (var matchingElement of matching) { var key = matchingElement.dataset.key; if (key) { - matchingElement.parentElement.appendChild(toClipboard); var toClipboard = document.createElement('span'); toClipboard.textContent = ' ⎘'; toClipboard.classList.add('copy-to-clipboard-element'); toClipboard.setAttribute('title', 'Copy to Clipboard'); toClipboard.onclick = () => navigator.clipboard.writeText(key); + matchingElement.after(toClipboard); } } } From 34f8037a18927d7c01ee07ccac448a3575ef4def Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 17:41:52 +0200 Subject: [PATCH 04/11] Ensure that addCopyKeyFieldToFinishedTransfers runs only once --- .../clients/http/staticfiles/js/clipboard.js | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index 5e6a34e8a32..d5f5fd691cf 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -1,19 +1,22 @@ // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later -function addCopyKeyFieldToFinishedTransfers () { - if (navigator && navigator.clipboard) { - var matching = document.getElementsByClassName('finished_key_link'); - for (var matchingElement of matching) { - var key = matchingElement.dataset.key; - if (key) { - var toClipboard = document.createElement('span'); - toClipboard.textContent = ' ⎘'; - toClipboard.classList.add('copy-to-clipboard-element'); - toClipboard.setAttribute('title', 'Copy to Clipboard'); - toClipboard.onclick = () => navigator.clipboard.writeText(key); - matchingElement.after(toClipboard); +if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { + function addCopyKeyFieldToFinishedTransfers () { + if (navigator && navigator.clipboard) { + var matching = document.getElementsByClassName('finished_key_link'); + for (var matchingElement of matching) { + var key = matchingElement.dataset.key; + if (key) { + var toClipboard = document.createElement('span'); + toClipboard.textContent = ' ⎘'; + toClipboard.classList.add('copy-to-clipboard-element'); + toClipboard.setAttribute('title', 'Copy to Clipboard'); + toClipboard.onclick = () => navigator.clipboard.writeText(key); + matchingElement.after(toClipboard); + } } } } + document.addCopyKeyFieldToFinishedTransfers = addCopyKeyFieldToFinishedTransfers; + document.addEventListener('DOMContentLoaded', addCopyKeyFieldToFinishedTransfers); } -document.addEventListener('DOMContentLoaded', addCopyKeyFieldToFinishedTransfers); // @license-end From 8aa9f1688a8566d539e2bff52acfaed6839354a8 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 17:54:24 +0200 Subject: [PATCH 05/11] Use inline SVG as copy-to-clipboard image --- src/freenet/clients/http/staticfiles/js/clipboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index d5f5fd691cf..d4e0195a3fb 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -7,7 +7,8 @@ if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { var key = matchingElement.dataset.key; if (key) { var toClipboard = document.createElement('span'); - toClipboard.textContent = ' ⎘'; + // SVG image thanks to bertm! + toClipboard.innerHTML = ''; toClipboard.classList.add('copy-to-clipboard-element'); toClipboard.setAttribute('title', 'Copy to Clipboard'); toClipboard.onclick = () => navigator.clipboard.writeText(key); From afadefa256ef3f779a5d80177a21c6d27e756178 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 17:54:42 +0200 Subject: [PATCH 06/11] Get the link title from the toadlet --- src/freenet/clients/http/QueueToadlet.java | 4 ++-- src/freenet/clients/http/staticfiles/js/clipboard.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freenet/clients/http/QueueToadlet.java b/src/freenet/clients/http/QueueToadlet.java index c0d9d98ac78..c6f711d4863 100644 --- a/src/freenet/clients/http/QueueToadlet.java +++ b/src/freenet/clients/http/QueueToadlet.java @@ -1981,8 +1981,8 @@ private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { if (uri != null) { keyCell.addChild("span", "class", "key_is") .addChild("a", - new String[]{"class", "data-key", "href"}, - new String[]{"finished_key_link", uri.toString(), '/' + uri.toString() + (addSlash ? "/" : "")}, + new String[]{"class", "data-key", "data-title", "href"}, + new String[]{"finished_key_link", uri.toString(), "Copy to Clipboard", '/' + uri.toString() + (addSlash ? "/" : "")}, uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index d4e0195a3fb..1bf79b9909d 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -10,7 +10,7 @@ if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { // SVG image thanks to bertm! toClipboard.innerHTML = ''; toClipboard.classList.add('copy-to-clipboard-element'); - toClipboard.setAttribute('title', 'Copy to Clipboard'); + toClipboard.setAttribute('title', matchingElement.dataset.title); toClipboard.onclick = () => navigator.clipboard.writeText(key); matchingElement.after(toClipboard); } From c1d2a708d56a1c415666f00880b8d58d7e04612e Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 17:57:24 +0200 Subject: [PATCH 07/11] Make copy to clipboard title localizable --- src/freenet/clients/http/QueueToadlet.java | 2 +- src/freenet/l10n/freenet.l10n.en.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/freenet/clients/http/QueueToadlet.java b/src/freenet/clients/http/QueueToadlet.java index c6f711d4863..bb94d4681b6 100644 --- a/src/freenet/clients/http/QueueToadlet.java +++ b/src/freenet/clients/http/QueueToadlet.java @@ -1982,7 +1982,7 @@ private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { keyCell.addChild("span", "class", "key_is") .addChild("a", new String[]{"class", "data-key", "data-title", "href"}, - new String[]{"finished_key_link", uri.toString(), "Copy to Clipboard", '/' + uri.toString() + (addSlash ? "/" : "")}, + new String[]{"finished_key_link", uri.toString(), l10n("copyToClipboardTitle"), '/' + uri.toString() + (addSlash ? "/" : "")}, uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); diff --git a/src/freenet/l10n/freenet.l10n.en.properties b/src/freenet/l10n/freenet.l10n.en.properties index d00092d7c69..71f39cfd55c 100644 --- a/src/freenet/l10n/freenet.l10n.en.properties +++ b/src/freenet/l10n/freenet.l10n.en.properties @@ -1645,6 +1645,7 @@ QueueToadlet.UinProgress=Uploads in progress (${size}) QueueToadlet.cancelSelected=Cancel QueueToadlet.compatModeLabel=Compatibility mode QueueToadlet.compatibilityMode=Compatibility mode +QueueToadlet.copyToClipboardTitle=Copy to Clipboard QueueToadlet.change=Change QueueToadlet.changeDownloadPriorities=Change priority of downloads QueueToadlet.changeUploadPriorities=Change priority of uploads From 3833a36b7986ba893cd68a2a3cabddf835e49f5a Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 18:15:00 +0200 Subject: [PATCH 08/11] fix: use const to define the key data to avoid scoping problems Also dataset key renaming. --- src/freenet/clients/http/QueueToadlet.java | 2 +- src/freenet/clients/http/staticfiles/js/clipboard.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/freenet/clients/http/QueueToadlet.java b/src/freenet/clients/http/QueueToadlet.java index bb94d4681b6..6cdb76bebb9 100644 --- a/src/freenet/clients/http/QueueToadlet.java +++ b/src/freenet/clients/http/QueueToadlet.java @@ -1981,8 +1981,8 @@ private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { if (uri != null) { keyCell.addChild("span", "class", "key_is") .addChild("a", - new String[]{"class", "data-key", "data-title", "href"}, new String[]{"finished_key_link", uri.toString(), l10n("copyToClipboardTitle"), '/' + uri.toString() + (addSlash ? "/" : "")}, + new String[]{"class", "data-copytext", "data-copytitle", "href"}, uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index 1bf79b9909d..d9c93112443 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -4,14 +4,16 @@ if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { if (navigator && navigator.clipboard) { var matching = document.getElementsByClassName('finished_key_link'); for (var matchingElement of matching) { - var key = matchingElement.dataset.key; - if (key) { + // must use const to avoid the weird scoping of var replacing all text with the last element + // const for declaration is usable in IE11+. + const text = matchingElement.dataset.copytext; + if (text) { var toClipboard = document.createElement('span'); // SVG image thanks to bertm! toClipboard.innerHTML = ''; toClipboard.classList.add('copy-to-clipboard-element'); - toClipboard.setAttribute('title', matchingElement.dataset.title); - toClipboard.onclick = () => navigator.clipboard.writeText(key); + toClipboard.setAttribute('title', matchingElement.dataset.copytitle); + toClipboard.onclick = () => navigator.clipboard.writeText(text); matchingElement.after(toClipboard); } } From bd6f4a83a2421bb21076c56364580a491088b9a6 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 18:16:41 +0200 Subject: [PATCH 09/11] refactor: rename class to general copy-to-clipboard --- src/freenet/clients/http/QueueToadlet.java | 2 +- src/freenet/clients/http/staticfiles/js/clipboard.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freenet/clients/http/QueueToadlet.java b/src/freenet/clients/http/QueueToadlet.java index 6cdb76bebb9..91a6f2bf8ae 100644 --- a/src/freenet/clients/http/QueueToadlet.java +++ b/src/freenet/clients/http/QueueToadlet.java @@ -1981,8 +1981,8 @@ private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { if (uri != null) { keyCell.addChild("span", "class", "key_is") .addChild("a", - new String[]{"finished_key_link", uri.toString(), l10n("copyToClipboardTitle"), '/' + uri.toString() + (addSlash ? "/" : "")}, new String[]{"class", "data-copytext", "data-copytitle", "href"}, + new String[]{"copy-to-clipboard", uri.toString(), l10n("copyToClipboardTitle"), '/' + uri.toString() + (addSlash ? "/" : "")}, uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index d9c93112443..8e7a5e69797 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -2,7 +2,7 @@ if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { function addCopyKeyFieldToFinishedTransfers () { if (navigator && navigator.clipboard) { - var matching = document.getElementsByClassName('finished_key_link'); + var matching = document.getElementsByClassName('copy-to-clipboard'); for (var matchingElement of matching) { // must use const to avoid the weird scoping of var replacing all text with the last element // const for declaration is usable in IE11+. From ac61a6d68be9cc18fffdd9fb8b3bf19af2497437 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 18:21:09 +0200 Subject: [PATCH 10/11] Prevent selecting copy-to-clipboard-element and set cursor: pointer --- src/freenet/clients/http/staticfiles/color.css | 5 ++++- src/freenet/clients/http/staticfiles/themes/boxed/color.css | 4 ++++ src/freenet/clients/http/staticfiles/themes/clean/color.css | 4 ++++ .../clients/http/staticfiles/themes/grayandblue/color.css | 4 ++++ src/freenet/clients/http/staticfiles/themes/sky/color.css | 4 ++++ .../clients/http/staticfiles/themes/winterfacey/theme.css | 4 ++++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/freenet/clients/http/staticfiles/color.css b/src/freenet/clients/http/staticfiles/color.css index 5063e67be06..098070d2154 100644 --- a/src/freenet/clients/http/staticfiles/color.css +++ b/src/freenet/clients/http/staticfiles/color.css @@ -431,7 +431,10 @@ div#statusbar div.separator { } - +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; diff --git a/src/freenet/clients/http/staticfiles/themes/boxed/color.css b/src/freenet/clients/http/staticfiles/themes/boxed/color.css index 40fc1c83168..bd4ef326037 100644 --- a/src/freenet/clients/http/staticfiles/themes/boxed/color.css +++ b/src/freenet/clients/http/staticfiles/themes/boxed/color.css @@ -261,6 +261,10 @@ div#statusbar div.separator { } +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; diff --git a/src/freenet/clients/http/staticfiles/themes/clean/color.css b/src/freenet/clients/http/staticfiles/themes/clean/color.css index fdfa3614bb0..385ca7bddfe 100644 --- a/src/freenet/clients/http/staticfiles/themes/clean/color.css +++ b/src/freenet/clients/http/staticfiles/themes/clean/color.css @@ -60,6 +60,10 @@ * Statusbar */ +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; diff --git a/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css b/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css index f2250616b8f..5f8ef628e77 100644 --- a/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css +++ b/src/freenet/clients/http/staticfiles/themes/grayandblue/color.css @@ -290,6 +290,10 @@ tr.priority6, td.priority6 { } +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; diff --git a/src/freenet/clients/http/staticfiles/themes/sky/color.css b/src/freenet/clients/http/staticfiles/themes/sky/color.css index 0c3b2e8a298..161bbf7fab3 100644 --- a/src/freenet/clients/http/staticfiles/themes/sky/color.css +++ b/src/freenet/clients/http/staticfiles/themes/sky/color.css @@ -230,6 +230,10 @@ table.queue span.progress_fraction_finalized { background-color: #d0d0f0; } +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; diff --git a/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css b/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css index ef984197e88..f63b085bd1e 100644 --- a/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css +++ b/src/freenet/clients/http/staticfiles/themes/winterfacey/theme.css @@ -1482,6 +1482,10 @@ body[id*="Sone"] { } +.copy-to-clipboard-element { + user-select: none; /* do not copy this text */ + cursor: pointer; /* this is an action */ +} .copy-to-clipboard-element:active { color: red; font-weight: bold; From 5ce3aeae59f415c472467c7fa18ca1f9823360d5 Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide Date: Sat, 25 Apr 2026 18:26:22 +0200 Subject: [PATCH 11/11] =?UTF-8?q?don=E2=80=99t=20check=20for=20the=20avail?= =?UTF-8?q?ability=20of=20the=20navigator=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/freenet/clients/http/staticfiles/js/clipboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freenet/clients/http/staticfiles/js/clipboard.js b/src/freenet/clients/http/staticfiles/js/clipboard.js index 8e7a5e69797..a13744ad1b5 100644 --- a/src/freenet/clients/http/staticfiles/js/clipboard.js +++ b/src/freenet/clients/http/staticfiles/js/clipboard.js @@ -1,7 +1,7 @@ // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later if (typeof(document.addCopyKeyFieldToFinishedTransfers) === 'undefined') { function addCopyKeyFieldToFinishedTransfers () { - if (navigator && navigator.clipboard) { + if (navigator.clipboard) { var matching = document.getElementsByClassName('copy-to-clipboard'); for (var matchingElement of matching) { // must use const to avoid the weird scoping of var replacing all text with the last element