-
-
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
Add direct preview link #6599
Add direct preview link #6599
Conversation
Also cc the others from issue #2523 for review: @jm-andonegi @Cerberus-tm @oliverpool @shyamal890 @drjagan @io-node @Happyfeet01– please check it out! :) |
Ok so we need actual samesite cookie work here to make it work. So this is not as simple... I'll look into that. |
@@ -92,7 +92,7 @@ | |||
</div> | |||
<div class="directLink"> | |||
<label for="directLink"><?php p($l->t('Direct link')) ?></label> | |||
<input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"> | |||
<input id="directLink" type="text" readonly value="<?php p($_['previewURL']); ?>"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work when you share a file that is not an image, right? We should still show the direct download link then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't, for non preview types it is set to the downloadurl in the controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I've missed that it is being set there, nevermind.
This requires #6630 to work properly. I'll update once that is in. |
Done. Now don our work ;) |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Codecov Report
@@ Coverage Diff @@
## master #6599 +/- ##
============================================
- Coverage 53.06% 53.05% -0.02%
- Complexity 22567 22580 +13
============================================
Files 1417 1417
Lines 87800 87833 +33
Branches 1340 1340
============================================
+ Hits 46594 46599 +5
- Misses 41206 41234 +28
|
DONE! Lets get this in as well so @jancborchardt owes me a 🍺 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works, but for example for text files this is quite suboptimal, because you get the preview instead :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the unit tests fail
Test should be fixed. The preview endpoint is now only used for image types we can generate previews for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍
Just a question, I am trying out this feature, am I correct I take the share-link and append "/preview" to make it work? Or is there an automated way to get this specific link? |
@io-node that is correct. However, if you just share a picture via public link. It should show up in the text feel below the preview. |
OK so if i understand it correctly:
It does work as mentioned above. I assume once 13 is being released it will be noted somewhere (on the web-page) how to use this. |
@io-node correct. But if you open the share link. There should be a button (download) and a field direct link below the image. |
Yes the 'direct link' i can see just under the image but this can only be used internally for users who have an account (and access to the relevant folder). I just expected there be a separate box/link to provide the preview link (if a preview is possible) So to summarise, I expected a standard link (as normal), and (if preview is available) a preview link. This way you can share a photo still easy in the normal way (including the NC theming) and have a separate link which can be used if using it on other sites as a direct link. |
Thank you 😊 sorry for the confusion. I get now what you mean. OK that works also. As an 'expert' one can always use the normal link and add the "/preview" behind it, but for novice users they can use the method you mentioned. Do like how it works and does exactly 'as is written on the box' 😄 I do have a little comment, since it does any image MIME type of files, the problem is with GIF animations it won't work, since it will only do a (static) preview. Can I assume this is an accepted limitation? Or is there a way to make an animated preview for GIFs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Finally ;)
Awesome everyone! 😍 Sry, for being absent in recent time. Moving to Finland 🇫🇮 New job and all. |
Hi, any way to get a direct link to the image file ? I want a link who point to a .jpeg file for example... |
Hi thank you for this advance :) |
Should fix #2523
Turns out it was easier to just do it then to tell @jancborchardt to shut up again 💋 😉
Requires:
CC: @eppfel