ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

Prevent user selection of line numbers #227

Closed dustinpaluch closed 5 years ago

dustinpaluch commented 5 years ago

It would be nice if Select All + Copy didn't include the line numbers. I recommend adding this CSS to the linenos class:

user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
buhman commented 5 years ago

https://github.com/ptpb/pbs/commit/96a4488cf56c8259fa642618a8b9e29fc26388f2

Thanks!

buhman commented 5 years ago

This is deployed, but it might take awhile for the CDN hosting it to expire.

dustinpaluch commented 5 years ago

@buhman you'll need the prefixed properties too if you want to support non-chrome browsers. https://caniuse.com/#search=user-select

dustinpaluch commented 5 years ago

@buhman, any love for non-chrome browsers?

buhman commented 5 years ago

I tested this on firefox and chrome. If there's anything more obscure than either of those I'm not really interested.

dustinpaluch commented 5 years ago

It won't work in firefox unless you include the -moz-user-select property.

screen shot 2018-08-29 at 8 57 54 am

dustinpaluch commented 5 years ago

@buhman would you mind double checking firefox support for this feature?