Page MenuHomePhabricator

Simplify oncopy behavior
ClosedPublic

Authored by sophiebits on Apr 3 2014, 8:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 4 2024, 7:19 PM
Unknown Object (File)
Feb 4 2024, 7:18 PM
Unknown Object (File)
Feb 4 2024, 7:18 PM
Unknown Object (File)
Feb 4 2024, 3:17 AM
Unknown Object (File)
Dec 26 2023, 4:40 AM
Unknown Object (File)
Dec 22 2023, 5:23 PM
Unknown Object (File)
Dec 15 2023, 12:43 PM
Unknown Object (File)
Nov 26 2023, 1:30 AM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP26c836e1e14e: Simplify oncopy behavior
Summary

Firefox has supported clipboardData since version 22 (Jul 2013), and even IE8 supports it if you look at window.clipboardData instead of e.clipboardData. As a result, we can simplify this code significantly.

I also used (or at least, attempted to) Javelin so that we can get the event object and preventDefault more easily. Plus, this way we don't assign to document.body.oncopy.

Test Plan

Copied a selection including a line number in Chrome, Firefox, and IE8. The line number didn't get copied.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sophiebits retitled this revision from to Simplify oncopy behavior.
sophiebits updated this object.
sophiebits edited the test plan for this revision. (Show Details)
sophiebits added a reviewer: epriestley.
epriestley edited edge metadata.

July 2013 is kind of recent (see D835) but if anyone complains we can revert this and then apply it in a year or two.

This revision is now accepted and ready to land.Apr 3 2014, 4:20 PM
epriestley updated this revision to Diff 20605.

Closed by commit rP26c836e1e14e (authored by @spicyj, committed by @epriestley).