-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
»Share via link« should automatically copy the link to the clipboard #276
Comments
Were do you want to hook in? I'm about to create a PR but I'm not familiar with the coding style. I checked the code and thought about adding a function to the |
cc @schiessle and @MorrisJobke for input on @go2sh's question. :) |
As far as I could see (was playing the whole day with this issue), your proposed hook is the only way to go @go2sh . I can grab the link in the shareitem model, but a) I'd rather not have displaying stuff in the model code and b) I was not able to select the text for copying. |
There is anouter commandExecute('selectAll'). As far as I understand the docs, it selects all text in an editable region. This should solve the selecting problem. So the following could be done:
Alternative there is a jquery function called I'll try to write a small function tomorrow and if it works, I'll create a PR where the rest can be discussed. |
Btw. Part of the code is already there as the text field has a |
I was done with that too plus the autocopy. I though about automatically copying it to clipboard. It might erase content, that the user is not are of. Then you are never able to share a link without thinking about your clipboard. I guess clicking on another button is also acceptable. But I don't mind. Should I submit a PR or do you want to include upstream? |
I think we should wait for owncloud/core#25418 indeed. I do not want autocopy. I should have control over my own clipboard. |
Ok so the clipboard thingy is in. Not the autocopy. I still think that is a bad idea. |
@weeman1337 actually the actual code is already supposed to do that, but is broken because the click is triggered before the render (time for the enable public share request to complete) server/core/js/sharedialoglinkshareview.js Lines 297 to 298 in c435bfe
I have a pending fix for that: https://github.com/nextcloud/server/compare/public-share-link-menu-copy But I really dislike what I did, shady javascript scripts to ensure the element is present. :/ |
You create a share link, and that mostly means you want to share it. Also, the label literally says "Share link", so you could argue that copying to the clipboard is perfectly normal. Convenience definitely is more important in this case. This is another of these cases like catching Ctrl-F for our search field, Ctrl-S for saving where lots of people initially disagreed but it just works so well. We are here to make lives easier for regular people, so this is what we do. |
@skjnldsv 🚀 🎉 |
Fixed with #15719 |
(In the sharing section of the sidebar.) That will make the sharing flow a lot easier.
The text was updated successfully, but these errors were encountered: