mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Just use notebook_path in download URLs
notebook_name is now superfluous Closes gh-6937
This commit is contained in:
parent
1fba948bd8
commit
7240d2dafc
@ -69,7 +69,6 @@ define([
|
|||||||
MenuBar.prototype._nbconvert = function (format, download) {
|
MenuBar.prototype._nbconvert = function (format, download) {
|
||||||
download = download || false;
|
download = download || false;
|
||||||
var notebook_path = this.notebook.notebook_path;
|
var notebook_path = this.notebook.notebook_path;
|
||||||
var notebook_name = this.notebook.notebook_name;
|
|
||||||
if (this.notebook.dirty) {
|
if (this.notebook.dirty) {
|
||||||
this.notebook.save_notebook({async : false});
|
this.notebook.save_notebook({async : false});
|
||||||
}
|
}
|
||||||
@ -78,7 +77,6 @@ define([
|
|||||||
'nbconvert',
|
'nbconvert',
|
||||||
format,
|
format,
|
||||||
notebook_path,
|
notebook_path,
|
||||||
notebook_name
|
|
||||||
) + "?download=" + download.toString();
|
) + "?download=" + download.toString();
|
||||||
|
|
||||||
window.open(url);
|
window.open(url);
|
||||||
@ -120,17 +118,11 @@ define([
|
|||||||
this.element.find('#download_ipynb').click(function () {
|
this.element.find('#download_ipynb').click(function () {
|
||||||
var base_url = that.notebook.base_url;
|
var base_url = that.notebook.base_url;
|
||||||
var notebook_path = that.notebook.notebook_path;
|
var notebook_path = that.notebook.notebook_path;
|
||||||
var notebook_name = that.notebook.notebook_name;
|
|
||||||
if (that.notebook.dirty) {
|
if (that.notebook.dirty) {
|
||||||
that.notebook.save_notebook({async : false});
|
that.notebook.save_notebook({async : false});
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = utils.url_join_encode(
|
var url = utils.url_join_encode(base_url, 'files', notebook_path);
|
||||||
base_url,
|
|
||||||
'files',
|
|
||||||
notebook_path,
|
|
||||||
notebook_name
|
|
||||||
);
|
|
||||||
window.open(url + '?download=1');
|
window.open(url + '?download=1');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user