mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Revert notebook.js to master
This commit is contained in:
parent
3c36e715c9
commit
4c7357f4a4
@ -1,5 +1,5 @@
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// Copyright (C) 2008-2013 The IPython Development Team
|
// Copyright (C) 2011 The IPython Development Team
|
||||||
//
|
//
|
||||||
// Distributed under the terms of the BSD License. The full license is in
|
// Distributed under the terms of the BSD License. The full license is in
|
||||||
// the file COPYING, distributed as part of this software.
|
// the file COPYING, distributed as part of this software.
|
||||||
@ -1288,11 +1288,18 @@ var IPython = (function (IPython) {
|
|||||||
*
|
*
|
||||||
* @method start_session
|
* @method start_session
|
||||||
*/
|
*/
|
||||||
Notebook.prototype.start_kernel = function () {
|
Notebook.prototype.start_session = function () {
|
||||||
var base_url = $('body').data('baseKernelUrl') + "kernels";
|
this.session = new IPython.Session(this.notebook_name, this.notebook_path, this);
|
||||||
this.kernel = new IPython.Kernel(base_url);
|
this.session.start($.proxy(this._session_started, this));
|
||||||
this.kernel.start({notebook: this.notebook_id});
|
};
|
||||||
// Now that the kernel has been created, tell the CodeCells about it.
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Once a session is started, link the code cells to the kernel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Notebook.prototype._session_started = function(){
|
||||||
|
this.kernel = this.session.kernel;
|
||||||
var ncells = this.ncells();
|
var ncells = this.ncells();
|
||||||
for (var i=0; i<ncells; i++) {
|
for (var i=0; i<ncells; i++) {
|
||||||
var cell = this.get_cell(i);
|
var cell = this.get_cell(i);
|
||||||
@ -1300,7 +1307,6 @@ var IPython = (function (IPython) {
|
|||||||
cell.set_kernel(this.session.kernel);
|
cell.set_kernel(this.session.kernel);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
this.widget_manager = IPython.WidgetManager(this.kernel.comm_manager);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user