Merge pull request #6940 from takluyver/i6937

Just use notebook_path in download URLs
This commit is contained in:
Thomas Kluyver 2014-11-14 14:32:45 -08:00
commit 3dbb600968

View File

@ -69,7 +69,6 @@ define([
MenuBar.prototype._nbconvert = function (format, download) {
download = download || false;
var notebook_path = this.notebook.notebook_path;
var notebook_name = this.notebook.notebook_name;
if (this.notebook.dirty) {
this.notebook.save_notebook({async : false});
}
@ -77,8 +76,7 @@ define([
this.base_url,
'nbconvert',
format,
notebook_path,
notebook_name
notebook_path
) + "?download=" + download.toString();
window.open(url);
@ -120,17 +118,11 @@ define([
this.element.find('#download_ipynb').click(function () {
var base_url = that.notebook.base_url;
var notebook_path = that.notebook.notebook_path;
var notebook_name = that.notebook.notebook_name;
if (that.notebook.dirty) {
that.notebook.save_notebook({async : false});
}
var url = utils.url_join_encode(
base_url,
'files',
notebook_path,
notebook_name
);
var url = utils.url_join_encode(base_url, 'files', notebook_path);
window.open(url + '?download=1');
});