Skip to content

Remove Share modal — copy URL directly on button click#35

Merged
ThisIs-Developer merged 7 commits intomainfrom
copilot/fix-large-markdown-link-issue
Mar 4, 2026
Merged

Remove Share modal — copy URL directly on button click#35
ThisIs-Developer merged 7 commits intomainfrom
copilot/fix-large-markdown-link-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

The Share button previously opened a modal dialog displaying the encoded URL. The requirement is to eliminate the modal entirely and have the button copy the URL to clipboard inline, briefly showing "Copied!".

Changes

  • index.html: Removed the entire #share-modal dialog block
  • script.js:
    • Replaced modal open/close/keydown logic and shareModalCopy handler with a single copyShareUrl(btn) helper
    • Both shareButton and mobileShareButton call it directly (removed the old delegate)
    • window.location.hash is now set only on successful clipboard write, not unconditionally
  • styles.css: Removed the entire SHARE URL MODAL CSS section (~75 lines)
// Before: shareButton click → openShareModal() → user clicks "Copy URL"
// After:
shareButton.addEventListener("click", function () { copyShareUrl(shareButton); });
mobileShareButton.addEventListener("click", function () { copyShareUrl(mobileShareButton); });

On click, the button text changes to ✓ Copied! for 2 seconds, then restores. Falls back to execCommand copy via a transient off-screen textarea for non-secure contexts.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Mar 4, 2026 1:33pm

Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 4, 2026

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: e5fb3ae
Status: ✅  Deploy successful!
Preview URL: https://e064eb2e.markdown-viewer.pages.dev
Branch Preview URL: https://copilot-fix-large-markdown-l.markdown-viewer.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 4, 2026

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: e5fb3ae
Status: ✅  Deploy successful!
Preview URL: https://c228dcf4.markdownviewer.pages.dev
Branch Preview URL: https://copilot-fix-large-markdown-l.markdownviewer.pages.dev

View logs

Copilot AI changed the title [WIP] Fix issue with large link when sharing markdown files Replace blocking share alert with URL modal for large markdown documents Mar 4, 2026
Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Copilot AI changed the title Replace blocking share alert with URL modal for large markdown documents Remove generated URL display from share modal Mar 4, 2026
Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review March 4, 2026 13:28
Copilot AI changed the title Remove generated URL display from share modal Remove URL display from share modal Mar 4, 2026
Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Copilot AI changed the title Remove URL display from share modal Remove Share modal — copy URL directly on button click Mar 4, 2026
@ThisIs-Developer ThisIs-Developer merged commit 331c7d4 into main Mar 4, 2026
6 checks passed
@ThisIs-Developer ThisIs-Developer deleted the copilot/fix-large-markdown-link-issue branch March 4, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants