Heading/plaintext cells now wired up to toolbar UI.

pull/37/head
Brian Granger 14 years ago
parent 2f88004a05
commit a00fc0165b

@ -136,7 +136,7 @@ var IPython = (function (IPython) {
that.control_key_active = false;
return false;
} else if (event.which === 84 && that.control_key_active) {
// To Plaintext = r
// To Plaintext = t
that.to_plaintext();
that.control_key_active = false;
return false;
@ -401,7 +401,11 @@ var IPython = (function (IPython) {
};
var cell = this.get_cell(index)
cell.select();
IPython.toolbar.set_cell_type(cell.cell_type);
if (cell.cell_type === 'heading') {
IPython.toolbar.set_cell_type(cell.cell_type+cell.level);
} else {
IPython.toolbar.set_cell_type(cell.cell_type)
}
};
return this;
};
@ -672,6 +676,7 @@ var IPython = (function (IPython) {
source_element.remove();
this.dirty = true;
};
IPython.toolbar.set_cell_type("heading"+level);
};
};

@ -108,6 +108,20 @@ var IPython = (function (IPython) {
IPython.notebook.to_code();
} else if (cell_type === 'markdown') {
IPython.notebook.to_markdown();
} else if (cell_type === 'plaintext') {
IPython.notebook.to_plaintext();
} else if (cell_type === 'heading1') {
IPython.notebook.to_heading(undefined, 1);
} else if (cell_type === 'heading2') {
IPython.notebook.to_heading(undefined, 2);
} else if (cell_type === 'heading3') {
IPython.notebook.to_heading(undefined, 3);
} else if (cell_type === 'heading4') {
IPython.notebook.to_heading(undefined, 4);
} else if (cell_type === 'heading5') {
IPython.notebook.to_heading(undefined, 5);
} else if (cell_type === 'heading6') {
IPython.notebook.to_heading(undefined, 6);
};
});

@ -180,6 +180,13 @@
<select id="cell_type">
<option value="code">Code</option>
<option value="markdown">Markdown</option>
<option value="plaintext">Plaintext</option>
<option value="heading1">Heading 1</option>
<option value="heading2">Heading 2</option>
<option value="heading3">Heading 3</option>
<option value="heading4">Heading 4</option>
<option value="heading5">Heading 5</option>
<option value="heading6">Heading 6</option>
</select>
</span>

Loading…
Cancel
Save