roost-im / roost-client

The official client for Roost.
MIT License
1 stars 6 forks source link

Do something sensible when copying messages #85

Open lightquake opened 10 years ago

lightquake commented 10 years ago

This is what happens if you select an entire message and copy it:

classinstance 10 minutes ago July 17th 2014, 3:36:21 pm

sender  
message
zsig

Can we do anything to make this better? In particular, I think something like this would be good:

class / instance / sender / July 17th 2014, 3:36:21 pm
message
----
zsig
jrafidi commented 10 years ago

Supposedly there's this HTML5 clipboard API, but from what I can gather, it isn't actually established yet? The best idea I have (without using Flash) is the suggestion in this page:

http://www.quora.com/HTML5/How-can-you-copy-to-clipboard-without-Flash

Anyone know more about this?

davidben commented 10 years ago

There's no need for Flash here. Initiating a copy is harder, but this only requires reacting to a copy and overriding it. There's an event for that which works just fine. See https://davidben.net/copy-test.html

davidben commented 10 years ago

(And there are APIs for determining what text in what nodes are part of the current selection.)

jrafidi commented 10 years ago

Well, I learned something today. With which selection should we trigger this? When all the text of a message is selected?

lightquake commented 10 years ago

I think selecting just the text should only copy the text. Maybe do it only when all the nodes are selected, or all the nodes but the class (since that one can be kind of tricky to select).

jrafidi commented 10 years ago

I feel like even that is still difficult to do properly. Is it worth it to make a shortcut button that does this for you? Like next to the other bottom right icons?