Skip to content

Commit c0b678c

Browse files
committed
Remove editable whitelist
1 parent 12592ef commit c0b678c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

notebook/static/tree/js/notebooklist.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -537,24 +537,19 @@ define([
537537
};
538538

539539
NotebookList.ipynb_extensions = ['ipynb'];
540-
// List of text file extensions from
541-
// https://github.com/sindresorhus/text-extensions/blob/master/text-extensions.json
542-
var editable_extensions = ['applescript', 'asp', 'aspx', 'atom', 'bashrc', 'bat', 'bbcolors', 'bib', 'bowerrc', 'c', 'cc', 'cfc', 'cfg', 'cfm', 'cmd', 'cnf', 'coffee', 'conf', 'cpp', 'cson', 'css', 'csslintrc', 'csv', 'curlrc', 'cxx', 'diff', 'eco', 'editorconfig', 'ejs', 'emacs', 'eml', 'erb', 'erl', 'eslintignore', 'eslintrc', 'gemrc', 'gitattributes', 'gitconfig', 'gitignore', 'go', 'gvimrc', 'h', 'haml', 'hbs', 'hgignore', 'hpp', 'htaccess', 'htm', 'html', 'iced', 'ini', 'ino', 'irbrc', 'itermcolors', 'jade', 'js', 'jscsrc', 'jshintignore', 'jshintrc', 'json', 'jsonld', 'jsx', 'less', 'log', 'ls', 'm', 'markdown', 'md', 'mdown', 'mdwn', 'mht', 'mhtml', 'mkd', 'mkdn', 'mkdown', 'nfo', 'npmignore', 'npmrc', 'nvmrc', 'patch', 'pbxproj', 'pch', 'php', 'phtml', 'pl', 'pm', 'properties', 'py', 'rb', 'rdoc', 'rdoc_options', 'ron', 'rss', 'rst', 'rtf', 'rvmrc', 'sass', 'scala', 'scss', 'seestyle', 'sh', 'sls', 'sql', 'sss', 'strings', 'styl', 'stylus', 'sub', 'sublime-build', 'sublime-commands', 'sublime-completions', 'sublime-keymap', 'sublime-macro', 'sublime-menu', 'sublime-project', 'sublime-settings', 'sublime-workspace', 'svg', 'terminal', 'tex', 'text', 'textile', 'tmLanguage', 'tmTheme', 'tsv', 'txt', 'vbs', 'vim', 'viminfo', 'vimrc', 'webapp', 'xht', 'xhtml', 'xml', 'xsl', 'yaml', 'yml', 'zsh', 'zshrc'];
543-
NotebookList.editable_extensions = editable_extensions.concat(['ipynb', 'geojson', 'plotly', 'plotly.json', 'vg', 'vg.json', 'vl', 'vl.json']);
544540
NotebookList.viewable_extensions = ['htm', 'html', 'xhtml', 'mht', 'mhtml'];
545541

546542
NotebookList.prototype._is_notebook = function(model) {
547543
return includes_extension(model.path, NotebookList.ipynb_extensions);
548544
};
549545

550546
NotebookList.prototype._is_editable = function(model) {
551-
// Editable: any text/ mimetype, specific mimetypes defined as editable,
552-
// +json and +xml mimetypes, specific extensions listed as editable.
553-
return model.mimetype &&
554-
(model.mimetype.indexOf('text/') === 0
555-
|| item_in(model.mimetype, this.EDIT_MIMETYPES)
556-
|| json_or_xml_container_mimetype(model.mimetype))
557-
|| includes_extension(model.path, NotebookList.editable_extensions);
547+
// Allow any file to be "edited"
548+
// Non-text files will display the following error:
549+
// Error: [FILE] is not UTF-8 encoded
550+
// Saving is disabled.
551+
// See Console for more details.
552+
return true;
558553
};
559554

560555
NotebookList.prototype._is_viewable = function(model) {

0 commit comments

Comments
 (0)