From afbce5ac8761aaf1087ac12b9f8226a667c49f30 Mon Sep 17 00:00:00 2001 From: Max Berger Date: Sun, 29 Mar 2026 23:46:30 +0200 Subject: [PATCH] UI: Add copy to clipboard button to URL displays --- radicale/web/internal_data/css/main.css | 87 ++++++++++++++++--- radicale/web/internal_data/index.html | 26 +++++- .../js/scenes/CollectionsScene.js | 3 +- .../js/scenes/IncomingSharingScene.js | 3 +- .../js/scenes/ShareCollectionScene.js | 3 +- .../web/internal_data/js/utils/url_text.js | 39 +++++++-- 6 files changed, 133 insertions(+), 28 deletions(-) diff --git a/radicale/web/internal_data/css/main.css b/radicale/web/internal_data/css/main.css index acb75fd6..403244b4 100644 --- a/radicale/web/internal_data/css/main.css +++ b/radicale/web/internal_data/css/main.css @@ -412,6 +412,65 @@ input:focus-visible { border-width: 1px !important; } +.url-input-wrapper { + position: relative; + width: 100%; + margin-bottom: 0; + display: flex; + align-items: center; + clear: both; +} + +.url-input-wrapper input { + flex: 1; + min-width: 0; + padding-right: 45px !important; + box-sizing: border-box; + width: 100% !important; + margin-bottom: 0 !important; +} + +#collectionsscene article .url-input-wrapper { + margin-bottom: 15px; +} + +.copy-btn { + flex: none; + margin-left: -38px; + background: transparent; + border: none; + color: #2494fe; + font-size: 1.25em; + cursor: pointer; + padding: 0; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; + transition: background-color 0.2s, color 0.2s, transform 0.1s; + line-height: 1; + z-index: 2; + float: none; + margin-bottom: 0; + margin-top: 0; + margin-right: 8px; +} + +.copy-btn:hover { + background-color: #f0f7ff; + color: #055fb5; +} + +.copy-btn:active { + transform: scale(0.9); +} + +.copy-btn.copied { + color: #4e9a06; +} + input[type=radio], input[type=checkbox] { width: auto; @@ -507,21 +566,21 @@ button.inline { } .pill { - display: inline-block; - padding: 0.25em 0.6em; - font-size: 75%; - font-weight: 700; - line-height: 1; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: 0.375rem; - background-color: #6c757d; - color: #fff; - margin: 0 2px; - width: 1.4em; + display: inline-block; + padding: 0.25em 0.6em; + font-size: 75%; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.375rem; + background-color: #6c757d; + color: #fff; + margin: 0 2px; + width: 1.4em; } .hidden { display: none !important; -} +} \ No newline at end of file diff --git a/radicale/web/internal_data/index.html b/radicale/web/internal_data/index.html index a695be3d..baa242c7 100644 --- a/radicale/web/internal_data/index.html +++ b/radicale/web/internal_data/index.html @@ -83,7 +83,10 @@ Webcal - +
+ + +

Description