-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement cut/copy/paste #900
Comments
Browsers are (finally) giving access to the clipboard. This library may help to bridge the transition: https://zenorocha.github.io/clipboard.js/ |
I suppose that since you seem to have selection working, the context menu isn't really necessary, but I also don't really see any reason to get rid of it? It doesn't hurt to allow both mouse and keyboard methods of doing something. |
+1 for clipboard.ks ;) |
Have implemented the basics in #1319 using a hidden element that gets the innerHTML on ctrl/meta down and selects it, updating the DOM if the selected text changes. Works OK, but there is still some work to do:
|
Realized that because we leverage the system clipboard, we can't actually trigger cut/copy/paste ourselves. Well, we could, but then it would work differently than the keyboard-triggered version, and I'd like to avoid having the same thing behave differently depending how it was triggered, as much as is possible (we already have that if they choose copy/paste from the browser menu instead of the hotkeys, so adding our own with a context menu would then have 3 different versions). On mobile this is different. They don't have a menu version, and copy/paste from one window or app to another is not as much of a priority. On mobile I can see the benefit of having double-tap on a block in the script bring up a menu for cut/copy/paste/clear and maybe undo/redo. Will defer this feature for now. |
We need to reimplement cut/copy/paste. Rather than a custom context menu, this should work with standard key shortcuts (C-c, C-x, C-v for copy,cut,paste where C is Ctrl on Windows (and Linux?) and Cmd on Mac.
We'll just copy the HTML, so it should work across windows, workspaces or even between programs. We will need to check during paste operations to make sure content is being pasted into a valid location (and is not just generic HTML).
We might want to use ZeroClipboard to help get things on the real system pasteboard: https://code.google.com/p/zeroclipboard/source/browse/ZeroClipboard.js. For information about how this works (and why it is needed): https://stackoverflow.com/questions/17527870/how-does-trello-access-the-users-clipboard/17528590
The text was updated successfully, but these errors were encountered: