mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Expose and use get requests specifying type in the JS
This commit is contained in:
parent
ce6dd40c5c
commit
f9db65ab6f
@ -2102,6 +2102,7 @@ define([
|
||||
this.notebook_name = utils.url_path_split(this.notebook_path)[1];
|
||||
this.events.trigger('notebook_loading.Notebook');
|
||||
this.contents.get(notebook_path, {
|
||||
type: 'notebook',
|
||||
success: $.proxy(this.load_notebook_success, this),
|
||||
error: $.proxy(this.load_notebook_error, this)
|
||||
});
|
||||
|
@ -87,6 +87,9 @@ define([
|
||||
error : this.create_basic_error_handler(options.error)
|
||||
};
|
||||
var url = this.api_url(path);
|
||||
if (options.type) {
|
||||
url += '?type=' + options.type;
|
||||
}
|
||||
$.ajax(url, settings);
|
||||
};
|
||||
|
||||
@ -250,20 +253,11 @@ define([
|
||||
* last_modified: last modified dat
|
||||
* @method list_notebooks
|
||||
* @param {String} path The path to list notebooks in
|
||||
* @param {Function} load_callback called with list of notebooks on success
|
||||
* @param {Function} error called with ajax results on error
|
||||
* @param {Object} options including success and error callbacks
|
||||
*/
|
||||
Contents.prototype.list_contents = function(path, options) {
|
||||
var settings = {
|
||||
processData : false,
|
||||
cache : false,
|
||||
type : "GET",
|
||||
dataType : "json",
|
||||
success : options.success,
|
||||
error : this.create_basic_error_handler(options.error)
|
||||
};
|
||||
|
||||
$.ajax(this.api_url(path), settings);
|
||||
options.type = 'directory';
|
||||
this.get(path, options);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user