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
merged 5 commits into from
Oct 9, 2017
Merged

Improve Edit/View behavior #2911

merged 5 commits into from
Oct 9, 2017

Conversation

gnestor
Copy link
Contributor

@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 https://support.google.com/chromebook/answer/183093?hl=en), 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
Copy link
Member

@rgbkrk rgbkrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a pretty reasonable choice for edit.

@rgbkrk rgbkrk merged commit 0112703 into jupyter:master Oct 9, 2017
@rgbkrk rgbkrk deleted the issue-2203 branch October 9, 2017 21:05
@gnestor gnestor modified the milestone: 5.2 Oct 13, 2017
@billgreenwald
Copy link

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.

Thanks!

@takluyver
Copy link
Member

(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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants