##// END OF EJS Templates
Revert notebook.js to master
Jonathan Frederic -
Show More
@@ -1,5 +1,5 b''
1 //----------------------------------------------------------------------------
1 //----------------------------------------------------------------------------
2 // Copyright (C) 2008-2013 The IPython Development Team
2 // Copyright (C) 2011 The IPython Development Team
3 //
3 //
4 // Distributed under the terms of the BSD License. The full license is in
4 // Distributed under the terms of the BSD License. The full license is in
5 // the file COPYING, distributed as part of this software.
5 // the file COPYING, distributed as part of this software.
@@ -1288,19 +1288,25 b' var IPython = (function (IPython) {'
1288 *
1288 *
1289 * @method start_session
1289 * @method start_session
1290 */
1290 */
1291 Notebook.prototype.start_kernel = function () {
1291 Notebook.prototype.start_session = function () {
1292 var base_url = $('body').data('baseKernelUrl') + "kernels";
1292 this.session = new IPython.Session(this.notebook_name, this.notebook_path, this);
1293 this.kernel = new IPython.Kernel(base_url);
1293 this.session.start($.proxy(this._session_started, this));
1294 this.kernel.start({notebook: this.notebook_id});
1294 };
1295 // Now that the kernel has been created, tell the CodeCells about it.
1295
1296
1297 /**
1298 * Once a session is started, link the code cells to the kernel
1299 *
1300 */
1301 Notebook.prototype._session_started = function(){
1302 this.kernel = this.session.kernel;
1296 var ncells = this.ncells();
1303 var ncells = this.ncells();
1297 for (var i=0; i<ncells; i++) {
1304 for (var i=0; i<ncells; i++) {
1298 var cell = this.get_cell(i);
1305 var cell = this.get_cell(i);
1299 if (cell instanceof IPython.CodeCell) {
1306 if (cell instanceof IPython.CodeCell) {
1300 cell.set_kernel(this.session.kernel);
1307 cell.set_kernel(this.session.kernel);
1301 };
1308 };
1302 };
1309 };
1303 this.widget_manager = IPython.WidgetManager(this.kernel.comm_manager);
1304 };
1310 };
1305
1311
1306 /**
1312 /**
@@ -2204,4 +2210,4 b' var IPython = (function (IPython) {'
2204
2210
2205 return IPython;
2211 return IPython;
2206
2212
2207 }(IPython));
2213 }(IPython)); No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now