mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Use /files
prefix for PDF-like files
This commit is contained in:
parent
11838000fb
commit
009af0e833
@ -563,6 +563,12 @@ define([
|
||||
return model.mimetype === 'text/html'
|
||||
|| includes_extension(model.path, viewable_extensions);
|
||||
};
|
||||
|
||||
// Files like PDF that should be opened using `/files` prefix
|
||||
NotebookList.prototype._is_pdflike = function(model) {
|
||||
var pdflike_extensions = ['pdf'];
|
||||
return includes_extension(model.path, pdflike_extensions);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles when any row selector checkbox is toggled.
|
||||
@ -732,6 +738,10 @@ define([
|
||||
{
|
||||
uri_prefix = 'view';
|
||||
}
|
||||
if (model.type === 'file' && this._is_pdflike(model))
|
||||
{
|
||||
uri_prefix = 'files';
|
||||
}
|
||||
if (model.type === 'file' && this._is_notebook(model))
|
||||
{
|
||||
uri_prefix = 'notebooks';
|
||||
|
Loading…
Reference in New Issue
Block a user