add restart-run-all action

and constituent restart, run-all actions
pull/400/head
Min RK 11 years ago
parent e79b84cd6b
commit 0615c251f2

@ -59,6 +59,31 @@ define(function(require){
env.notebook.execute_cell_and_insert_below();
}
},
'run-all': {
help: 'run all cells',
help_index: 'bd',
handler: function (env) {
env.notebook.execute_all_cells();
}
},
'restart-run-all': {
help: 'restart the kernel, then re-run the whole notebook',
help_index: 'be',
handler: function (env) {
var notebook = env.notebook;
notebook.events.one('kernel_ready.Kernel', function () {
notebook.execute_all_cells();
});
notebook.restart_kernel();
}
},
'restart': {
help: 'restart the kernel',
help_index: 'bf',
handler: function (env) {
env.notebook.restart_kernel();
}
},
'go-to-command-mode': {
help : 'command mode',
help_index : 'aa',

@ -35,6 +35,7 @@ define([
this.base_url = options.base_url || utils.get_body_data("baseUrl");
this.selector = selector;
this.notebook = options.notebook;
this.actions = this.notebook.keyboard_manager.actions;
this.contents = options.contents;
this.events = options.events;
this.save_widget = options.save_widget;
@ -298,6 +299,9 @@ define([
this.element.find('#restart_kernel').click(function () {
that.notebook.restart_kernel();
});
this.element.find('#restart_run_all').click(function () {
that.actions.call('ipython.restart-run-all');
});
this.element.find('#reconnect_kernel').click(function () {
that.notebook.kernel.reconnect();
});

Loading…
Cancel
Save