##// END OF EJS Templates
Expose and use get requests specifying type in the JS
Thomas Kluyver -
Show More
@@ -2102,6 +2102,7 b' define(['
2102 this.notebook_name = utils.url_path_split(this.notebook_path)[1];
2102 this.notebook_name = utils.url_path_split(this.notebook_path)[1];
2103 this.events.trigger('notebook_loading.Notebook');
2103 this.events.trigger('notebook_loading.Notebook');
2104 this.contents.get(notebook_path, {
2104 this.contents.get(notebook_path, {
2105 type: 'notebook',
2105 success: $.proxy(this.load_notebook_success, this),
2106 success: $.proxy(this.load_notebook_success, this),
2106 error: $.proxy(this.load_notebook_error, this)
2107 error: $.proxy(this.load_notebook_error, this)
2107 });
2108 });
@@ -87,6 +87,9 b' define(['
87 error : this.create_basic_error_handler(options.error)
87 error : this.create_basic_error_handler(options.error)
88 };
88 };
89 var url = this.api_url(path);
89 var url = this.api_url(path);
90 if (options.type) {
91 url += '?type=' + options.type;
92 }
90 $.ajax(url, settings);
93 $.ajax(url, settings);
91 };
94 };
92
95
@@ -250,20 +253,11 b' define(['
250 * last_modified: last modified dat
253 * last_modified: last modified dat
251 * @method list_notebooks
254 * @method list_notebooks
252 * @param {String} path The path to list notebooks in
255 * @param {String} path The path to list notebooks in
253 * @param {Function} load_callback called with list of notebooks on success
256 * @param {Object} options including success and error callbacks
254 * @param {Function} error called with ajax results on error
255 */
257 */
256 Contents.prototype.list_contents = function(path, options) {
258 Contents.prototype.list_contents = function(path, options) {
257 var settings = {
259 options.type = 'directory';
258 processData : false,
260 this.get(path, options);
259 cache : false,
260 type : "GET",
261 dataType : "json",
262 success : options.success,
263 error : this.create_basic_error_handler(options.error)
264 };
265
266 $.ajax(this.api_url(path), settings);
267 };
261 };
268
262
269
263
General Comments 0
You need to be logged in to leave comments. Login now