##// END OF EJS Templates
set cell_type properly first-class in the Cell object...
MinRK -
Show More
@@ -52,7 +52,7 b' var IPython = (function (IPython) {'
52 // same order. Easiest is to create and set to null in parent class.
52 // same order. Easiest is to create and set to null in parent class.
53
53
54 this.element = null;
54 this.element = null;
55 this.cell_type = null;
55 this.cell_type = this.cell_type || null;
56 this.code_mirror = null;
56 this.code_mirror = null;
57
57
58
58
@@ -201,6 +201,7 b' var IPython = (function (IPython) {'
201 Cell.prototype.toJSON = function () {
201 Cell.prototype.toJSON = function () {
202 var data = {};
202 var data = {};
203 data.metadata = this.metadata;
203 data.metadata = this.metadata;
204 data.cell_type = this.cell_type;
204 return data;
205 return data;
205 };
206 };
206
207
@@ -444,7 +444,6 b' var IPython = (function (IPython) {'
444 CodeCell.prototype.toJSON = function () {
444 CodeCell.prototype.toJSON = function () {
445 var data = IPython.Cell.prototype.toJSON.apply(this);
445 var data = IPython.Cell.prototype.toJSON.apply(this);
446 data.input = this.get_text();
446 data.input = this.get_text();
447 data.cell_type = 'code';
448 // is finite protect against undefined and '*' value
447 // is finite protect against undefined and '*' value
449 if (isFinite(this.input_prompt_number)) {
448 if (isFinite(this.input_prompt_number)) {
450 data.prompt_number = this.input_prompt_number;
449 data.prompt_number = this.input_prompt_number;
@@ -276,7 +276,6 b' var IPython = (function (IPython) {'
276 */
276 */
277 TextCell.prototype.toJSON = function () {
277 TextCell.prototype.toJSON = function () {
278 var data = IPython.Cell.prototype.toJSON.apply(this);
278 var data = IPython.Cell.prototype.toJSON.apply(this);
279 data.cell_type = this.cell_type;
280 data.source = this.get_text();
279 data.source = this.get_text();
281 if (data.source == this.placeholder) {
280 if (data.source == this.placeholder) {
282 data.source = "";
281 data.source = "";
@@ -357,7 +356,7 b' var IPython = (function (IPython) {'
357 var that = this;
356 var that = this;
358 this.element.focusout(
357 this.element.focusout(
359 function() { that.auto_highlight(); }
358 function() { that.auto_highlight(); }
360 );
359 );
361 };
360 };
362
361
363 RawCell.options_default = {
362 RawCell.options_default = {
General Comments 0
You need to be logged in to leave comments. Login now