mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +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 () {
|
Kernel.prototype.restart = function () {
|
||||||
$([IPython.events]).trigger({type: 'status_restarting.Kernel', kernel: this});
|
$([IPython.events]).trigger('status_restarting.Kernel', {kernel: this});
|
||||||
var that = this;
|
var that = this;
|
||||||
if (this.running) {
|
if (this.running) {
|
||||||
this.stop_channels();
|
this.stop_channels();
|
||||||
@ -246,7 +246,7 @@ var IPython = (function (IPython) {
|
|||||||
allow_stdin : false
|
allow_stdin : false
|
||||||
};
|
};
|
||||||
$.extend(true, content, options)
|
$.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);
|
var msg = this._get_msg("execute_request", content);
|
||||||
this.shell_channel.send(JSON.stringify(msg));
|
this.shell_channel.send(JSON.stringify(msg));
|
||||||
this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
|
this.set_callbacks_for_msg(msg.header.msg_id, callbacks);
|
||||||
@ -280,7 +280,7 @@ var IPython = (function (IPython) {
|
|||||||
|
|
||||||
Kernel.prototype.interrupt = function () {
|
Kernel.prototype.interrupt = function () {
|
||||||
if (this.running) {
|
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");
|
$.post(this.kernel_url + "/interrupt");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -313,7 +313,7 @@ var IPython = (function (IPython) {
|
|||||||
|
|
||||||
Kernel.prototype._handle_shell_reply = function (e) {
|
Kernel.prototype._handle_shell_reply = function (e) {
|
||||||
reply = $.parseJSON(e.data);
|
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 header = reply.header;
|
||||||
var content = reply.content;
|
var content = reply.content;
|
||||||
var metadata = reply.metadata;
|
var metadata = reply.metadata;
|
||||||
@ -369,12 +369,12 @@ var IPython = (function (IPython) {
|
|||||||
}
|
}
|
||||||
} else if (msg_type === 'status') {
|
} else if (msg_type === 'status') {
|
||||||
if (content.execution_state === 'busy') {
|
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') {
|
} 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') {
|
} else if (content.execution_state === 'dead') {
|
||||||
this.stop_channels();
|
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') {
|
} else if (msg_type === 'clear_output') {
|
||||||
var cb = callbacks['clear_output'];
|
var cb = callbacks['clear_output'];
|
||||||
|
Loading…
Reference in New Issue
Block a user