Is there a way of invoking those actions in ACE from JS code? I can see
in Cloud9 that menu items for those actions (the top menu, not editor's
context menu) don't work. Is this not yet implemented?
Thanks,
--
Juliusz Gonera
http://juliuszgonera.com/
How would I get the current clipboard content?
Rohit Reddy Korrapolu wrote:How would I get the current clipboard content?
Even I am new to ACE code, I can give you few suggestions.
To paste code to ace editor, call editorSession.insert(<text>)
> Generally speaking, you can only access the clipboard as part of an
> event that's initiated by the browser. This is an important security
> mechanism; without it, any web site you visit could grab any data you
> copy-paste while it's open -- private emails, passwords, your home
> address, credit card numbers, etc.
>
> So, copy/paste must be initiated by the browser's context menu, edit
> menu, or keyboard shortcuts.
This makes sense, but I still don't understand why Cloud9 devs put those
items (Copy/Cut/Paste) in their application's menu. I mean, they don't
work ATM, but was it always like that?
Would it be possible to send some event to the editor telling it to
paste? I.e. not getting the clipboard contents and then manually
inserting them but instead forcing the paste behaviour on the widget.
Actually we had to remove them because of exactly this issue.
> Would it be possible to send some event to the editor telling it to paste?
> I.e. not getting the clipboard contents and then manually inserting them but
> instead forcing the paste behaviour on the widget.
A paste is basically a editor.insert("some text", true). If you get
the pasted text somehoe (e.g. using flash) then this would do it.
Best,
Fabian
> A paste is basically a editor.insert("some text", true). If you get
> the pasted text somehoe (e.g. using flash) then this would do it.
I see, thank you. I'll try to experiment with this later.