Skip to content
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

Improve Edit/View behavior #2911

merged 5 commits into from Oct 9, 2017

Improve Edit/View behavior #2911

merged 5 commits into from Oct 9, 2017


Copy link

@gnestor gnestor commented Oct 9, 2017

Follow up from #2203 (comment)

This makes the default path edit for files so that all files can edited. If a file is binary or otherwise uneditable, a user can still edit it and they will see the following error:

Error: [FILE] is not UTF-8 encoded
Saving is disabled.
See Console for more details.

They're browser won't crash or anything, so no harm, no foul.

If a file's MIME type matches text/html or the whitelist of viewable extensions (a list of browser-supported extensions borrowed from, then it will use the view path by default.

@gnestor gnestor changed the title Issue 2203 Improve Edit/View behavior Oct 9, 2017
@gnestor gnestor added this to the 5.2 milestone Oct 9, 2017
@gnestor gnestor requested review from takluyver and ellisonbg Oct 9, 2017
rgbkrk approved these changes Oct 9, 2017
Copy link

@rgbkrk rgbkrk left a comment

This seems like a pretty reasonable choice for edit.


@rgbkrk rgbkrk merged commit 0112703 into jupyter:master Oct 9, 2017
4 checks passed
@rgbkrk rgbkrk deleted the issue-2203 branch Oct 9, 2017
@gnestor gnestor removed this from the 5.2 milestone Oct 13, 2017
@gnestor gnestor added this to the 5.2 milestone Oct 13, 2017
Copy link

@billgreenwald billgreenwald commented Nov 9, 2017

Sorry if this isnt the right thread for this question:

Since upgrading to jupyterhub 5.2.0, the default option for .pdf's switched from view to edit. Is this intentional?

Separately, where is this "white list" located, so that I could manually tell the hub to view .pdf's instead of edit them.



Copy link

@takluyver takluyver commented Nov 9, 2017

(i'm guessing you mean jupyter notebook - jupyterhub is on version 0.8.1)

The list of viewable filetypes is here:

var html_types = ['htm', 'html', 'xhtml', 'xml', 'mht', 'mhtml'];
var media_extension = ['3gp', 'avi', 'mov', 'mp4', 'm4v', 'm4a', 'mp3', 'mkv', 'ogv', 'ogm', 'ogg', 'oga', 'webm', 'wav'];
var image_type = ['bmp', 'gif', 'jpg', 'jpeg', 'png', 'webp'];
var other_type = ['ico'];

PDF should probably be on it.


@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants