Re: [clipboard] Feature detect Clipboard API support?

2015-04-26 Thread Hallvord Reiar Michaelsen Steen
On Sun, Apr 26, 2015 at 4:32 PM, James M. Greene wrote: > They used `Document#queryCommandSupported` and > `Document#queryCommandEnabled` for feature detection -- the latter > requiring that there is an active, expanded Selection/Range in the Document > in order to get a positive (`true`) indicat

Re: [clipboard] Feature detect Clipboard API support?

2015-04-26 Thread James M. Greene
I haven't tested this out to see if it dispatches all the correct events in order to be spec-compliant but Chromium just landed programmatic copy-and-cut [with restrictions that require that there is an active, expanded Selection/Range in the Document]: http://updates.html5rocks.com/2015/04/cut-an

Re: [clipboard] Feature detect Clipboard API support?

2015-04-21 Thread Ryan Seddon
> > If we did that, authors could not use synthetic clipboard events for > anything - right? I'm assuming that authors are going to find use cases for > it - for example a "cloud clipboard" implementation may want to fire actual > paste events so that data from the "cloud" is processed like data fr

Re: [clipboard] Feature detect Clipboard API support?

2015-04-21 Thread Hallvord Reiar Michaelsen Steen
(Aside: I was testing the queryCommandEnabled()/onbefore* idea with this script: https://gist.github.com/hallvors/59a90f2e3816cb57f044 ) On Tue, Apr 21, 2015 at 7:29 AM, James M. Greene wrote: > Patrick Kettner offered up another idea for this as well on a related > Modernizr issue [1]: > > Give

Re: [clipboard] Feature detect Clipboard API support?

2015-04-20 Thread James M. Greene
Patrick Kettner offered up another idea for this as well on a related Modernizr issue [1]: Given the following > >1. we must not change the user's clipboard >2. we must use a synthetic event >3. synthetic event be able to actually work (clipboard poisoning, etc) > > is there any chance

Re: [clipboard] Feature detect Clipboard API support?

2015-04-20 Thread Hallvord Reiar Michaelsen Steen
On Wed, Feb 11, 2015 at 7:21 PM, James M. Greene wrote: > The current spec still leaves me a bit unclear about if implementors must > include the ability to feature detect Clipboard API support, which I think > is a critical requirement. > I agree it's a very important requirement. And it sucks

Re: [clipboard] Feature detect Clipboard API support?

2015-02-11 Thread Glenn Maynard
On Wed, Feb 11, 2015 at 12:34 PM, Michaela Merz wrote: > > AFAIK, you can't trigger a clip board request without human interaction. > > $('#element).off().on('click',function(e) { > var clip = new ClipboardEvent('copy'); > clip.clipboardData.setData('text/plain','some data'); > c

Re: [clipboard] Feature detect Clipboard API support?

2015-02-11 Thread Michaela Merz
AFAIK, you can't trigger a clip board request without human interaction. $('#element).off().on('click',function(e) { var clip = new ClipboardEvent('copy'); clip.clipboardData.setData('text/plain','some data'); clip.preventDefault(); e.target.dispatchEvent(clip); }); This

[clipboard] Feature detect Clipboard API support?

2015-02-11 Thread James M. Greene
The current spec still leaves me a bit unclear about if implementors must include the ability to feature detect Clipboard API support, which I think is a critical requirement. In particular, I *need* to be able to detect support for the Clipboard API (click-to-copy support, in particular) in advan