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

Conversation

Projects
None yet
4 participants
@gnestor
Copy link
Contributor

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

@gnestor gnestor requested review from takluyver and ellisonbg Oct 9, 2017

@rgbkrk

rgbkrk approved these changes Oct 9, 2017

Copy link
Member

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

codecov/patch Coverage not affected when comparing 12592ef...2fdc532
Details
codecov/project 79.08% remains the same compared to 12592ef
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgbkrk rgbkrk deleted the gnestor:issue-2203 branch Oct 9, 2017

@gnestor gnestor modified the milestone: 5.2 Oct 13, 2017

@billgreenwald

This comment has been minimized.

Copy link

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.

Thanks!

@takluyver

This comment has been minimized.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.