##// END OF EJS Templates
add doc to base Cell
Matthias BUSSONNIER -
Show More
@@ -18,7 +18,7 var IPython = (function (IPython) {
18 var utils = IPython.utils;
18 var utils = IPython.utils;
19
19
20 /**
20 /**
21 * The Base `Cell` class from which to inherit
21 * The Base `Cell` class from which to inherit
22 * @class Cell
22 * @class Cell
23 */
23 */
24
24
@@ -44,7 +44,7 var IPython = (function (IPython) {
44
44
45 /**
45 /**
46 * Empty. Subclasses must implement create_element.
46 * Empty. Subclasses must implement create_element.
47 * This should contain all the code to create the DOM element in notebook
47 * This should contain all the code to create the DOM element in notebook
48 * and will be called by Base Class constructor.
48 * and will be called by Base Class constructor.
49 * @method create_element
49 * @method create_element
50 */
50 */
@@ -52,9 +52,9 var IPython = (function (IPython) {
52
52
53
53
54 /**
54 /**
55 * Empty. Subclasses must implement create_element.
55 * Subclasses can implement override bind_events.
56 * This should contain all the code to create the DOM element in notebook
56 * Be carefull to call the parent method when overwriting as it fires event.
57 * and will be called by Base Class constructor.
57 * this will be triggerd after create_element in constructor.
58 * @method bind_events
58 * @method bind_events
59 */
59 */
60 Cell.prototype.bind_events = function () {
60 Cell.prototype.bind_events = function () {
@@ -72,6 +72,10 var IPython = (function (IPython) {
72 });
72 });
73 };
73 };
74
74
75 /**
76 * Triger typsetting of math by mathjax on current cell element
77 * @method typeset
78 */
75 Cell.prototype.typeset = function () {
79 Cell.prototype.typeset = function () {
76 if (window.MathJax){
80 if (window.MathJax){
77 var cell_math = this.element.get(0);
81 var cell_math = this.element.get(0);
@@ -79,12 +83,20 var IPython = (function (IPython) {
79 }
83 }
80 };
84 };
81
85
86 /**
87 * should be triggerd when cell is selected
88 * @method select
89 */
82 Cell.prototype.select = function () {
90 Cell.prototype.select = function () {
83 this.element.addClass('ui-widget-content ui-corner-all');
91 this.element.addClass('ui-widget-content ui-corner-all');
84 this.selected = true;
92 this.selected = true;
85 };
93 };
86
94
87
95
96 /**
97 * should be triggerd when cell is unselected
98 * @method unselect
99 */
88 Cell.prototype.unselect = function () {
100 Cell.prototype.unselect = function () {
89 this.element.removeClass('ui-widget-content ui-corner-all');
101 this.element.removeClass('ui-widget-content ui-corner-all');
90 this.selected = false;
102 this.selected = false;
@@ -23,6 +23,7 var IPython = (function (IPython) {
23 *
23 *
24 * @class TextCell
24 * @class TextCell
25 * @constructor TextCell
25 * @constructor TextCell
26 * @extend Cell
26 */
27 */
27 var TextCell = function () {
28 var TextCell = function () {
28 this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
29 this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
@@ -429,7 +430,7 var IPython = (function (IPython) {
429 };
430 };
430
431
431
432
432 /**
433 /**
433 * @class HeadingCell
434 * @class HeadingCell
434 * @extends TextCell
435 * @extends TextCell
435 */
436 */
General Comments 0
You need to be logged in to leave comments. Login now