mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-31 13:40:29 +08:00
fix baseUrl
This commit is contained in:
parent
9cd9e5db73
commit
6ed926be7b
@ -84,6 +84,11 @@ var IPython = (function (IPython) {
|
||||
this.style();
|
||||
};
|
||||
|
||||
ClusterItem.prototype.baseProjectUrl = function(){
|
||||
return this._baseProjectUrl || $('body').data('baseProjectUrl');
|
||||
};
|
||||
|
||||
|
||||
|
||||
ClusterItem.prototype.style = function () {
|
||||
this.element.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix');
|
||||
@ -138,7 +143,7 @@ var IPython = (function (IPython) {
|
||||
}
|
||||
};
|
||||
status_col.html('starting');
|
||||
var url = this.baseProjectUrl() + 'clusters/' + that.data.profile + '/start';
|
||||
var url = that.baseProjectUrl() + 'clusters/' + that.data.profile + '/start';
|
||||
$.ajax(url, settings);
|
||||
};
|
||||
});
|
||||
@ -172,7 +177,7 @@ var IPython = (function (IPython) {
|
||||
}
|
||||
};
|
||||
status_col.html('stopping')
|
||||
var url = this.baseProjectUrl() + 'clusters/' + that.data.profile + '/stop';
|
||||
var url = that.baseProjectUrl() + 'clusters/' + that.data.profile + '/stop';
|
||||
$.ajax(url, settings);
|
||||
});
|
||||
};
|
||||
|
@ -65,18 +65,19 @@ var IPython = (function (IPython) {
|
||||
|
||||
MenuBar.prototype.bind_events = function () {
|
||||
// File
|
||||
var that = this;
|
||||
this.element.find('#new_notebook').click(function () {
|
||||
window.open(this.baseProjectUrl()+'new');
|
||||
window.open(that.baseProjectUrl()+'new');
|
||||
});
|
||||
this.element.find('#open_notebook').click(function () {
|
||||
window.open(this.baseProjectUrl());
|
||||
window.open(that.baseProjectUrl());
|
||||
});
|
||||
this.element.find('#rename_notebook').click(function () {
|
||||
IPython.save_widget.rename_notebook();
|
||||
});
|
||||
this.element.find('#copy_notebook').click(function () {
|
||||
var notebook_id = IPython.notebook.get_notebook_id();
|
||||
var url = this.baseProjectUrl() + notebook_id + '/copy';
|
||||
var url = that.baseProjectUrl() + notebook_id + '/copy';
|
||||
window.open(url,'_blank');
|
||||
return false;
|
||||
});
|
||||
@ -85,13 +86,13 @@ var IPython = (function (IPython) {
|
||||
});
|
||||
this.element.find('#download_ipynb').click(function () {
|
||||
var notebook_id = IPython.notebook.get_notebook_id();
|
||||
var url = this.baseProjectUrl() + 'notebooks/' +
|
||||
var url = that.baseProjectUrl() + 'notebooks/' +
|
||||
notebook_id + '?format=json';
|
||||
window.location.assign(url);
|
||||
});
|
||||
this.element.find('#download_py').click(function () {
|
||||
var notebook_id = IPython.notebook.get_notebook_id();
|
||||
var url = this.baseProjectUrl() + 'notebooks/' +
|
||||
var url = that.baseProjectUrl() + 'notebooks/' +
|
||||
notebook_id + '?format=py';
|
||||
window.location.assign(url);
|
||||
});
|
||||
|
@ -216,7 +216,7 @@ var IPython = (function (IPython) {
|
||||
that.load_list();
|
||||
}
|
||||
};
|
||||
var url = this.baseProjectUrl() + 'kernels/'+kernel;
|
||||
var url = that.baseProjectUrl() + 'kernels/'+kernel;
|
||||
$.ajax(url, settings);
|
||||
});
|
||||
new_buttons.append(shutdown_button);
|
||||
@ -257,7 +257,7 @@ var IPython = (function (IPython) {
|
||||
parent_item.remove();
|
||||
}
|
||||
};
|
||||
var url = this.baseProjectUrl() + 'notebooks/' + notebook_id;
|
||||
var url = that.baseProjectUrl() + 'notebooks/' + notebook_id;
|
||||
$.ajax(url, settings);
|
||||
$(this).dialog('close');
|
||||
},
|
||||
@ -306,7 +306,7 @@ var IPython = (function (IPython) {
|
||||
};
|
||||
|
||||
var qs = $.param({name:nbname, format:nbformat});
|
||||
var url = this.baseProjectUrl() + 'notebooks?' + qs;
|
||||
var url = that.baseProjectUrl() + 'notebooks?' + qs;
|
||||
$.ajax(url, settings);
|
||||
});
|
||||
var cancel_button = $('<button>Cancel</button>').button().
|
||||
|
Loading…
x
Reference in New Issue
Block a user