-
Notifications
You must be signed in to change notification settings - Fork 205
Conversation
kleintom
commented
May 5, 2016
•
edited
Loading
edited
- Allow browsing to binary files.
- Display the nav pane for binary images and support viewing binary images on /rev/.
- Support viewing of textual images on /rev/.
0723093
to
ac13d8c
Compare
(Still needs a little more work :-) |
* Copy 'icons/raw.png' to a new mimetype 'binary.png' and use it for binary files we don't otherwise know the mimetype of, mostly to make it easy to recognize binaries in /browse/ and search results now that they're not greyed out. * Remove is_binary from JS results processing, and, since that's the only place it was used, remove it from query results as well.
@@ -249,6 +251,23 @@ def raw(tree, path): | |||
return send_file(data_file, mimetype=guess_type(path)[0]) | |||
|
|||
|
|||
@dxr_blueprint.route('/<tree>/rawrev/<revision>/<path:path>') |
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.
I'm not in love with the user-visible name "rawrev", since nowhere else do we mash two words up against each other without any divider.
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.
raw_rev?
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.
So far we've managed to keep underscores out of the URL, which is a nice thing, I think (esp. when we're already using dashes). I haven't had a chance to look through your PR in detail yet, but I vaguely and nebulously wonder if we really need this extra endpoint. I suppose it's to distinguish a binary's containing page from its raw data?
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.
I have to admit I was unaware of the dashes-vs-underscores debate, but even had I been, we do use dashes in filters as you point out, so dashes are more consistent - thanks!
Yes, the new endpoint is to serve up just the plain raw binary of a file at a particular revision rather than embedded in the dxr layout. Then the /rev/ page for a binary image can have a /raw-rev/ img href to the image at that rev (so the rev image gets displayed on its /rev/ page), and for svg /rev/ pages we can put a "view image" link in the nav pane to the svg served up as svg by a /raw-rev/.
@pelmers Do you have some time to look this one over? |
…rev/. * Add a '/<tree>/raw-rev/<revision>/<path:path>' route so that we can link to past revisions of binary image files in the output served by /rev/. * Turn on omniglot links for binary files in general.
Updated to use 'raw-rev'. |
Update update: r+ |