|
|
|
|
@ -39,18 +39,28 @@ var IPython = (function (IPython) {
|
|
|
|
|
this.placeholder = options.placeholder || '';
|
|
|
|
|
this.read_only = options.cm_config.readOnly;
|
|
|
|
|
this.selected = false;
|
|
|
|
|
this.element = null;
|
|
|
|
|
this.metadata = {};
|
|
|
|
|
// load this from metadata later ?
|
|
|
|
|
this.user_highlight = 'auto';
|
|
|
|
|
this.cm_config = options.cm_config;
|
|
|
|
|
this.cell_id = utils.uuid();
|
|
|
|
|
this._options = options;
|
|
|
|
|
|
|
|
|
|
// For JS VM engines optimisation, attributes should be all set (even
|
|
|
|
|
// to null) in the constructor, and if possible, if different subclass
|
|
|
|
|
// have new attributes with same name, they should be created in the
|
|
|
|
|
// same order. Easiest is to create and set to null in parent class.
|
|
|
|
|
|
|
|
|
|
this.element = null;
|
|
|
|
|
this.cell_type = null;
|
|
|
|
|
this.code_mirror = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.create_element();
|
|
|
|
|
if (this.element !== null) {
|
|
|
|
|
this.element.data("cell", this);
|
|
|
|
|
this.bind_events();
|
|
|
|
|
}
|
|
|
|
|
this.cell_id = utils.uuid();
|
|
|
|
|
this._options = options;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Cell.options_default = {
|
|
|
|
|
@ -309,7 +319,6 @@ var IPython = (function (IPython) {
|
|
|
|
|
}
|
|
|
|
|
if (mode.search('magic_') != 0) {
|
|
|
|
|
this.code_mirror.setOption('mode', mode);
|
|
|
|
|
console.log('from',current_mode,'to',mode)
|
|
|
|
|
CodeMirror.autoLoadMode(this.code_mirror, mode);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -336,7 +345,6 @@ var IPython = (function (IPython) {
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
this.code_mirror.setOption('mode', mmode);
|
|
|
|
|
console.log('from',current_mode,'to', mmode)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -352,7 +360,6 @@ var IPython = (function (IPython) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.code_mirror.setOption('mode', default_mode);
|
|
|
|
|
console.log('from',current_mode,'to', default_mode)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IPython.Cell = Cell;
|
|
|
|
|
|