Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/freenet/clients/http/QueueToadlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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"});
}
Comment thread
ArneBab marked this conversation as resolved.

createRequestTableButtons(form, pageMaker, ctx, mimeType, hasFriends, advancedModeEnabled, priorityClasses, true, queueType);

Expand Down
6 changes: 6 additions & 0 deletions src/freenet/clients/http/staticfiles/color.css
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,9 @@ div#statusbar div.separator {
}



.copy-to-clipboard-element:active {
color: red;
font-weight: bold;
}

19 changes: 19 additions & 0 deletions src/freenet/clients/http/staticfiles/js/clipboard.js
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) {
Comment thread
ArneBab marked this conversation as resolved.
Outdated
var matching = document.getElementsByClassName("finished_key_link");
Comment thread
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 = " ⎘";
Comment thread
ArneBab marked this conversation as resolved.
Outdated
Comment thread
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);
Comment thread
ArneBab marked this conversation as resolved.
Outdated
}
}
}
}
document.addEventListener("DOMContentLoaded", addCopyKeyFieldToFinishedTransfers);
// @license-end
6 changes: 6 additions & 0 deletions src/freenet/clients/http/staticfiles/themes/boxed/color.css
Comment thread
ArneBab marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,9 @@ div#statusbar div.separator {
background-color: black;
}


.copy-to-clipboard-element:active {
color: red;
font-weight: bold;
}

6 changes: 6 additions & 0 deletions src/freenet/clients/http/staticfiles/themes/clean/color.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@
/*
* Statusbar
*/

.copy-to-clipboard-element:active {
color: red;
font-weight: bold;
}

Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,9 @@ tr.priority6, td.priority6 {
background-color: transparent !important;
}


.copy-to-clipboard-element:active {
color: red;
font-weight: bold;
}

6 changes: 6 additions & 0 deletions src/freenet/clients/http/staticfiles/themes/sky/color.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,12 @@ body[id*="Sone"] {
}


.copy-to-clipboard-element:active {
color: red;
font-weight: bold;
}



/** Media query **/
@media (max-width: 1500px) {
Expand Down