ColoradoSchoolOfMines / mozzarella

Mozzarella is a web application made to help student computing clubs better collaborate and organize their projects, presentations, and even mailing list messages.
https://acm.mines.edu
GNU General Public License v3.0
7 stars 3 forks source link

Clicking on iCalendar link selection box causes the text to be selected but not added to X selection buffer #29

Closed jackrosenthal closed 7 years ago

jackrosenthal commented 7 years ago

The attribute onclick="this.select()" on the iCalendar link selection box causes the text to appear selected in the browser, but since it was not selected using the mouse, it is not added to X selection buffer.

This attribute should be removed to prevent confusion.

jackrosenthal commented 7 years ago

To add to this, do we really need that fancy input box selection thing? I was thinking a <tt> would have been sufficent...

jackrosenthal commented 7 years ago

Last thing, ${tg.request.url + '.ics'} is a little bit convoluted... why aren't you just using the canonical tg.url?

sumnerevans commented 7 years ago

All of this is by design. This is how the "clone" button works on GitHub. When you click on the text box, the contents are selected but not added to the clipboard. The button on the right of the text box (the copy button) will select the contents of the textbox and copy it to the clipboard.

A simple <tt> will not cut it. Browser support for selecting text that is not inside a textbox is pretty bad (all the APIs are different and not very good). Also, to enable the "Copy" button, it is easiest to use a textbox.

Lastly, tg.url did not work because tg.url('/schedule.ics') gave a result of /schedule.ics, a relative path. What we need is the full URL (<site_base>/schedule.ics) and the only way I found to do this is use tg.request.url. I'm open to other suggestions, but tg.url won't work.

jackrosenthal commented 7 years ago

Fixed... When you fix your implementation to not be confusing that it was not put in the selection buffer, we can use it.

sumnerevans commented 7 years ago

Now it's worse. I now have to manually select the text to copy it to my clipboard.

jackrosenthal commented 7 years ago

Most operating systems let you triple-click to do that.

sumnerevans commented 7 years ago

That only selects it, I still have to Ctrl + C to copy it to my clipboard.

jackrosenthal commented 7 years ago

Your point is...?

If you don't like that your OS requires you to press Ctrl-C to copy, then consider an operating system which has a different way to copy. As a web developer, it is not your responsibility to implement your own non-standard OS controls, no matter how inconvenient it is on some systems.