From 763f66005f7a1befa8e68e8d6a89bd9b01f6427b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:32:17 +0000 Subject: [PATCH 1/6] Initial plan From d3f73ced0f0914672984baa7464ff8344b05284d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 16:34:54 +0000 Subject: [PATCH 2/6] Add click-to-copy functionality for URL snippets Co-authored-by: AWqxKAWERbXo <3855487+AWqxKAWERbXo@users.noreply.github.com> --- assets/js/backend.js | 75 +++++++++++++++++++++++++++++++++ assets/styles.css | 22 ++++++++++ boot.php | 1 + fragments/url/profiles/card.php | 4 +- 4 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 assets/js/backend.js diff --git a/assets/js/backend.js b/assets/js/backend.js new file mode 100644 index 0000000..84b8956 --- /dev/null +++ b/assets/js/backend.js @@ -0,0 +1,75 @@ +/** + * URL Generator - Backend JavaScript + * Adds click-to-copy functionality for URL call snippets + */ + +(function($) { + 'use strict'; + + $(document).ready(function() { + // Add click-to-copy functionality to code elements with data-copy attribute + $('.url-code-copy').on('click', function(e) { + e.preventDefault(); + + var $this = $(this); + var textToCopy = $this.data('copy'); + + // Use the Clipboard API if available, fallback to older method + if (navigator.clipboard && window.isSecureContext) { + navigator.clipboard.writeText(textToCopy).then(function() { + showCopyFeedback($this); + }).catch(function(err) { + fallbackCopyToClipboard(textToCopy, $this); + }); + } else { + fallbackCopyToClipboard(textToCopy, $this); + } + }); + + // Add cursor pointer style to copyable code elements + $('.url-code-copy').css('cursor', 'pointer'); + }); + + /** + * Fallback copy method for older browsers or non-HTTPS contexts + */ + function fallbackCopyToClipboard(text, $element) { + var $temp = $(' oder via Artikel - rex_article::get(getId() ?>)->getUrl(['' => {id}])
+ rex_article::get(getId() ?>)->getUrl(['' => {id}])
+