@kcne commented on this pull request.


> @@ -0,0 +1,27 @@
+// Opening pop-ups with share URL
+function openShareUrl(url, initialWidth = 640, initialHeight = 480) {
+  if (typeof url !== "string" || !url.startsWith("http")) {
+    console.error("Invalid URL"); // Consider removing this line if console 
warnings should be avoided.
+    return;
+  }
+
+  const width = Math.max(100, Math.min(screen.width, initialWidth));
+  const height = Math.max(100, Math.min(screen.height, initialHeight));
+
+  const left = (screen.width / 2) - (width / 2);
+  const top = (screen.height * 0.3) - (height / 2);
+  const opts = 
`width=${width},height=${height},left=${left},top=${top},menubar=no,status=no,location=no`;
+
+  window.open(url, "popup", opts);

Actually for me it works like this - I'm using firefox, hadn't check for the 
other browsers.

When I click share it opens share link in pop up window to select the email 
provider:
<img width="1213" alt="Screenshot 2024-10-22 at 10 07 59" 
src="https://github.com/user-attachments/assets/d7eee376-638c-4684-ae79-96efecffd0b5";>
After email provider selection, i get the automatically formatted email message 
ready to be sent:
<img width="886" alt="Screenshot 2024-10-22 at 10 08 23" 
src="https://github.com/user-attachments/assets/804f34bb-2ef3-43af-a615-df2b5bebd23f";>



-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4985#discussion_r1810192445
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/4985/review/2384312...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to