mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
change all trigger parameter to (event,data)
This commit is contained in:
parent
afa18913b9
commit
68fd917bfb
@ -64,7 +64,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
|
||||
Kernel.prototype.restart = function () {
|
||||
$([IPython.events]).trigger({type: 'status_restarting.Kernel', kernel: this});
|
||||
$([IPython.events]).trigger('status_restarting.Kernel', {kernel: this});
|
||||
var that = this;
|
||||
if (this.running) {
|
||||
this.stop_channels();
|
||||
@ -246,7 +246,7 @@ var IPython = (function (IPython) {
|
||||
allow_stdin : false
|
||||
};
|
||||
$.extend(true, content, options)
|
||||
$([IPython.events]).trigger({type: 'execution_request.Kernel', kernel: this, content:content});
|
||||
$([IPython.events]).trigger('execution_request.Kernel', {kernel: this, content:content});
|
||||
var msg = this._get_msg("execute_request", content);
|
||||
this.shell_channel.send(JSON.stringify(msg));
|
||||
this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
|
||||
@ -280,7 +280,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
Kernel.prototype.interrupt = function () {
|
||||
if (this.running) {
|
||||
$([IPython.events]).trigger({type: 'status_interrupting.Kernel', kernel: this});
|
||||
$([IPython.events]).trigger('status_interrupting.Kernel', {kernel: this});
|
||||
$.post(this.kernel_url + "/interrupt");
|
||||
};
|
||||
};
|
||||
@ -313,7 +313,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
Kernel.prototype._handle_shell_reply = function (e) {
|
||||
reply = $.parseJSON(e.data);
|
||||
$([IPython.events]).trigger({type: 'shell_reply.Kernel', kernel: this, reply:reply});
|
||||
$([IPython.events]).trigger('shell_reply.Kernel', {kernel: this, reply:reply});
|
||||
var header = reply.header;
|
||||
var content = reply.content;
|
||||
var metadata = reply.metadata;
|
||||
@ -369,12 +369,12 @@ var IPython = (function (IPython) {
|
||||
}
|
||||
} else if (msg_type === 'status') {
|
||||
if (content.execution_state === 'busy') {
|
||||
$([IPython.events]).trigger({type: 'status_busy.Kernel', kernel: this});
|
||||
$([IPython.events]).trigger('status_busy.Kernel', {kernel: this});
|
||||
} else if (content.execution_state === 'idle') {
|
||||
$([IPython.events]).trigger({type: 'status_idle.Kernel', kernel: this});
|
||||
$([IPython.events]).trigger('status_idle.Kernel', {kernel: this});
|
||||
} else if (content.execution_state === 'dead') {
|
||||
this.stop_channels();
|
||||
$([IPython.events]).trigger({type: 'status_dead.Kernel', kernel: this});
|
||||
$([IPython.events]).trigger('status_dead.Kernel', {kernel: this});
|
||||
};
|
||||
} else if (msg_type === 'clear_output') {
|
||||
var cb = callbacks['clear_output'];
|
||||
|
Loading…
Reference in New Issue
Block a user