diff --git a/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/PublishUrlServlet.java b/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/PublishUrlServlet.java index 7de32a4246..af86a80f56 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/PublishUrlServlet.java +++ b/bundle/src/main/java/com/adobe/acs/commons/wcm/impl/PublishUrlServlet.java @@ -55,14 +55,14 @@ @SlingServletResourceTypes( resourceTypes = PublishUrlServlet.RESOURCE_TYPE, methods = HttpConstants.METHOD_GET, - extensions = PublishUrlServlet.TXT_EXTENSION + extensions = PublishUrlServlet.JSON_EXTENSION ) @Designate(ocd = PublishUrlServlet.PublishUrlServletConfig.class) public class PublishUrlServlet extends SlingSafeMethodsServlet implements Serializable { private static final long serialVersionUID = 1L; protected static final String RESOURCE_TYPE = "acs-commons/components/utilities/publish-url"; - protected static final String TXT_EXTENSION = "txt"; + protected static final String JSON_EXTENSION = "json"; private static final String PATH = "path"; private static final String JSON_TYPE = "application/json"; private String[] externalizerKeys; diff --git a/ui.apps/src/main/content/jcr_root/apps/acs-commons/authoring/sites-copy-publishurl/sites-copy-publish-url.js b/ui.apps/src/main/content/jcr_root/apps/acs-commons/authoring/sites-copy-publishurl/sites-copy-publish-url.js index baeddb0f7c..54ec28bbfe 100644 --- a/ui.apps/src/main/content/jcr_root/apps/acs-commons/authoring/sites-copy-publishurl/sites-copy-publish-url.js +++ b/ui.apps/src/main/content/jcr_root/apps/acs-commons/authoring/sites-copy-publishurl/sites-copy-publish-url.js @@ -24,7 +24,7 @@ var modalBody = $(e.target).find('coral-dialog-content'), failureMessage = Granite.I18n.get('An error occurred determining the page\'s publish URLs.'), missingConfigMessage = Granite.I18n.get('Missing configs for the Publish URL servlet or Externalizer.'), - publishUrl = Granite.HTTP.externalize('/apps/acs-commons/components/utilities/sites-publish-url.txt'), + publishUrl = Granite.HTTP.externalize('/apps/acs-commons/components/utilities/sites-publish-url.json'), path = $(e.target).data('assetpath'); var result = @@ -69,14 +69,8 @@ button.addEventListener('click', function() { var key = this.getAttribute('data-copy-target'); var inputField = this.previousElementSibling; - var textToCopy = inputField.value; inputField.select(); - try { - navigator.clipboard.writeText(textToCopy); - console.log("Text copied to clipboard"); - } catch (err) { - console.error("Failed to copy: ", err); - } + document.execCommand("copy"); }); }); });