[openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)
Anton Khorev
notifications at github.com
Wed Aug 14 05:36:14 UTC 2024
@AntonKhorev commented on this pull request.
> + if (typeof url !== "string" || !url.startsWith("http")) {
+ console.error("Invalid URL");
+ 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`;
+
+ const newWindow = window.open(url, "popup", opts);
+
+ if (!newWindow || newWindow.closed || typeof newWindow.closed == "undefined") {
+ console.error("Popup blocked. Please allow popups for this website.");
Who is supposed to be able to read this message? Regular users don't look at their browser console.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4985#pullrequestreview-2237205094
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4985/review/2237205094 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240813/a832bc51/attachment.htm>
More information about the rails-dev
mailing list